accel: Add .mmap to DRM_ACCEL_FOPS
authorJeffrey Hugo <quic_jhugo@quicinc.com>
Tue, 17 Jan 2023 17:45:58 +0000 (10:45 -0700)
committerOded Gabbay <ogabbay@kernel.org>
Thu, 26 Jan 2023 09:52:13 +0000 (11:52 +0200)
In reviewing the ivpu driver, DEFINE_DRM_ACCEL_FOPS could have been used
if DRM_ACCEL_FOPS defined .mmap to be drm_gem_mmap.  Lets add that since
accel drivers are a variant of drm drivers, modern drm drivers are
expected to use GEM, and mmap() is a common operation that is expected
to be heavily used in accel drivers thus the common accel driver should
be able to just use DEFINE_DRM_ACCEL_FOPS() for convenience.

Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
include/drm/drm_accel.h

index 65c0affbd306fa657128de04c394784e5bb7bece..d4955062c77e3988cdf2d032a39c99d810318811 100644 (file)
@@ -27,7 +27,8 @@
        .compat_ioctl   = drm_compat_ioctl,\
        .poll           = drm_poll,\
        .read           = drm_read,\
-       .llseek         = noop_llseek
+       .llseek         = noop_llseek, \
+       .mmap           = drm_gem_mmap
 
 /**
  * DEFINE_DRM_ACCEL_FOPS() - macro to generate file operations for accelerators drivers