[PATCH] drm: Fix the .fault functions
Dave Jiang
dave.jiang at intel.com
Thu Jan 26 16:29:18 UTC 2017
On 01/26/2017 06:36 AM, Fabio Estevam wrote:
> Commit 25d3db7600b87a4 ("mm, fs: reduce fault, page_mkwrite, and
> pfn_mkwrite to take only vmf") causes the following build failure with
> arm allmodconfig:
>
> drivers/gpu/drm/armada/armada_gem.c:38:11: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
> drivers/gpu/drm/etnaviv/etnaviv_drv.c:474:11: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
> drivers/gpu/drm/etnaviv/etnaviv_gem.c:178:5: error: conflicting types for 'etnaviv_gem_fault'
> drivers/gpu/drm/omapdrm/omap_drv.c:787:11: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
> drivers/gpu/drm/omapdrm/omap_gem.c:531:5: error: conflicting types for 'omap_gem_fault'
>
> Fix the conversion in some drm drivers.
>
> Signed-off-by: Fabio Estevam <fabio.estevam at nxp.com>
Thanks for catching!
Acked-by: Dave Jiang <dave.jiang at intel.com>
> ---
> This build failure is from linux-next 20170125.
>
> drivers/gpu/drm/armada/armada_gem.c | 3 ++-
> drivers/gpu/drm/etnaviv/etnaviv_drv.h | 2 +-
> drivers/gpu/drm/omapdrm/omap_drv.h | 2 +-
> 3 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c
> index a293c8b..1ec0419 100644
> --- a/drivers/gpu/drm/armada/armada_gem.c
> +++ b/drivers/gpu/drm/armada/armada_gem.c
> @@ -14,8 +14,9 @@
> #include <drm/armada_drm.h>
> #include "armada_ioctlP.h"
>
> -static int armada_gem_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
> +static int armada_gem_vm_fault(struct vm_fault *vmf)
> {
> + struct vm_area_struct *vma = vmf->vma;
> struct armada_gem_object *obj = drm_to_armada_gem(vma->vm_private_data);
> unsigned long pfn = obj->phys_addr >> PAGE_SHIFT;
> int ret;
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.h b/drivers/gpu/drm/etnaviv/etnaviv_drv.h
> index c255eda..e41f386 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.h
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.h
> @@ -73,7 +73,7 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data,
> struct drm_file *file);
>
> int etnaviv_gem_mmap(struct file *filp, struct vm_area_struct *vma);
> -int etnaviv_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
> +int etnaviv_gem_fault(struct vm_fault *vmf);
> int etnaviv_gem_mmap_offset(struct drm_gem_object *obj, u64 *offset);
> struct sg_table *etnaviv_gem_prime_get_sg_table(struct drm_gem_object *obj);
> void *etnaviv_gem_prime_vmap(struct drm_gem_object *obj);
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
> index 7d9dd54..7a8f4bf 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.h
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.h
> @@ -204,7 +204,7 @@ int omap_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
> int omap_gem_mmap(struct file *filp, struct vm_area_struct *vma);
> int omap_gem_mmap_obj(struct drm_gem_object *obj,
> struct vm_area_struct *vma);
> -int omap_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
> +int omap_gem_fault(struct vm_fault *vmf);
> int omap_gem_op_start(struct drm_gem_object *obj, enum omap_gem_op op);
> int omap_gem_op_finish(struct drm_gem_object *obj, enum omap_gem_op op);
> int omap_gem_op_sync(struct drm_gem_object *obj, enum omap_gem_op op);
>
More information about the dri-devel
mailing list