Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/vmwgfx: Implement create_handle on drm_framebuffer_funcs

The fb handle code assumes it deals with GEM objects. Because vmwgfx
buffer objects were not actually GEM objects we were not able to
implement that interface. Now that vmwgfx supports GEM buffer objects
we can trivially implement create_handle for buffer object backed
framebuffers.
Among others this gets IGT's kms_getfb test passing.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211206172620.3139754-6-zack@kde.org

+11
+11
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
··· 987 987 * Buffer-object framebuffer code 988 988 */ 989 989 990 + static int vmw_framebuffer_bo_create_handle(struct drm_framebuffer *fb, 991 + struct drm_file *file_priv, 992 + unsigned int *handle) 993 + { 994 + struct vmw_framebuffer_bo *vfbd = 995 + vmw_framebuffer_to_vfbd(fb); 996 + 997 + return drm_gem_handle_create(file_priv, &vfbd->buffer->base.base, handle); 998 + } 999 + 990 1000 static void vmw_framebuffer_bo_destroy(struct drm_framebuffer *framebuffer) 991 1001 { 992 1002 struct vmw_framebuffer_bo *vfbd = ··· 1069 1059 } 1070 1060 1071 1061 static const struct drm_framebuffer_funcs vmw_framebuffer_bo_funcs = { 1062 + .create_handle = vmw_framebuffer_bo_create_handle, 1072 1063 .destroy = vmw_framebuffer_bo_destroy, 1073 1064 .dirty = vmw_framebuffer_bo_dirty_ext, 1074 1065 };