drm/vmwgfx: Make the driver work without the dummy resources
authorZack Rusin <zackr@vmware.com>
Fri, 10 Feb 2023 02:34:37 +0000 (21:34 -0500)
committerZack Rusin <zackr@vmware.com>
Tue, 14 Feb 2023 03:37:55 +0000 (22:37 -0500)
commita44df74c720eb45d16a92ab9fc8a780d961d5e2b
tree0bd8367b35046a455ed6a542fa8bd63f63b8c25b
parent668b206601c5f5063e03b76784a0d3024fa2b249
drm/vmwgfx: Make the driver work without the dummy resources

In commit 180253782038 ("drm/ttm: stop allocating dummy resources during BO creation")
ttm stopped allocating dummy resources but vmwgfx was never ported to
handle it. Make the driver treat null resources as initial creation and
port code to handle null resources in general.

Fixes kernel oops'es on boot with vmwgfx.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Fixes: 180253782038 ("drm/ttm: stop allocating dummy resources during BO creation")
Cc: Christian König <christian.koenig@amd.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Nirmoy Das <nirmoy.das@intel.com>
Cc: Christian Koenig <christian.koenig@amd.com>
Cc: Huang Rui <ray.huang@amd.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230210023437.2214816-1-zack@kde.org
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c