drm: Remove unused drm_device from drm_gem_object_lookup()
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 9 May 2016 10:04:54 +0000 (11:04 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 17 May 2016 06:47:30 +0000 (08:47 +0200)
drm_gem_object_lookup() has never required the drm_device for its file
local translation of the user handle to the GEM object. Let's remove the
unused parameter and save some space.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: dri-devel@lists.freedesktop.org
Cc: Dave Airlie <airlied@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
[danvet: Fixup kerneldoc too.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
65 files changed:
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
drivers/gpu/drm/armada/armada_crtc.c
drivers/gpu/drm/armada/armada_fb.c
drivers/gpu/drm/armada/armada_gem.c
drivers/gpu/drm/armada/armada_gem.h
drivers/gpu/drm/ast/ast_main.c
drivers/gpu/drm/ast/ast_mode.c
drivers/gpu/drm/bochs/bochs_mm.c
drivers/gpu/drm/cirrus/cirrus_main.c
drivers/gpu/drm/drm_fb_cma_helper.c
drivers/gpu/drm/drm_gem.c
drivers/gpu/drm/drm_gem_cma_helper.c
drivers/gpu/drm/drm_prime.c
drivers/gpu/drm/etnaviv/etnaviv_drv.c
drivers/gpu/drm/exynos/exynos_drm_fb.c
drivers/gpu/drm/exynos/exynos_drm_gem.c
drivers/gpu/drm/gma500/framebuffer.c
drivers/gpu/drm/gma500/gem.c
drivers/gpu/drm/gma500/gma_display.c
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_tiling.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_overlay.c
drivers/gpu/drm/mgag200/mgag200_cursor.c
drivers/gpu/drm/mgag200/mgag200_main.c
drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c
drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
drivers/gpu/drm/msm/msm_drv.c
drivers/gpu/drm/msm/msm_fb.c
drivers/gpu/drm/msm/msm_gem.c
drivers/gpu/drm/nouveau/dispnv04/crtc.c
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/nouveau/nouveau_gem.c
drivers/gpu/drm/nouveau/nv50_display.c
drivers/gpu/drm/omapdrm/omap_drv.c
drivers/gpu/drm/omapdrm/omap_drv.h
drivers/gpu/drm/omapdrm/omap_fb.c
drivers/gpu/drm/omapdrm/omap_gem.c
drivers/gpu/drm/qxl/qxl_display.c
drivers/gpu/drm/qxl/qxl_dumb.c
drivers/gpu/drm/qxl/qxl_ioctl.c
drivers/gpu/drm/radeon/radeon_cs.c
drivers/gpu/drm/radeon/radeon_cursor.c
drivers/gpu/drm/radeon/radeon_display.c
drivers/gpu/drm/radeon/radeon_gem.c
drivers/gpu/drm/rockchip/rockchip_drm_fb.c
drivers/gpu/drm/rockchip/rockchip_drm_gem.c
drivers/gpu/drm/tegra/drm.c
drivers/gpu/drm/tegra/fb.c
drivers/gpu/drm/tegra/gem.c
drivers/gpu/drm/udl/udl_fb.c
drivers/gpu/drm/udl/udl_gem.c
drivers/gpu/drm/vc4/vc4_bo.c
drivers/gpu/drm/vc4/vc4_gem.c
drivers/gpu/drm/vgem/vgem_drv.c
drivers/gpu/drm/virtio/virtgpu_display.c
drivers/gpu/drm/virtio/virtgpu_gem.c
drivers/gpu/drm/virtio/virtgpu_ioctl.c
include/drm/drm_gem.h

index 35d0856738ae90bad991f8d10f6a6cbe4f038e1e..823bf5e0b0c841606e8a27cf7d488938113cc4a6 100644 (file)
@@ -106,7 +106,7 @@ static int amdgpu_bo_list_set(struct amdgpu_device *adev,
                struct amdgpu_bo *bo;
                struct mm_struct *usermm;
 
-               gobj = drm_gem_object_lookup(adev->ddev, filp, info[i].bo_handle);
+               gobj = drm_gem_object_lookup(filp, info[i].bo_handle);
                if (!gobj) {
                        r = -ENOENT;
                        goto error_free;
index 2bbeeb07c187e0977ed88feb405106aad178c939..9bc8f1d99733e6817ba35efe55e179aa8999e9f1 100644 (file)
@@ -92,8 +92,7 @@ static int amdgpu_cs_user_fence_chunk(struct amdgpu_cs_parser *p,
 {
        struct drm_gem_object *gobj;
 
-       gobj = drm_gem_object_lookup(p->adev->ddev, p->filp,
-                                    data->handle);
+       gobj = drm_gem_object_lookup(p->filp, data->handle);
        if (gobj == NULL)
                return -EINVAL;
 
index 726803069fefcd01a38713f17d9defb5b6374328..b0832da2ef7e463ab8fe1c15d3234dcc657d14a7 100644 (file)
@@ -563,7 +563,7 @@ amdgpu_user_framebuffer_create(struct drm_device *dev,
        struct amdgpu_framebuffer *amdgpu_fb;
        int ret;
 
-       obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handles[0]);
+       obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]);
        if (obj ==  NULL) {
                dev_err(&dev->pdev->dev, "No GEM object associated to handle 0x%08X, "
                        "can't create framebuffer\n", mode_cmd->handles[0]);
index c68f4cacaa85ab5fe219b57050d98c53fbc2190e..8fab6486064f507c219872851ef4cd6a7fe98e10 100644 (file)
@@ -338,7 +338,7 @@ int amdgpu_mode_dumb_mmap(struct drm_file *filp,
        struct drm_gem_object *gobj;
        struct amdgpu_bo *robj;
 
-       gobj = drm_gem_object_lookup(dev, filp, handle);
+       gobj = drm_gem_object_lookup(filp, handle);
        if (gobj == NULL) {
                return -ENOENT;
        }
@@ -402,7 +402,7 @@ int amdgpu_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
        int r = 0;
        long ret;
 
-       gobj = drm_gem_object_lookup(dev, filp, handle);
+       gobj = drm_gem_object_lookup(filp, handle);
        if (gobj == NULL) {
                return -ENOENT;
        }
@@ -436,7 +436,7 @@ int amdgpu_gem_metadata_ioctl(struct drm_device *dev, void *data,
        int r = -1;
 
        DRM_DEBUG("%d \n", args->handle);
-       gobj = drm_gem_object_lookup(dev, filp, args->handle);
+       gobj = drm_gem_object_lookup(filp, args->handle);
        if (gobj == NULL)
                return -ENOENT;
        robj = gem_to_amdgpu_bo(gobj);
@@ -584,7 +584,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data,
                return -EINVAL;
        }
 
-       gobj = drm_gem_object_lookup(dev, filp, args->handle);
+       gobj = drm_gem_object_lookup(filp, args->handle);
        if (gobj == NULL)
                return -ENOENT;
        rbo = gem_to_amdgpu_bo(gobj);
@@ -646,7 +646,7 @@ int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data,
        struct amdgpu_bo *robj;
        int r;
 
-       gobj = drm_gem_object_lookup(dev, filp, args->handle);
+       gobj = drm_gem_object_lookup(filp, args->handle);
        if (gobj == NULL) {
                return -ENOENT;
        }
index be1cf388c2ec9536ad084e0f2428396ec84e7363..8227344d2ff6e8ce43d0ce41e4c1179b57a2b6d1 100644 (file)
@@ -2594,7 +2594,7 @@ static int dce_v10_0_crtc_cursor_set2(struct drm_crtc *crtc,
                return -EINVAL;
        }
 
-       obj = drm_gem_object_lookup(crtc->dev, file_priv, handle);
+       obj = drm_gem_object_lookup(file_priv, handle);
        if (!obj) {
                DRM_ERROR("Cannot find cursor object %x for crtc %d\n", handle, amdgpu_crtc->crtc_id);
                return -ENOENT;
index 1e0988572a2fb388d0dd18f76597bc944a69d861..c11b6007af80ed4973405ce7536f471a9b08bb32 100644 (file)
@@ -2605,7 +2605,7 @@ static int dce_v11_0_crtc_cursor_set2(struct drm_crtc *crtc,
                return -EINVAL;
        }
 
-       obj = drm_gem_object_lookup(crtc->dev, file_priv, handle);
+       obj = drm_gem_object_lookup(file_priv, handle);
        if (!obj) {
                DRM_ERROR("Cannot find cursor object %x for crtc %d\n", handle, amdgpu_crtc->crtc_id);
                return -ENOENT;
index c087f930d67e439c651625e121bb052d3308812e..3fb65e41a6ef5e9402a4c2a3df4b30e1372ac5c8 100644 (file)
@@ -2501,7 +2501,7 @@ static int dce_v8_0_crtc_cursor_set2(struct drm_crtc *crtc,
                return -EINVAL;
        }
 
-       obj = drm_gem_object_lookup(crtc->dev, file_priv, handle);
+       obj = drm_gem_object_lookup(file_priv, handle);
        if (!obj) {
                DRM_ERROR("Cannot find cursor object %x for crtc %d\n", handle, amdgpu_crtc->crtc_id);
                return -ENOENT;
index 0293eb74d777a8bd642326f3060c528e090b78f8..a9b7e0f365136ebdd1cdccea5f3b6f84dae4690e 100644 (file)
@@ -911,7 +911,7 @@ static int armada_drm_crtc_cursor_set(struct drm_crtc *crtc,
                if (w > 64 || h > 64 || (w > 32 && h > 32))
                        return -ENOMEM;
 
-               obj = armada_gem_object_lookup(dev, file, handle);
+               obj = armada_gem_object_lookup(file, handle);
                if (!obj)
                        return -ENOENT;
 
index 5fa4bf20b232fcd860f827e5c561858df2bf7086..f03c212b754d273189766532d0614a5cc5f59ee5 100644 (file)
@@ -120,7 +120,7 @@ static struct drm_framebuffer *armada_fb_create(struct drm_device *dev,
                goto err;
        }
 
-       obj = armada_gem_object_lookup(dev, dfile, mode->handles[0]);
+       obj = armada_gem_object_lookup(dfile, mode->handles[0]);
        if (!obj) {
                ret = -ENOENT;
                goto err;
index aca7f9cc610929e5e75fa032b77b1ba79c4dfcc4..88e7fc7977213d323869d990275a634a70db8bf2 100644 (file)
@@ -278,7 +278,7 @@ int armada_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
        struct armada_gem_object *obj;
        int ret = 0;
 
-       obj = armada_gem_object_lookup(dev, file, handle);
+       obj = armada_gem_object_lookup(file, handle);
        if (!obj) {
                DRM_ERROR("failed to lookup gem object\n");
                return -EINVAL;
@@ -348,7 +348,7 @@ int armada_gem_mmap_ioctl(struct drm_device *dev, void *data,
        struct armada_gem_object *dobj;
        unsigned long addr;
 
-       dobj = armada_gem_object_lookup(dev, file, args->handle);
+       dobj = armada_gem_object_lookup(file, args->handle);
        if (dobj == NULL)
                return -ENOENT;
 
@@ -391,7 +391,7 @@ int armada_gem_pwrite_ioctl(struct drm_device *dev, void *data,
        if (ret)
                return ret;
 
-       dobj = armada_gem_object_lookup(dev, file, args->handle);
+       dobj = armada_gem_object_lookup(file, args->handle);
        if (dobj == NULL)
                return -ENOENT;
 
index b000ea3a829af66ca88cbaf1d314267d95623e33..b88d2b9853c77a65ef35a9d24b1952b672a6186a 100644 (file)
@@ -45,9 +45,9 @@ struct drm_gem_object *armada_gem_prime_import(struct drm_device *,
 int armada_gem_map_import(struct armada_gem_object *);
 
 static inline struct armada_gem_object *armada_gem_object_lookup(
-       struct drm_device *dev, struct drm_file *dfile, unsigned handle)
+       struct drm_file *dfile, unsigned handle)
 {
-       struct drm_gem_object *obj = drm_gem_object_lookup(dev, dfile, handle);
+       struct drm_gem_object *obj = drm_gem_object_lookup(dfile, handle);
 
        return obj ? drm_to_armada_gem(obj) : NULL;
 }
index b1480acbb3c3587c720570031eae9c41498d1d93..7bc3aa6dda8cff86f78ec0400bac76d852ebec95 100644 (file)
@@ -333,7 +333,7 @@ ast_user_framebuffer_create(struct drm_device *dev,
        struct ast_framebuffer *ast_fb;
        int ret;
 
-       obj = drm_gem_object_lookup(dev, filp, mode_cmd->handles[0]);
+       obj = drm_gem_object_lookup(filp, mode_cmd->handles[0]);
        if (obj == NULL)
                return ERR_PTR(-ENOENT);
 
@@ -574,7 +574,7 @@ ast_dumb_mmap_offset(struct drm_file *file,
        struct drm_gem_object *obj;
        struct ast_bo *bo;
 
-       obj = drm_gem_object_lookup(dev, file, handle);
+       obj = drm_gem_object_lookup(file, handle);
        if (obj == NULL)
                return -ENOENT;
 
index a965e7e8ad6e7e72ccfc439a7bb9e9e995fe8d23..c337922606e322ae9e0abdf57fc4196849f0bc39 100644 (file)
@@ -1141,7 +1141,7 @@ static int ast_cursor_set(struct drm_crtc *crtc,
        if (width > AST_MAX_HWC_WIDTH || height > AST_MAX_HWC_HEIGHT)
                return -EINVAL;
 
-       obj = drm_gem_object_lookup(crtc->dev, file_priv, handle);
+       obj = drm_gem_object_lookup(file_priv, handle);
        if (!obj) {
                DRM_ERROR("Cannot find cursor object %x for crtc\n", handle);
                return -ENOENT;
index 24a30f64ed2d8df912982da78fd69051afe6b6e2..6cf912c45e481c1d6a323d40bea32bc0073c275c 100644 (file)
@@ -458,7 +458,7 @@ int bochs_dumb_mmap_offset(struct drm_file *file, struct drm_device *dev,
        struct drm_gem_object *obj;
        struct bochs_bo *bo;
 
-       obj = drm_gem_object_lookup(dev, file, handle);
+       obj = drm_gem_object_lookup(file, handle);
        if (obj == NULL)
                return -ENOENT;
 
@@ -520,7 +520,7 @@ bochs_user_framebuffer_create(struct drm_device *dev,
        if (mode_cmd->pixel_format != DRM_FORMAT_XRGB8888)
                return ERR_PTR(-ENOENT);
 
-       obj = drm_gem_object_lookup(dev, filp, mode_cmd->handles[0]);
+       obj = drm_gem_object_lookup(filp, mode_cmd->handles[0]);
        if (obj == NULL)
                return ERR_PTR(-ENOENT);
 
index 0907715e90fdad228091e8c34efa3fcec58f7784..32d32c5b7b17448bdb252301d5cea65f3e3cacbf 100644 (file)
@@ -61,7 +61,7 @@ cirrus_user_framebuffer_create(struct drm_device *dev,
                                      bpp, mode_cmd->pitches[0]))
                return ERR_PTR(-EINVAL);
 
-       obj = drm_gem_object_lookup(dev, filp, mode_cmd->handles[0]);
+       obj = drm_gem_object_lookup(filp, mode_cmd->handles[0]);
        if (obj == NULL)
                return ERR_PTR(-ENOENT);
 
@@ -295,7 +295,7 @@ cirrus_dumb_mmap_offset(struct drm_file *file,
        struct drm_gem_object *obj;
        struct cirrus_bo *bo;
 
-       obj = drm_gem_object_lookup(dev, file, handle);
+       obj = drm_gem_object_lookup(file, handle);
        if (obj == NULL)
                return -ENOENT;
 
index 3165ac0e93e59e484a0925f4402a04fd1fb72124..72db38ef4f11dd2c5b37417ffba36f1000d10283 100644 (file)
@@ -183,7 +183,7 @@ struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev,
                unsigned int height = mode_cmd->height / (i ? vsub : 1);
                unsigned int min_size;
 
-               obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handles[i]);
+               obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[i]);
                if (!obj) {
                        dev_err(dev->dev, "Failed to lookup GEM object\n");
                        ret = -ENXIO;
index f716308fb48cf104acfe76a14321e5b32005f0e5..32156060b9c96bb9ccfe0c0b06dc5057a0160fb6 100644 (file)
@@ -588,7 +588,6 @@ EXPORT_SYMBOL(drm_gem_put_pages);
 
 /**
  * drm_gem_object_lookup - look up a GEM object from it's handle
- * @dev: DRM device
  * @filp: DRM file private date
  * @handle: userspace handle
  *
@@ -598,8 +597,7 @@ EXPORT_SYMBOL(drm_gem_put_pages);
  * otherwise.
  */
 struct drm_gem_object *
-drm_gem_object_lookup(struct drm_device *dev, struct drm_file *filp,
-                     u32 handle)
+drm_gem_object_lookup(struct drm_file *filp, u32 handle)
 {
        struct drm_gem_object *obj;
 
@@ -607,12 +605,8 @@ drm_gem_object_lookup(struct drm_device *dev, struct drm_file *filp,
 
        /* Check if we currently have a reference on the object */
        obj = idr_find(&filp->object_idr, handle);
-       if (obj == NULL) {
-               spin_unlock(&filp->table_lock);
-               return NULL;
-       }
-
-       drm_gem_object_reference(obj);
+       if (obj)
+               drm_gem_object_reference(obj);
 
        spin_unlock(&filp->table_lock);
 
@@ -665,7 +659,7 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
        if (!drm_core_check_feature(dev, DRIVER_GEM))
                return -ENODEV;
 
-       obj = drm_gem_object_lookup(dev, file_priv, args->handle);
+       obj = drm_gem_object_lookup(file_priv, args->handle);
        if (obj == NULL)
                return -ENOENT;
 
index 1f500a1b99695a6bb83b3d596b9a2101f6f1f8ef..e1ab008b3f0841675d5b06ae6ceb4fc037b985f5 100644 (file)
@@ -291,7 +291,7 @@ int drm_gem_cma_dumb_map_offset(struct drm_file *file_priv,
 {
        struct drm_gem_object *gem_obj;
 
-       gem_obj = drm_gem_object_lookup(drm, file_priv, handle);
+       gem_obj = drm_gem_object_lookup(file_priv, handle);
        if (!gem_obj) {
                dev_err(drm->dev, "failed to lookup GEM object\n");
                return -EINVAL;
index df6cdc76a16e2ed3586dd61edab3bcc553da77dc..aab0f3f1f42d5528efb184770d9f5bc9d949ce9d 100644 (file)
@@ -407,7 +407,7 @@ int drm_gem_prime_handle_to_fd(struct drm_device *dev,
        struct dma_buf *dmabuf;
 
        mutex_lock(&file_priv->prime.lock);
-       obj = drm_gem_object_lookup(dev, file_priv, handle);
+       obj = drm_gem_object_lookup(file_priv, handle);
        if (!obj)  {
                ret = -ENOENT;
                goto out_unlock;
index c2f92e362812605489c20fae791d9c2487307367..3d4f56df8359e6ae81a77c574e9e9a42105b6963 100644 (file)
@@ -314,7 +314,7 @@ static int etnaviv_ioctl_gem_cpu_prep(struct drm_device *dev, void *data,
        if (args->op & ~(ETNA_PREP_READ | ETNA_PREP_WRITE | ETNA_PREP_NOSYNC))
                return -EINVAL;
 
-       obj = drm_gem_object_lookup(dev, file, args->handle);
+       obj = drm_gem_object_lookup(file, args->handle);
        if (!obj)
                return -ENOENT;
 
@@ -335,7 +335,7 @@ static int etnaviv_ioctl_gem_cpu_fini(struct drm_device *dev, void *data,
        if (args->flags)
                return -EINVAL;
 
-       obj = drm_gem_object_lookup(dev, file, args->handle);
+       obj = drm_gem_object_lookup(file, args->handle);
        if (!obj)
                return -ENOENT;
 
@@ -356,7 +356,7 @@ static int etnaviv_ioctl_gem_info(struct drm_device *dev, void *data,
        if (args->pad)
                return -EINVAL;
 
-       obj = drm_gem_object_lookup(dev, file, args->handle);
+       obj = drm_gem_object_lookup(file, args->handle);
        if (!obj)
                return -ENOENT;
 
@@ -441,7 +441,7 @@ static int etnaviv_ioctl_gem_wait(struct drm_device *dev, void *data,
        if (!gpu)
                return -ENXIO;
 
-       obj = drm_gem_object_lookup(dev, file, args->handle);
+       obj = drm_gem_object_lookup(file, args->handle);
        if (!obj)
                return -ENOENT;
 
index f851a40ac6cb83fa2aef5fd0e5e20a82f7e2dfcd..e0166403b4bd5849cab6418a4d5de90b1a18e11c 100644 (file)
@@ -152,8 +152,7 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
        int ret;
 
        for (i = 0; i < drm_format_num_planes(mode_cmd->pixel_format); i++) {
-               obj = drm_gem_object_lookup(dev, file_priv,
-                                           mode_cmd->handles[i]);
+               obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[i]);
                if (!obj) {
                        DRM_ERROR("failed to lookup gem object\n");
                        ret = -ENOENT;
index 72d9414bd944e4919b530e42b57e6d66cd9418f6..cdf9f1af4347e87a0e832168d1e580d9f5968b74 100644 (file)
@@ -177,7 +177,7 @@ unsigned long exynos_drm_gem_get_size(struct drm_device *dev,
        struct exynos_drm_gem *exynos_gem;
        struct drm_gem_object *obj;
 
-       obj = drm_gem_object_lookup(dev, file_priv, gem_handle);
+       obj = drm_gem_object_lookup(file_priv, gem_handle);
        if (!obj) {
                DRM_ERROR("failed to lookup gem object.\n");
                return 0;
@@ -296,7 +296,7 @@ dma_addr_t *exynos_drm_gem_get_dma_addr(struct drm_device *dev,
        struct exynos_drm_gem *exynos_gem;
        struct drm_gem_object *obj;
 
-       obj = drm_gem_object_lookup(dev, filp, gem_handle);
+       obj = drm_gem_object_lookup(filp, gem_handle);
        if (!obj) {
                DRM_ERROR("failed to lookup gem object.\n");
                return ERR_PTR(-EINVAL);
@@ -313,7 +313,7 @@ void exynos_drm_gem_put_dma_addr(struct drm_device *dev,
 {
        struct drm_gem_object *obj;
 
-       obj = drm_gem_object_lookup(dev, filp, gem_handle);
+       obj = drm_gem_object_lookup(filp, gem_handle);
        if (!obj) {
                DRM_ERROR("failed to lookup gem object.\n");
                return;
@@ -362,7 +362,7 @@ int exynos_drm_gem_get_ioctl(struct drm_device *dev, void *data,
        struct drm_exynos_gem_info *args = data;
        struct drm_gem_object *obj;
 
-       obj = drm_gem_object_lookup(dev, file_priv, args->handle);
+       obj = drm_gem_object_lookup(file_priv, args->handle);
        if (!obj) {
                DRM_ERROR("failed to lookup gem object.\n");
                return -EINVAL;
@@ -434,7 +434,7 @@ int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv,
         *      with DRM_IOCTL_MODE_MAP_DUMB command.
         */
 
-       obj = drm_gem_object_lookup(dev, file_priv, handle);
+       obj = drm_gem_object_lookup(file_priv, handle);
        if (!obj) {
                DRM_ERROR("failed to lookup gem object.\n");
                return -EINVAL;
index ec2bc769742abb62534ad6f228e7bdcd07c60c27..7440bf90ac9c397f4fe888e9b9d68804bd39e8a2 100644 (file)
@@ -490,7 +490,7 @@ static struct drm_framebuffer *psb_user_framebuffer_create
         *      Find the GEM object and thus the gtt range object that is
         *      to back this space
         */
-       obj = drm_gem_object_lookup(dev, filp, cmd->handles[0]);
+       obj = drm_gem_object_lookup(filp, cmd->handles[0]);
        if (obj == NULL)
                return ERR_PTR(-ENOENT);
 
index 506224b3a0adf298ea5d5f4d71416df4aa88d41e..6d1cb6b370b194742745bc5a005f43e43a1a823a 100644 (file)
@@ -63,7 +63,7 @@ int psb_gem_dumb_map_gtt(struct drm_file *file, struct drm_device *dev,
        struct drm_gem_object *obj;
 
        /* GEM does all our handle to object mapping */
-       obj = drm_gem_object_lookup(dev, file, handle);
+       obj = drm_gem_object_lookup(file, handle);
        if (obj == NULL)
                return -ENOENT;
 
index 5bf765de251789624fbb6a58158138e79cda72b6..c95406e6f44de21f23d6e9093f59151e0924b176 100644 (file)
@@ -372,7 +372,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc,
                return -EINVAL;
        }
 
-       obj = drm_gem_object_lookup(dev, file_priv, handle);
+       obj = drm_gem_object_lookup(file_priv, handle);
        if (!obj) {
                ret = -ENOENT;
                goto unlock;
index 261a3ef728287f9f4d55b38bf9a1cccf36d43c34..cdd2f438d4b40a985bcf77a40b4259bf6d28261d 100644 (file)
@@ -695,7 +695,7 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
        if (ret)
                return ret;
 
-       obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
+       obj = to_intel_bo(drm_gem_object_lookup(file, args->handle));
        if (&obj->base == NULL) {
                ret = -ENOENT;
                goto unlock;
@@ -1049,7 +1049,7 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
        if (ret)
                goto put_rpm;
 
-       obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
+       obj = to_intel_bo(drm_gem_object_lookup(file, args->handle));
        if (&obj->base == NULL) {
                ret = -ENOENT;
                goto unlock;
@@ -1607,7 +1607,7 @@ i915_gem_set_domain_ioctl(struct drm_device *dev, void *data,
        if (ret)
                return ret;
 
-       obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
+       obj = to_intel_bo(drm_gem_object_lookup(file, args->handle));
        if (&obj->base == NULL) {
                ret = -ENOENT;
                goto unlock;
@@ -1655,7 +1655,7 @@ i915_gem_sw_finish_ioctl(struct drm_device *dev, void *data,
        if (ret)
                return ret;
 
-       obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
+       obj = to_intel_bo(drm_gem_object_lookup(file, args->handle));
        if (&obj->base == NULL) {
                ret = -ENOENT;
                goto unlock;
@@ -1702,7 +1702,7 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data,
        if (args->flags & I915_MMAP_WC && !cpu_has_pat)
                return -ENODEV;
 
-       obj = drm_gem_object_lookup(dev, file, args->handle);
+       obj = drm_gem_object_lookup(file, args->handle);
        if (obj == NULL)
                return -ENOENT;
 
@@ -2065,7 +2065,7 @@ i915_gem_mmap_gtt(struct drm_file *file,
        if (ret)
                return ret;
 
-       obj = to_intel_bo(drm_gem_object_lookup(dev, file, handle));
+       obj = to_intel_bo(drm_gem_object_lookup(file, handle));
        if (&obj->base == NULL) {
                ret = -ENOENT;
                goto unlock;
@@ -3140,7 +3140,7 @@ i915_gem_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
        if (ret)
                return ret;
 
-       obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->bo_handle));
+       obj = to_intel_bo(drm_gem_object_lookup(file, args->bo_handle));
        if (&obj->base == NULL) {
                mutex_unlock(&dev->struct_mutex);
                return -ENOENT;
@@ -3934,7 +3934,7 @@ int i915_gem_get_caching_ioctl(struct drm_device *dev, void *data,
        struct drm_i915_gem_caching *args = data;
        struct drm_i915_gem_object *obj;
 
-       obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
+       obj = to_intel_bo(drm_gem_object_lookup(file, args->handle));
        if (&obj->base == NULL)
                return -ENOENT;
 
@@ -3995,7 +3995,7 @@ int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data,
        if (ret)
                goto rpm_put;
 
-       obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
+       obj = to_intel_bo(drm_gem_object_lookup(file, args->handle));
        if (&obj->base == NULL) {
                ret = -ENOENT;
                goto unlock;
@@ -4365,7 +4365,7 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,
        if (ret)
                return ret;
 
-       obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
+       obj = to_intel_bo(drm_gem_object_lookup(file, args->handle));
        if (&obj->base == NULL) {
                ret = -ENOENT;
                goto unlock;
@@ -4430,7 +4430,7 @@ i915_gem_madvise_ioctl(struct drm_device *dev, void *data,
        if (ret)
                return ret;
 
-       obj = to_intel_bo(drm_gem_object_lookup(dev, file_priv, args->handle));
+       obj = to_intel_bo(drm_gem_object_lookup(file_priv, args->handle));
        if (&obj->base == NULL) {
                ret = -ENOENT;
                goto unlock;
index 7410f6c962e7b2889d8fa239a9f5bcb9c8f4d332..b9bdb34032cdcd861528446aec4ab625e3894050 100644 (file)
@@ -166,7 +166,7 @@ i915_gem_set_tiling(struct drm_device *dev, void *data,
        struct drm_i915_gem_object *obj;
        int ret = 0;
 
-       obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
+       obj = to_intel_bo(drm_gem_object_lookup(file, args->handle));
        if (&obj->base == NULL)
                return -ENOENT;
 
@@ -297,7 +297,7 @@ i915_gem_get_tiling(struct drm_device *dev, void *data,
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct drm_i915_gem_object *obj;
 
-       obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
+       obj = to_intel_bo(drm_gem_object_lookup(file, args->handle));
        if (&obj->base == NULL)
                return -ENOENT;
 
index a297e1ffafb58aa71f58e305c3e725f352a01243..86ee2aca040f630147822c002af72e6eecf75ad0 100644 (file)
@@ -14883,8 +14883,7 @@ intel_user_framebuffer_create(struct drm_device *dev,
        struct drm_i915_gem_object *obj;
        struct drm_mode_fb_cmd2 mode_cmd = *user_mode_cmd;
 
-       obj = to_intel_bo(drm_gem_object_lookup(dev, filp,
-                                               mode_cmd.handles[0]));
+       obj = to_intel_bo(drm_gem_object_lookup(filp, mode_cmd.handles[0]));
        if (&obj->base == NULL)
                return ERR_PTR(-ENOENT);
 
index bcc3b6a016d8ac8018a02732aa3f9b47d95a3820..bd38e49f733406612cac8a72e3efb5a43b3516a2 100644 (file)
@@ -1127,7 +1127,7 @@ int intel_overlay_put_image(struct drm_device *dev, void *data,
        }
        crtc = to_intel_crtc(drmmode_crtc);
 
-       new_bo = to_intel_bo(drm_gem_object_lookup(dev, file_priv,
+       new_bo = to_intel_bo(drm_gem_object_lookup(file_priv,
                                                   put_image_rec->bo_handle));
        if (&new_bo->base == NULL) {
                ret = -ENOENT;
index a7bf6a90eae5a30e40ae3c1c5dbada0ea893bc8b..2ac3fcbfea7bc988667eb5b2819712187dd8be81 100644 (file)
@@ -75,7 +75,7 @@ int mga_crtc_cursor_set(struct drm_crtc *crtc,
                return 0;
        }
 
-       obj = drm_gem_object_lookup(dev, file_priv, handle);
+       obj = drm_gem_object_lookup(file_priv, handle);
        if (!obj)
                return -ENOENT;
 
index 9147444d5bf222470e5df21ce1d9e2c5687323e1..615cbb08ba29ecdfbe8a4bfa0a02b9ce86804216 100644 (file)
@@ -53,7 +53,7 @@ mgag200_user_framebuffer_create(struct drm_device *dev,
        struct mga_framebuffer *mga_fb;
        int ret;
 
-       obj = drm_gem_object_lookup(dev, filp, mode_cmd->handles[0]);
+       obj = drm_gem_object_lookup(filp, mode_cmd->handles[0]);
        if (obj == NULL)
                return ERR_PTR(-ENOENT);
 
@@ -358,7 +358,7 @@ mgag200_dumb_mmap_offset(struct drm_file *file,
        struct drm_gem_object *obj;
        struct mgag200_bo *bo;
 
-       obj = drm_gem_object_lookup(dev, file, handle);
+       obj = drm_gem_object_lookup(file, handle);
        if (obj == NULL)
                return -ENOENT;
 
index 3a48889dd9e5183f4d36040308be9c4a80dd678b..9527dafc3e69be58a0167f04d5b4a684fae7c9ae 100644 (file)
@@ -427,7 +427,7 @@ static int mdp4_crtc_cursor_set(struct drm_crtc *crtc,
        }
 
        if (handle) {
-               cursor_bo = drm_gem_object_lookup(dev, file_priv, handle);
+               cursor_bo = drm_gem_object_lookup(file_priv, handle);
                if (!cursor_bo)
                        return -ENOENT;
        } else {
index ce779d956d57d57d2234f05a952a9c04b69202cd..88fe256c1931a5767f08158669d62e376f8ee1f3 100644 (file)
@@ -518,7 +518,7 @@ static int mdp5_crtc_cursor_set(struct drm_crtc *crtc,
                goto set_cursor;
        }
 
-       cursor_bo = drm_gem_object_lookup(dev, file, handle);
+       cursor_bo = drm_gem_object_lookup(file, handle);
        if (!cursor_bo)
                return -ENOENT;
 
index 9788989ea21c64c54bcd35ab922b1bf5bd314963..9c654092ef7891c8e3edab6e4492373adb72caa7 100644 (file)
@@ -622,7 +622,7 @@ static int msm_ioctl_gem_cpu_prep(struct drm_device *dev, void *data,
                return -EINVAL;
        }
 
-       obj = drm_gem_object_lookup(dev, file, args->handle);
+       obj = drm_gem_object_lookup(file, args->handle);
        if (!obj)
                return -ENOENT;
 
@@ -640,7 +640,7 @@ static int msm_ioctl_gem_cpu_fini(struct drm_device *dev, void *data,
        struct drm_gem_object *obj;
        int ret;
 
-       obj = drm_gem_object_lookup(dev, file, args->handle);
+       obj = drm_gem_object_lookup(file, args->handle);
        if (!obj)
                return -ENOENT;
 
@@ -661,7 +661,7 @@ static int msm_ioctl_gem_info(struct drm_device *dev, void *data,
        if (args->pad)
                return -EINVAL;
 
-       obj = drm_gem_object_lookup(dev, file, args->handle);
+       obj = drm_gem_object_lookup(file, args->handle);
        if (!obj)
                return -ENOENT;
 
index 17e0c9eb19009a9ffb044d7cc428999ee50f9bf2..461dc8b873f04738cb43c31df0e025a6a89fde7b 100644 (file)
@@ -145,8 +145,7 @@ struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev,
        int ret, i, n = drm_format_num_planes(mode_cmd->pixel_format);
 
        for (i = 0; i < n; i++) {
-               bos[i] = drm_gem_object_lookup(dev, file,
-                               mode_cmd->handles[i]);
+               bos[i] = drm_gem_object_lookup(file, mode_cmd->handles[i]);
                if (!bos[i]) {
                        ret = -ENXIO;
                        goto out_unref;
index 9bbe1c5e71513c4d4e6671a81784eb5339ce276d..7daf4054dd2b78ea634641bf4554fa6cb3d3a444 100644 (file)
@@ -374,7 +374,7 @@ int msm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
        int ret = 0;
 
        /* GEM does all our handle to object mapping */
-       obj = drm_gem_object_lookup(dev, file, handle);
+       obj = drm_gem_object_lookup(file, handle);
        if (obj == NULL) {
                ret = -ENOENT;
                goto fail;
index 55ccbf006b5e5ced72409f5863f3bf074d8494e3..ef9a3299f7166be34fa99b0a0e4d33023641e324 100644 (file)
@@ -995,7 +995,7 @@ nv04_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv,
        if (width != 64 || height != 64)
                return -EINVAL;
 
-       gem = drm_gem_object_lookup(dev, file_priv, buffer_handle);
+       gem = drm_gem_object_lookup(file_priv, buffer_handle);
        if (!gem)
                return -ENOENT;
        cursor = nouveau_gem_object(gem);
index cf6e6171b428da1eab956ec91448d0fed4cf76ca..7c77f960c8b8662ea171e98be8522166221110f7 100644 (file)
@@ -279,7 +279,7 @@ nouveau_user_framebuffer_create(struct drm_device *dev,
        struct drm_gem_object *gem;
        int ret = -ENOMEM;
 
-       gem = drm_gem_object_lookup(dev, file_priv, mode_cmd->handles[0]);
+       gem = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]);
        if (!gem)
                return ERR_PTR(-ENOENT);
 
@@ -916,7 +916,7 @@ nouveau_display_dumb_map_offset(struct drm_file *file_priv,
 {
        struct drm_gem_object *gem;
 
-       gem = drm_gem_object_lookup(dev, file_priv, handle);
+       gem = drm_gem_object_lookup(file_priv, handle);
        if (gem) {
                struct nouveau_bo *bo = nouveau_gem_object(gem);
                *poffset = drm_vma_node_offset_addr(&bo->bo.vma_node);
index 185aaaa0c85d25d0d329e41e8f555e5e6d10a66f..445a9e2fb91ab78ddc3555084692411016a2f1d5 100644 (file)
@@ -388,7 +388,7 @@ retry:
                struct drm_gem_object *gem;
                struct nouveau_bo *nvbo;
 
-               gem = drm_gem_object_lookup(dev, file_priv, b->handle);
+               gem = drm_gem_object_lookup(file_priv, b->handle);
                if (!gem) {
                        NV_PRINTK(err, cli, "Unknown handle 0x%08x\n", b->handle);
                        ret = -ENOENT;
@@ -864,7 +864,7 @@ nouveau_gem_ioctl_cpu_prep(struct drm_device *dev, void *data,
        bool write = !!(req->flags & NOUVEAU_GEM_CPU_PREP_WRITE);
        int ret;
 
-       gem = drm_gem_object_lookup(dev, file_priv, req->handle);
+       gem = drm_gem_object_lookup(file_priv, req->handle);
        if (!gem)
                return -ENOENT;
        nvbo = nouveau_gem_object(gem);
@@ -896,7 +896,7 @@ nouveau_gem_ioctl_cpu_fini(struct drm_device *dev, void *data,
        struct drm_gem_object *gem;
        struct nouveau_bo *nvbo;
 
-       gem = drm_gem_object_lookup(dev, file_priv, req->handle);
+       gem = drm_gem_object_lookup(file_priv, req->handle);
        if (!gem)
                return -ENOENT;
        nvbo = nouveau_gem_object(gem);
@@ -914,7 +914,7 @@ nouveau_gem_ioctl_info(struct drm_device *dev, void *data,
        struct drm_gem_object *gem;
        int ret;
 
-       gem = drm_gem_object_lookup(dev, file_priv, req->handle);
+       gem = drm_gem_object_lookup(file_priv, req->handle);
        if (!gem)
                return -ENOENT;
 
index a43445caae60b9d6bfdcd8a95eba0ec1271907b6..47761a92926e77e78f59a643d8f840429c38c504 100644 (file)
@@ -1314,7 +1314,7 @@ nv50_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv,
                if (width != 64 || height != 64)
                        return -EINVAL;
 
-               gem = drm_gem_object_lookup(dev, file_priv, handle);
+               gem = drm_gem_object_lookup(file_priv, handle);
                if (unlikely(!gem))
                        return -ENOENT;
                nvbo = nouveau_gem_object(gem);
index fe794980f1c8182e9a38395f4c839ecd8510565b..d86f5479345b7ac055b6e003b0296ff46a05f6d1 100644 (file)
@@ -561,7 +561,7 @@ static int ioctl_gem_cpu_prep(struct drm_device *dev, void *data,
 
        VERB("%p:%p: handle=%d, op=%x", dev, file_priv, args->handle, args->op);
 
-       obj = drm_gem_object_lookup(dev, file_priv, args->handle);
+       obj = drm_gem_object_lookup(file_priv, args->handle);
        if (!obj)
                return -ENOENT;
 
@@ -584,7 +584,7 @@ static int ioctl_gem_cpu_fini(struct drm_device *dev, void *data,
 
        VERB("%p:%p: handle=%d", dev, file_priv, args->handle);
 
-       obj = drm_gem_object_lookup(dev, file_priv, args->handle);
+       obj = drm_gem_object_lookup(file_priv, args->handle);
        if (!obj)
                return -ENOENT;
 
@@ -608,7 +608,7 @@ static int ioctl_gem_info(struct drm_device *dev, void *data,
 
        VERB("%p:%p: handle=%d", dev, file_priv, args->handle);
 
-       obj = drm_gem_object_lookup(dev, file_priv, args->handle);
+       obj = drm_gem_object_lookup(file_priv, args->handle);
        if (!obj)
                return -ENOENT;
 
index 0fbe17d0ec6f07af668fdcc4ecbe3bbe20e3ce60..3f823c36891267a388db643176c3662333f4a779 100644 (file)
@@ -257,14 +257,14 @@ struct omap_dss_device *omap_encoder_get_dssdev(struct drm_encoder *encoder);
 /* should these be made into common util helpers?
  */
 
-static inline int objects_lookup(struct drm_device *dev,
+static inline int objects_lookup(
                struct drm_file *filp, uint32_t pixel_format,
                struct drm_gem_object **bos, const uint32_t *handles)
 {
        int i, n = drm_format_num_planes(pixel_format);
 
        for (i = 0; i < n; i++) {
-               bos[i] = drm_gem_object_lookup(dev, filp, handles[i]);
+               bos[i] = drm_gem_object_lookup(filp, handles[i]);
                if (!bos[i])
                        goto fail;
 
index 610962396eb0e67669ef786afa45e2010d1df216..94ec06d3d737cd137f60cc3e632068dc9a48fe17 100644 (file)
@@ -378,7 +378,7 @@ struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev,
        struct drm_framebuffer *fb;
        int ret;
 
-       ret = objects_lookup(dev, file, mode_cmd->pixel_format,
+       ret = objects_lookup(file, mode_cmd->pixel_format,
                        bos, mode_cmd->handles);
        if (ret)
                return ERR_PTR(ret);
index 907154f5b67ce07ab6c7c2486a8149d1ba8f8e34..b97afc281778df99853c89da9e80bda2c0759e1c 100644 (file)
@@ -687,7 +687,7 @@ int omap_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
        int ret = 0;
 
        /* GEM does all our handle to object mapping */
-       obj = drm_gem_object_lookup(dev, file, handle);
+       obj = drm_gem_object_lookup(file, handle);
        if (obj == NULL) {
                ret = -ENOENT;
                goto fail;
index 9a035243faa64aa62f944bc7dd00886b9b16a21f..8b5d543858927d9718a34fc5c2027f36d27325ed 100644 (file)
@@ -318,7 +318,7 @@ static int qxl_crtc_cursor_set2(struct drm_crtc *crtc,
        if (!handle)
                return qxl_hide_cursor(qdev);
 
-       obj = drm_gem_object_lookup(crtc->dev, file_priv, handle);
+       obj = drm_gem_object_lookup(file_priv, handle);
        if (!obj) {
                DRM_ERROR("cannot find cursor object\n");
                return -ENOENT;
@@ -994,7 +994,9 @@ qxl_user_framebuffer_create(struct drm_device *dev,
        struct qxl_framebuffer *qxl_fb;
        int ret;
 
-       obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handles[0]);
+       obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]);
+       if (!obj)
+               return NULL;
 
        qxl_fb = kzalloc(sizeof(*qxl_fb), GFP_KERNEL);
        if (qxl_fb == NULL)
index d34bb4130ff095d74d915abbe2d3503b78077fc1..5e65d5d2d937d5f3db4be062dbf48eab5d116d29 100644 (file)
@@ -76,7 +76,7 @@ int qxl_mode_dumb_mmap(struct drm_file *file_priv,
        struct qxl_bo *qobj;
 
        BUG_ON(!offset_p);
-       gobj = drm_gem_object_lookup(dev, file_priv, handle);
+       gobj = drm_gem_object_lookup(file_priv, handle);
        if (gobj == NULL)
                return -ENOENT;
        qobj = gem_to_qxl_bo(gobj);
index 7c2e78201ead9d475c3ba97d083c523026c21a47..5a4c8c492683048156b853b7a88fce4582b51b90 100644 (file)
@@ -107,15 +107,14 @@ apply_surf_reloc(struct qxl_device *qdev, struct qxl_reloc_info *info)
 }
 
 /* return holding the reference to this object */
-static int qxlhw_handle_to_bo(struct qxl_device *qdev,
-                             struct drm_file *file_priv, uint64_t handle,
+static int qxlhw_handle_to_bo(struct drm_file *file_priv, uint64_t handle,
                              struct qxl_release *release, struct qxl_bo **qbo_p)
 {
        struct drm_gem_object *gobj;
        struct qxl_bo *qobj;
        int ret;
 
-       gobj = drm_gem_object_lookup(qdev->ddev, file_priv, handle);
+       gobj = drm_gem_object_lookup(file_priv, handle);
        if (!gobj)
                return -EINVAL;
 
@@ -221,7 +220,7 @@ static int qxl_process_single_command(struct qxl_device *qdev,
                reloc_info[i].type = reloc.reloc_type;
 
                if (reloc.dst_handle) {
-                       ret = qxlhw_handle_to_bo(qdev, file_priv, reloc.dst_handle, release,
+                       ret = qxlhw_handle_to_bo(file_priv, reloc.dst_handle, release,
                                                 &reloc_info[i].dst_bo);
                        if (ret)
                                goto out_free_bos;
@@ -234,7 +233,7 @@ static int qxl_process_single_command(struct qxl_device *qdev,
 
                /* reserve and validate the reloc dst bo */
                if (reloc.reloc_type == QXL_RELOC_TYPE_BO || reloc.src_handle) {
-                       ret = qxlhw_handle_to_bo(qdev, file_priv, reloc.src_handle, release,
+                       ret = qxlhw_handle_to_bo(file_priv, reloc.src_handle, release,
                                                 &reloc_info[i].src_bo);
                        if (ret)
                                goto out_free_bos;
@@ -314,7 +313,7 @@ static int qxl_update_area_ioctl(struct drm_device *dev, void *data,
            update_area->top >= update_area->bottom)
                return -EINVAL;
 
-       gobj = drm_gem_object_lookup(dev, file, update_area->handle);
+       gobj = drm_gem_object_lookup(file, update_area->handle);
        if (gobj == NULL)
                return -ENOENT;
 
index ab39b85e0f76d4cd2f926594dd1e4bc1d83a56dd..271652963fa1de23e221345334bc4c94073aa8e8 100644 (file)
@@ -101,7 +101,7 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p)
                unsigned priority;
 
                r = (struct drm_radeon_cs_reloc *)&chunk->kdata[i*4];
-               gobj = drm_gem_object_lookup(ddev, p->filp, r->handle);
+               gobj = drm_gem_object_lookup(p->filp, r->handle);
                if (gobj == NULL) {
                        DRM_ERROR("gem object lookup failed 0x%x\n",
                                  r->handle);
index afaf346bd50e7c7628674e29d0eea14c8403e3ec..2a10e24b34b10b2f826e35c60556808efb2ebe2e 100644 (file)
@@ -274,7 +274,7 @@ int radeon_crtc_cursor_set2(struct drm_crtc *crtc,
                return -EINVAL;
        }
 
-       obj = drm_gem_object_lookup(crtc->dev, file_priv, handle);
+       obj = drm_gem_object_lookup(file_priv, handle);
        if (!obj) {
                DRM_ERROR("Cannot find cursor object %x for crtc %d\n", handle, radeon_crtc->crtc_id);
                return -ENOENT;
index 628eb878a06961580994cb39aac0c94dbfec7db2..6a41b49826470f8cffe99fb888c4f6a4529ab787 100644 (file)
@@ -1368,7 +1368,7 @@ radeon_user_framebuffer_create(struct drm_device *dev,
        struct radeon_framebuffer *radeon_fb;
        int ret;
 
-       obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handles[0]);
+       obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]);
        if (obj ==  NULL) {
                dev_err(&dev->pdev->dev, "No GEM object associated to handle 0x%08X, "
                        "can't create framebuffer\n", mode_cmd->handles[0]);
index e26c963f2e9304e58f25517114e773b3c85242bd..deb9511725c93acf01943df0bf0e0a4904220eaf 100644 (file)
@@ -382,7 +382,7 @@ int radeon_gem_set_domain_ioctl(struct drm_device *dev, void *data,
        down_read(&rdev->exclusive_lock);
 
        /* just do a BO wait for now */
-       gobj = drm_gem_object_lookup(dev, filp, args->handle);
+       gobj = drm_gem_object_lookup(filp, args->handle);
        if (gobj == NULL) {
                up_read(&rdev->exclusive_lock);
                return -ENOENT;
@@ -404,7 +404,7 @@ int radeon_mode_dumb_mmap(struct drm_file *filp,
        struct drm_gem_object *gobj;
        struct radeon_bo *robj;
 
-       gobj = drm_gem_object_lookup(dev, filp, handle);
+       gobj = drm_gem_object_lookup(filp, handle);
        if (gobj == NULL) {
                return -ENOENT;
        }
@@ -435,7 +435,7 @@ int radeon_gem_busy_ioctl(struct drm_device *dev, void *data,
        int r;
        uint32_t cur_placement = 0;
 
-       gobj = drm_gem_object_lookup(dev, filp, args->handle);
+       gobj = drm_gem_object_lookup(filp, args->handle);
        if (gobj == NULL) {
                return -ENOENT;
        }
@@ -464,7 +464,7 @@ int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
        uint32_t cur_placement = 0;
        long ret;
 
-       gobj = drm_gem_object_lookup(dev, filp, args->handle);
+       gobj = drm_gem_object_lookup(filp, args->handle);
        if (gobj == NULL) {
                return -ENOENT;
        }
@@ -495,7 +495,7 @@ int radeon_gem_set_tiling_ioctl(struct drm_device *dev, void *data,
        int r = 0;
 
        DRM_DEBUG("%d \n", args->handle);
-       gobj = drm_gem_object_lookup(dev, filp, args->handle);
+       gobj = drm_gem_object_lookup(filp, args->handle);
        if (gobj == NULL)
                return -ENOENT;
        robj = gem_to_radeon_bo(gobj);
@@ -513,7 +513,7 @@ int radeon_gem_get_tiling_ioctl(struct drm_device *dev, void *data,
        int r = 0;
 
        DRM_DEBUG("\n");
-       gobj = drm_gem_object_lookup(dev, filp, args->handle);
+       gobj = drm_gem_object_lookup(filp, args->handle);
        if (gobj == NULL)
                return -ENOENT;
        rbo = gem_to_radeon_bo(gobj);
@@ -648,7 +648,7 @@ int radeon_gem_va_ioctl(struct drm_device *dev, void *data,
                return -EINVAL;
        }
 
-       gobj = drm_gem_object_lookup(dev, filp, args->handle);
+       gobj = drm_gem_object_lookup(filp, args->handle);
        if (gobj == NULL) {
                args->operation = RADEON_VA_RESULT_ERROR;
                return -ENOENT;
@@ -703,7 +703,7 @@ int radeon_gem_op_ioctl(struct drm_device *dev, void *data,
        struct radeon_bo *robj;
        int r;
 
-       gobj = drm_gem_object_lookup(dev, filp, args->handle);
+       gobj = drm_gem_object_lookup(filp, args->handle);
        if (gobj == NULL) {
                return -ENOENT;
        }
index 8c10163a95bcf3f4d50147948b27965e3e97b8f0..755cfdba61cd21f0f5b7f93743f1bb843c1cbf5f 100644 (file)
@@ -123,8 +123,7 @@ rockchip_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
                unsigned int height = mode_cmd->height / (i ? vsub : 1);
                unsigned int min_size;
 
-               obj = drm_gem_object_lookup(dev, file_priv,
-                                           mode_cmd->handles[i]);
+               obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[i]);
                if (!obj) {
                        dev_err(dev->dev, "Failed to lookup GEM object\n");
                        ret = -ENXIO;
index 18e07338c6e5f31f45b9a38c17884164fc476cff..9c2d8a894093876f027fb44bb9f73d1cbb23b86e 100644 (file)
@@ -198,7 +198,7 @@ int rockchip_gem_dumb_map_offset(struct drm_file *file_priv,
        struct drm_gem_object *obj;
        int ret;
 
-       obj = drm_gem_object_lookup(dev, file_priv, handle);
+       obj = drm_gem_object_lookup(file_priv, handle);
        if (!obj) {
                DRM_ERROR("failed to lookup gem object.\n");
                return -EINVAL;
index 45deb8fd8e7c51dda41e437bceeba7a64fa8fb05..67990554418142c070c7be72e1cdd9e240ab6710 100644 (file)
@@ -268,12 +268,12 @@ static void tegra_drm_lastclose(struct drm_device *drm)
 }
 
 static struct host1x_bo *
-host1x_bo_lookup(struct drm_device *drm, struct drm_file *file, u32 handle)
+host1x_bo_lookup(struct drm_file *file, u32 handle)
 {
        struct drm_gem_object *gem;
        struct tegra_bo *bo;
 
-       gem = drm_gem_object_lookup(drm, file, handle);
+       gem = drm_gem_object_lookup(file, handle);
        if (!gem)
                return NULL;
 
@@ -311,11 +311,11 @@ static int host1x_reloc_copy_from_user(struct host1x_reloc *dest,
        if (err < 0)
                return err;
 
-       dest->cmdbuf.bo = host1x_bo_lookup(drm, file, cmdbuf);
+       dest->cmdbuf.bo = host1x_bo_lookup(file, cmdbuf);
        if (!dest->cmdbuf.bo)
                return -ENOENT;
 
-       dest->target.bo = host1x_bo_lookup(drm, file, target);
+       dest->target.bo = host1x_bo_lookup(file, target);
        if (!dest->target.bo)
                return -ENOENT;
 
@@ -363,7 +363,7 @@ int tegra_drm_submit(struct tegra_drm_context *context,
                        goto fail;
                }
 
-               bo = host1x_bo_lookup(drm, file, cmdbuf.handle);
+               bo = host1x_bo_lookup(file, cmdbuf.handle);
                if (!bo) {
                        err = -ENOENT;
                        goto fail;
@@ -463,7 +463,7 @@ static int tegra_gem_mmap(struct drm_device *drm, void *data,
        struct drm_gem_object *gem;
        struct tegra_bo *bo;
 
-       gem = drm_gem_object_lookup(drm, file, args->handle);
+       gem = drm_gem_object_lookup(file, args->handle);
        if (!gem)
                return -EINVAL;
 
@@ -672,7 +672,7 @@ static int tegra_gem_set_tiling(struct drm_device *drm, void *data,
                return -EINVAL;
        }
 
-       gem = drm_gem_object_lookup(drm, file, args->handle);
+       gem = drm_gem_object_lookup(file, args->handle);
        if (!gem)
                return -ENOENT;
 
@@ -694,7 +694,7 @@ static int tegra_gem_get_tiling(struct drm_device *drm, void *data,
        struct tegra_bo *bo;
        int err = 0;
 
-       gem = drm_gem_object_lookup(drm, file, args->handle);
+       gem = drm_gem_object_lookup(file, args->handle);
        if (!gem)
                return -ENOENT;
 
@@ -736,7 +736,7 @@ static int tegra_gem_set_flags(struct drm_device *drm, void *data,
        if (args->flags & ~DRM_TEGRA_GEM_FLAGS)
                return -EINVAL;
 
-       gem = drm_gem_object_lookup(drm, file, args->handle);
+       gem = drm_gem_object_lookup(file, args->handle);
        if (!gem)
                return -ENOENT;
 
@@ -758,7 +758,7 @@ static int tegra_gem_get_flags(struct drm_device *drm, void *data,
        struct drm_gem_object *gem;
        struct tegra_bo *bo;
 
-       gem = drm_gem_object_lookup(drm, file, args->handle);
+       gem = drm_gem_object_lookup(file, args->handle);
        if (!gem)
                return -ENOENT;
 
index ca84de9ccb51fb626ea0d51b59f91e6501dc005a..1b12aa7a715e2eecd64232459366b4cafa8a8bff 100644 (file)
@@ -149,7 +149,7 @@ struct drm_framebuffer *tegra_fb_create(struct drm_device *drm,
                unsigned int height = cmd->height / (i ? vsub : 1);
                unsigned int size, bpp;
 
-               gem = drm_gem_object_lookup(drm, file, cmd->handles[i]);
+               gem = drm_gem_object_lookup(file, cmd->handles[i]);
                if (!gem) {
                        err = -ENXIO;
                        goto unreference;
index 3b0d8c392b707e93e56a0b391345d58d3a5eef4c..aa60d9909ea2d3df2c432ee82ea4575722b3619c 100644 (file)
@@ -401,7 +401,7 @@ int tegra_bo_dumb_map_offset(struct drm_file *file, struct drm_device *drm,
        struct drm_gem_object *gem;
        struct tegra_bo *bo;
 
-       gem = drm_gem_object_lookup(drm, file, handle);
+       gem = drm_gem_object_lookup(file, handle);
        if (!gem) {
                dev_err(drm->dev, "failed to lookup GEM object\n");
                return -EINVAL;
index 4a9b43217900436d25ef66e4d4d4b4c3ba34c100..d5df555aeba026612aba00a6f4738d33f71249b5 100644 (file)
@@ -500,7 +500,7 @@ udl_fb_user_fb_create(struct drm_device *dev,
        int ret;
        uint32_t size;
 
-       obj = drm_gem_object_lookup(dev, file, mode_cmd->handles[0]);
+       obj = drm_gem_object_lookup(file, mode_cmd->handles[0]);
        if (obj == NULL)
                return ERR_PTR(-ENOENT);
 
index d7528e0d844244bfc1de19ed2f84cd42a3aea836..818e70712b18772c5f40233bf7dee01e88ff32a1 100644 (file)
@@ -217,7 +217,7 @@ int udl_gem_mmap(struct drm_file *file, struct drm_device *dev,
        int ret = 0;
 
        mutex_lock(&dev->struct_mutex);
-       obj = drm_gem_object_lookup(dev, file, handle);
+       obj = drm_gem_object_lookup(file, handle);
        if (obj == NULL) {
                ret = -ENOENT;
                goto unlock;
index 9807bc9d296e33cb3c159d95ae09af778a21b71c..e5a9d3aaf45ff707a691e2b16b45da8f3bc6c177 100644 (file)
@@ -457,7 +457,7 @@ int vc4_mmap_bo_ioctl(struct drm_device *dev, void *data,
        struct drm_vc4_mmap_bo *args = data;
        struct drm_gem_object *gem_obj;
 
-       gem_obj = drm_gem_object_lookup(dev, file_priv, args->handle);
+       gem_obj = drm_gem_object_lookup(file_priv, args->handle);
        if (!gem_obj) {
                DRM_ERROR("Failed to look up GEM BO %d\n", args->handle);
                return -EINVAL;
index 8d4384f8b78d2dbe88df720db6df67c0e1a31e53..46899d6de6753c28c7ca6c721119a28d72792148 100644 (file)
@@ -822,7 +822,7 @@ vc4_wait_bo_ioctl(struct drm_device *dev, void *data,
        if (args->pad != 0)
                return -EINVAL;
 
-       gem_obj = drm_gem_object_lookup(dev, file_priv, args->handle);
+       gem_obj = drm_gem_object_lookup(file_priv, args->handle);
        if (!gem_obj) {
                DRM_ERROR("Failed to look up GEM BO %d\n", args->handle);
                return -EINVAL;
index ae4de36d1d83544c0d3ad0d8d1f7fc1981033f42..341f9be3dde6edfbdccaf25a08382256f20cba0e 100644 (file)
@@ -200,7 +200,7 @@ int vgem_gem_dumb_map(struct drm_file *file, struct drm_device *dev,
        int ret = 0;
        struct drm_gem_object *obj;
 
-       obj = drm_gem_object_lookup(dev, file, handle);
+       obj = drm_gem_object_lookup(file, handle);
        if (!obj)
                return -ENOENT;
 
index d37ecad0c2431405e2ede83f0b7d769aee744d19..d4305da88f44a3d28d8c6db5fad066eac52ebcf9 100644 (file)
@@ -68,7 +68,7 @@ static int virtio_gpu_crtc_cursor_set(struct drm_crtc *crtc,
        }
 
        /* lookup the cursor */
-       gobj = drm_gem_object_lookup(crtc->dev, file_priv, handle);
+       gobj = drm_gem_object_lookup(file_priv, handle);
        if (gobj == NULL)
                return -ENOENT;
 
@@ -447,7 +447,7 @@ virtio_gpu_user_framebuffer_create(struct drm_device *dev,
        int ret;
 
        /* lookup object associated with res handle */
-       obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handles[0]);
+       obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]);
        if (!obj)
                return ERR_PTR(-EINVAL);
 
index 1feb7cee3f0d7a713dc06621cf1e41740da301af..336a57fd6d5d6821591b7f15b91b270a14d7c2f8 100644 (file)
@@ -130,7 +130,7 @@ int virtio_gpu_mode_dumb_mmap(struct drm_file *file_priv,
        struct drm_gem_object *gobj;
        struct virtio_gpu_object *obj;
        BUG_ON(!offset_p);
-       gobj = drm_gem_object_lookup(dev, file_priv, handle);
+       gobj = drm_gem_object_lookup(file_priv, handle);
        if (gobj == NULL)
                return -ENOENT;
        obj = gem_to_virtio_gpu_obj(gobj);
index b4de18e65db8d5b87dbbe5b9136d957a32cae7f0..c046903cb47ba535f10a5849adb86e5f06326c66 100644 (file)
@@ -133,8 +133,7 @@ static int virtio_gpu_execbuffer(struct drm_device *dev,
                }
 
                for (i = 0; i < exbuf->num_bo_handles; i++) {
-                       gobj = drm_gem_object_lookup(dev,
-                                                    drm_file, bo_handles[i]);
+                       gobj = drm_gem_object_lookup(drm_file, bo_handles[i]);
                        if (!gobj) {
                                drm_free_large(bo_handles);
                                drm_free_large(buflist);
@@ -345,7 +344,7 @@ static int virtio_gpu_resource_info_ioctl(struct drm_device *dev, void *data,
        struct drm_gem_object *gobj = NULL;
        struct virtio_gpu_object *qobj = NULL;
 
-       gobj = drm_gem_object_lookup(dev, file_priv, ri->bo_handle);
+       gobj = drm_gem_object_lookup(file_priv, ri->bo_handle);
        if (gobj == NULL)
                return -ENOENT;
 
@@ -374,7 +373,7 @@ static int virtio_gpu_transfer_from_host_ioctl(struct drm_device *dev,
        if (vgdev->has_virgl_3d == false)
                return -ENOSYS;
 
-       gobj = drm_gem_object_lookup(dev, file, args->bo_handle);
+       gobj = drm_gem_object_lookup(file, args->bo_handle);
        if (gobj == NULL)
                return -ENOENT;
 
@@ -418,7 +417,7 @@ static int virtio_gpu_transfer_to_host_ioctl(struct drm_device *dev, void *data,
        int ret;
        u32 offset = args->offset;
 
-       gobj = drm_gem_object_lookup(dev, file, args->bo_handle);
+       gobj = drm_gem_object_lookup(file, args->bo_handle);
        if (gobj == NULL)
                return -ENOENT;
 
@@ -464,7 +463,7 @@ static int virtio_gpu_wait_ioctl(struct drm_device *dev, void *data,
        int ret;
        bool nowait = false;
 
-       gobj = drm_gem_object_lookup(dev, file, args->handle);
+       gobj = drm_gem_object_lookup(file, args->handle);
        if (gobj == NULL)
                return -ENOENT;
 
index 408d6c47d98b694fc7765f2f01bef0fb95dadf6e..fca1cd1b9c26805c9459166f49060bdf988c0e68 100644 (file)
@@ -238,9 +238,7 @@ struct page **drm_gem_get_pages(struct drm_gem_object *obj);
 void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
                bool dirty, bool accessed);
 
-struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev,
-                                            struct drm_file *filp,
-                                            u32 handle);
+struct drm_gem_object *drm_gem_object_lookup(struct drm_file *filp, u32 handle);
 int drm_gem_dumb_destroy(struct drm_file *file,
                         struct drm_device *dev,
                         uint32_t handle);