diff options
author | Seung-Woo Kim <sw0312.kim@samsung.com> | 2019-12-05 16:52:29 +0900 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2019-12-05 18:56:13 +0900 |
commit | 61226a61f164b4d716edd2d3213f2ffd2a8b29f9 (patch) | |
tree | d8b65d48d39a1d41b90d842a783f729817a53f34 | |
parent | ad6db8c5ad8bc4ea267a269190a4d8cc34cc4a38 (diff) | |
download | linux-rpi3-61226a61f164b4d716edd2d3213f2ffd2a8b29f9.tar.gz linux-rpi3-61226a61f164b4d716edd2d3213f2ffd2a8b29f9.tar.bz2 linux-rpi3-61226a61f164b4d716edd2d3213f2ffd2a8b29f9.zip |
drm/vc4: fix wrong filp usage in gem_info debugfs nodesubmit/tizen/20191206.014708accepted/tizen/unified/20191206.053944
After the mainline commit 65101d8c9108 ("drm/vc4: Expose
performance counters to userspace") applied in v4.17, vc4 drm
has its own filp. So gem_info filp usage is not proper. Fix the
wrong filp usage in gem_info debugfs node.
Change-Id: I526a888f345378d66f96e9d6cd3d19527e56ddaa
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_bo.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_drv.h | 11 |
2 files changed, 10 insertions, 8 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c index 87bdab9d7445..c1bae46b9a29 100644 --- a/drivers/gpu/drm/vc4/vc4_bo.c +++ b/drivers/gpu/drm/vc4/vc4_bo.c @@ -109,8 +109,8 @@ static int vc4_gem_one_info(int id, void *ptr, void *data) { struct drm_gem_object *obj = (struct drm_gem_object *)ptr; struct vc4_gem_info_data *gem_info_data = data; - struct drm_vc4_file_private *file_priv = - gem_info_data->filp->driver_priv; + struct vc4_file *vc4file = gem_info_data->filp->driver_priv; + struct drm_vc4_file_private *file_priv = &vc4file->priv; if (!obj) { DRM_ERROR("failed to get drm_gem_object\n"); @@ -570,7 +570,8 @@ struct vc4_bo *vc4_bo_create(struct drm_device *dev, size_t unaligned_size, static void vc4_gem_register_pid(struct drm_file *file_priv) { - struct drm_vc4_file_private *driver_priv = file_priv->driver_priv; + struct vc4_file *vc4file = file_priv->driver_priv; + struct drm_vc4_file_private *driver_priv = &vc4file->priv; if (!driver_priv->pid && !driver_priv->tgid) { driver_priv->pid = task_pid_nr(current); diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index d94364910196..ff99565883b2 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h @@ -553,6 +553,11 @@ struct vc4_exec_info { struct vc4_perfmon *perfmon; }; +struct drm_vc4_file_private { + pid_t pid; + pid_t tgid; +}; + /* Per-open file private data. Any driver-specific resource that has to be * released when the DRM file is closed should be placed here. */ @@ -561,6 +566,7 @@ struct vc4_file { struct idr idr; struct mutex lock; } perfmon; + struct drm_vc4_file_private priv; }; static inline struct vc4_exec_info * @@ -812,11 +818,6 @@ bool vc4_check_tex_size(struct vc4_exec_info *exec, struct vc4_validated_shader_info * vc4_validate_shader(struct drm_gem_cma_object *shader_obj); -struct drm_vc4_file_private { - pid_t pid; - pid_t tgid; -}; - int vc4_debugfs_gem_info(struct seq_file *m, void *data); int vc4_drm_gem_prime_fd_to_handle(struct drm_device *dev, struct drm_file *file_priv, int prime_fd, uint32_t *handle); |