drm/mediatek: Use .dumb_map_offset and .dumb_destroy defaults
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them. Cc: CK Hu <ck.hu@mediatek.com> Cc: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Link: https://patchwork.freedesktop.org/patch/msgid/1500837417-40580-23-git-send-email-noralf@tronnes.org
This commit is contained in:
parent
8810419bdd
commit
819e0a98a0
@ -293,8 +293,6 @@ static struct drm_driver mtk_drm_driver = {
|
|||||||
.gem_free_object_unlocked = mtk_drm_gem_free_object,
|
.gem_free_object_unlocked = mtk_drm_gem_free_object,
|
||||||
.gem_vm_ops = &drm_gem_cma_vm_ops,
|
.gem_vm_ops = &drm_gem_cma_vm_ops,
|
||||||
.dumb_create = mtk_drm_gem_dumb_create,
|
.dumb_create = mtk_drm_gem_dumb_create,
|
||||||
.dumb_map_offset = mtk_drm_gem_dumb_map_offset,
|
|
||||||
.dumb_destroy = drm_gem_dumb_destroy,
|
|
||||||
|
|
||||||
.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,
|
||||||
|
@ -131,31 +131,6 @@ err_handle_create:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mtk_drm_gem_dumb_map_offset(struct drm_file *file_priv,
|
|
||||||
struct drm_device *dev, uint32_t handle,
|
|
||||||
uint64_t *offset)
|
|
||||||
{
|
|
||||||
struct drm_gem_object *obj;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
obj = drm_gem_object_lookup(file_priv, handle);
|
|
||||||
if (!obj) {
|
|
||||||
DRM_ERROR("failed to lookup gem object.\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = drm_gem_create_mmap_offset(obj);
|
|
||||||
if (ret)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
*offset = drm_vma_node_offset_addr(&obj->vma_node);
|
|
||||||
DRM_DEBUG_KMS("offset = 0x%llx\n", *offset);
|
|
||||||
|
|
||||||
out:
|
|
||||||
drm_gem_object_unreference_unlocked(obj);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int mtk_drm_gem_object_mmap(struct drm_gem_object *obj,
|
static int mtk_drm_gem_object_mmap(struct drm_gem_object *obj,
|
||||||
struct vm_area_struct *vma)
|
struct vm_area_struct *vma)
|
||||||
|
|
||||||
|
@ -46,9 +46,6 @@ struct mtk_drm_gem_obj *mtk_drm_gem_create(struct drm_device *dev, size_t size,
|
|||||||
bool alloc_kmap);
|
bool alloc_kmap);
|
||||||
int mtk_drm_gem_dumb_create(struct drm_file *file_priv, struct drm_device *dev,
|
int mtk_drm_gem_dumb_create(struct drm_file *file_priv, struct drm_device *dev,
|
||||||
struct drm_mode_create_dumb *args);
|
struct drm_mode_create_dumb *args);
|
||||||
int mtk_drm_gem_dumb_map_offset(struct drm_file *file_priv,
|
|
||||||
struct drm_device *dev, uint32_t handle,
|
|
||||||
uint64_t *offset);
|
|
||||||
int mtk_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
|
int mtk_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
|
||||||
int mtk_drm_gem_mmap_buf(struct drm_gem_object *obj,
|
int mtk_drm_gem_mmap_buf(struct drm_gem_object *obj,
|
||||||
struct vm_area_struct *vma);
|
struct vm_area_struct *vma);
|
||||||
|
Loading…
Reference in New Issue
Block a user