Commit b21fc738 authored by Gerd Hoffmann's avatar Gerd Hoffmann

drm/qxl: use drm_gem_object_funcs callbacks

Switch qxl to use drm_gem_object_funcs callbacks
instead of drm_driver callbacks.
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: http://patchwork.freedesktop.org/patch/msgid/20190904054740.20817-6-kraxel@redhat.com
parent 9286766b
...@@ -258,16 +258,8 @@ static struct drm_driver qxl_driver = { ...@@ -258,16 +258,8 @@ static struct drm_driver qxl_driver = {
#endif #endif
.prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle, .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_pin = qxl_gem_prime_pin,
.gem_prime_unpin = qxl_gem_prime_unpin,
.gem_prime_get_sg_table = qxl_gem_prime_get_sg_table,
.gem_prime_import_sg_table = qxl_gem_prime_import_sg_table, .gem_prime_import_sg_table = qxl_gem_prime_import_sg_table,
.gem_prime_vmap = qxl_gem_prime_vmap,
.gem_prime_vunmap = qxl_gem_prime_vunmap,
.gem_prime_mmap = qxl_gem_prime_mmap, .gem_prime_mmap = qxl_gem_prime_mmap,
.gem_free_object_unlocked = qxl_gem_object_free,
.gem_open_object = qxl_gem_object_open,
.gem_close_object = qxl_gem_object_close,
.fops = &qxl_fops, .fops = &qxl_fops,
.ioctls = qxl_ioctls, .ioctls = qxl_ioctls,
.irq_handler = qxl_irq_handler, .irq_handler = qxl_irq_handler,
......
...@@ -77,6 +77,17 @@ void qxl_ttm_placement_from_domain(struct qxl_bo *qbo, u32 domain, bool pinned) ...@@ -77,6 +77,17 @@ void qxl_ttm_placement_from_domain(struct qxl_bo *qbo, u32 domain, bool pinned)
} }
} }
static const struct drm_gem_object_funcs qxl_object_funcs = {
.free = qxl_gem_object_free,
.open = qxl_gem_object_open,
.close = qxl_gem_object_close,
.pin = qxl_gem_prime_pin,
.unpin = qxl_gem_prime_unpin,
.get_sg_table = qxl_gem_prime_get_sg_table,
.vmap = qxl_gem_prime_vmap,
.vunmap = qxl_gem_prime_vunmap,
};
int qxl_bo_create(struct qxl_device *qdev, int qxl_bo_create(struct qxl_device *qdev,
unsigned long size, bool kernel, bool pinned, u32 domain, unsigned long size, bool kernel, bool pinned, u32 domain,
struct qxl_surface *surf, struct qxl_surface *surf,
...@@ -100,6 +111,7 @@ int qxl_bo_create(struct qxl_device *qdev, ...@@ -100,6 +111,7 @@ int qxl_bo_create(struct qxl_device *qdev,
kfree(bo); kfree(bo);
return r; return r;
} }
bo->tbo.base.funcs = &qxl_object_funcs;
bo->type = domain; bo->type = domain;
bo->pin_count = pinned ? 1 : 0; bo->pin_count = pinned ? 1 : 0;
bo->surface_id = 0; bo->surface_id = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment