nixpkgs/pkgs/os-specific/linux/amdgpu-pro/patches/0005-Remove-first-param-from-drm_gem_object_lookup.patch

197 lines
6.3 KiB
Diff
Raw Normal View History

From 4ac701dce0a4139e89c80237fc4eaa65f48c6f07 Mon Sep 17 00:00:00 2001
From: "Luke A. Guest" <laguest@archeia.com>
Date: Sun, 25 Sep 2016 15:53:50 +0100
Subject: [PATCH 05/14] Remove first param from drm_gem_object_lookup
---
amd/amdgpu/amdgpu_bo_list.c | 4 ++++
amd/amdgpu/amdgpu_cs.c | 4 ++++
amd/amdgpu/amdgpu_display.c | 4 ++++
amd/amdgpu/amdgpu_gem.c | 20 ++++++++++++++++++++
amd/amdgpu/dce_v10_0.c | 4 ++++
amd/amdgpu/dce_v11_0.c | 4 ++++
amd/amdgpu/dce_v8_0.c | 4 ++++
amd/dal/amdgpu_dm/amdgpu_dm_types.c | 4 ++++
8 files changed, 48 insertions(+)
diff --git a/amd/amdgpu/amdgpu_bo_list.c b/amd/amdgpu/amdgpu_bo_list.c
index 844214d..7ae09cf 100644
--- a/amd/amdgpu/amdgpu_bo_list.c
+++ b/amd/amdgpu/amdgpu_bo_list.c
@@ -107,7 +107,11 @@ static int amdgpu_bo_list_set(struct amdgpu_device *adev,
struct amdgpu_bo *bo;
struct mm_struct *usermm;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ gobj = drm_gem_object_lookup(filp, info[i].bo_handle);
+#else
gobj = drm_gem_object_lookup(adev->ddev, filp, info[i].bo_handle);
+#endif
if (!gobj) {
r = -ENOENT;
goto error_free;
diff --git a/amd/amdgpu/amdgpu_cs.c b/amd/amdgpu/amdgpu_cs.c
index 20f6ab2..22363ab 100644
--- a/amd/amdgpu/amdgpu_cs.c
+++ b/amd/amdgpu/amdgpu_cs.c
@@ -92,8 +92,12 @@ static int amdgpu_cs_user_fence_chunk(struct amdgpu_cs_parser *p,
{
struct drm_gem_object *gobj;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ gobj = drm_gem_object_lookup(p->filp, data->handle);
+#else
gobj = drm_gem_object_lookup(p->adev->ddev, p->filp,
data->handle);
+#endif
if (gobj == NULL)
return -EINVAL;
diff --git a/amd/amdgpu/amdgpu_display.c b/amd/amdgpu/amdgpu_display.c
index 96c4fa5..862611c 100644
--- a/amd/amdgpu/amdgpu_display.c
+++ b/amd/amdgpu/amdgpu_display.c
@@ -601,7 +601,11 @@ amdgpu_user_framebuffer_create(struct drm_device *dev,
struct amdgpu_framebuffer *amdgpu_fb;
int ret;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]);
+#else
obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handles[0]);
+#endif
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]);
diff --git a/amd/amdgpu/amdgpu_gem.c b/amd/amdgpu/amdgpu_gem.c
index 0069aec..6da025b 100644
--- a/amd/amdgpu/amdgpu_gem.c
+++ b/amd/amdgpu/amdgpu_gem.c
@@ -397,7 +397,11 @@ int amdgpu_mode_dumb_mmap(struct drm_file *filp,
struct drm_gem_object *gobj;
struct amdgpu_bo *robj;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ gobj = drm_gem_object_lookup(filp, handle);
+#else
gobj = drm_gem_object_lookup(dev, filp, handle);
+#endif
if (gobj == NULL) {
return -ENOENT;
}
@@ -461,7 +465,11 @@ int amdgpu_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
int r = 0;
long ret;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ gobj = drm_gem_object_lookup(filp, handle);
+#else
gobj = drm_gem_object_lookup(dev, filp, handle);
+#endif
if (gobj == NULL) {
return -ENOENT;
}
@@ -495,7 +503,11 @@ int amdgpu_gem_metadata_ioctl(struct drm_device *dev, void *data,
int r = -1;
DRM_DEBUG("%d \n", args->handle);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ gobj = drm_gem_object_lookup(filp, args->handle);
+#else
gobj = drm_gem_object_lookup(dev, filp, args->handle);
+#endif
if (gobj == NULL)
return -ENOENT;
robj = gem_to_amdgpu_bo(gobj);
@@ -643,7 +655,11 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data,
return -EINVAL;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ gobj = drm_gem_object_lookup(filp, args->handle);
+#else
gobj = drm_gem_object_lookup(dev, filp, args->handle);
+#endif
if (gobj == NULL)
return -ENOENT;
rbo = gem_to_amdgpu_bo(gobj);
@@ -705,7 +721,11 @@ int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data,
struct amdgpu_bo *robj;
int r;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ gobj = drm_gem_object_lookup(filp, args->handle);
+#else
gobj = drm_gem_object_lookup(dev, filp, args->handle);
+#endif
if (gobj == NULL) {
return -ENOENT;
}
diff --git a/amd/amdgpu/dce_v10_0.c b/amd/amdgpu/dce_v10_0.c
index 3fae88d..0fd1e4f 100644
--- a/amd/amdgpu/dce_v10_0.c
+++ b/amd/amdgpu/dce_v10_0.c
@@ -2594,7 +2594,11 @@ static int dce_v10_0_crtc_cursor_set2(struct drm_crtc *crtc,
return -EINVAL;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ obj = drm_gem_object_lookup(file_priv, handle);
+#else
obj = drm_gem_object_lookup(crtc->dev, file_priv, handle);
+#endif
if (!obj) {
DRM_ERROR("Cannot find cursor object %x for crtc %d\n", handle, amdgpu_crtc->crtc_id);
return -ENOENT;
diff --git a/amd/amdgpu/dce_v11_0.c b/amd/amdgpu/dce_v11_0.c
index fe87795..a85eb5f 100644
--- a/amd/amdgpu/dce_v11_0.c
+++ b/amd/amdgpu/dce_v11_0.c
@@ -2604,7 +2604,11 @@ static int dce_v11_0_crtc_cursor_set2(struct drm_crtc *crtc,
return -EINVAL;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ obj = drm_gem_object_lookup(file_priv, handle);
+#else
obj = drm_gem_object_lookup(crtc->dev, file_priv, handle);
+#endif
if (!obj) {
DRM_ERROR("Cannot find cursor object %x for crtc %d\n", handle, amdgpu_crtc->crtc_id);
return -ENOENT;
diff --git a/amd/amdgpu/dce_v8_0.c b/amd/amdgpu/dce_v8_0.c
index 1f5959b..308f5e4 100644
--- a/amd/amdgpu/dce_v8_0.c
+++ b/amd/amdgpu/dce_v8_0.c
@@ -2448,7 +2448,11 @@ static int dce_v8_0_crtc_cursor_set2(struct drm_crtc *crtc,
return -EINVAL;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ obj = drm_gem_object_lookup(file_priv, handle);
+#else
obj = drm_gem_object_lookup(crtc->dev, file_priv, handle);
+#endif
if (!obj) {
DRM_ERROR("Cannot find cursor object %x for crtc %d\n", handle, amdgpu_crtc->crtc_id);
return -ENOENT;
diff --git a/amd/dal/amdgpu_dm/amdgpu_dm_types.c b/amd/dal/amdgpu_dm/amdgpu_dm_types.c
index d14c96f..a9de2e5 100644
--- a/amd/dal/amdgpu_dm/amdgpu_dm_types.c
+++ b/amd/dal/amdgpu_dm/amdgpu_dm_types.c
@@ -156,7 +156,11 @@ static int dm_crtc_pin_cursor_bo_new(
amdgpu_crtc = to_amdgpu_crtc(crtc);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ obj = drm_gem_object_lookup(file_priv, handle);
+#else
obj = drm_gem_object_lookup(crtc->dev, file_priv, handle);
+#endif
if (!obj) {
DRM_ERROR(
--
2.10.1