diff mbox series

[v2] drm/i915: Reinstate the mmap ioctl for some platforms

Message ID 20210624112914.311984-1-thomas.hellstrom@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [v2] drm/i915: Reinstate the mmap ioctl for some platforms | expand

Commit Message

Thomas Hellstrom June 24, 2021, 11:29 a.m. UTC
Reinstate the mmap ioctl for all current integrated platforms.
The intention was really to have it disabled for discrete graphics
where we enforce a single mmap mode.

Fixes: 35cbd91eb541 ("drm/i915: Disable mmap ioctl for gen12+")
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
---
v2:
- Added a R-B.
- Fixed up the code comment a bit.
---
 drivers/gpu/drm/i915/gem/i915_gem_mman.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Daniel Vetter June 24, 2021, 12:04 p.m. UTC | #1
On Thu, Jun 24, 2021 at 1:29 PM Thomas Hellström
<thomas.hellstrom@linux.intel.com> wrote:
>
> Reinstate the mmap ioctl for all current integrated platforms.
> The intention was really to have it disabled for discrete graphics
> where we enforce a single mmap mode.
>
> Fixes: 35cbd91eb541 ("drm/i915: Disable mmap ioctl for gen12+")
> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Reviewed-by: Matthew Auld <matthew.auld@intel.com>

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
> v2:
> - Added a R-B.
> - Fixed up the code comment a bit.
> ---
>  drivers/gpu/drm/i915/gem/i915_gem_mman.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> index 2fd155742bd2..4f50a508c7a0 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> @@ -62,10 +62,11 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data,
>         struct drm_i915_gem_object *obj;
>         unsigned long addr;
>
> -       /* mmap ioctl is disallowed for all platforms after TGL-LP.  This also
> -        * covers all platforms with local memory.
> +       /*
> +        * mmap ioctl is disallowed for all discrete platforms,
> +        * and for all platforms with GRAPHICS_VER > 12.
>          */
> -       if (GRAPHICS_VER(i915) >= 12 && !IS_TIGERLAKE(i915))
> +       if (IS_DGFX(i915) || GRAPHICS_VER(i915) > 12)
>                 return -EOPNOTSUPP;
>
>         if (args->flags & ~(I915_MMAP_WC))
> --
> 2.31.1
>
Maarten Lankhorst June 25, 2021, 7:48 a.m. UTC | #2
Op 24-06-2021 om 14:04 schreef Daniel Vetter:
> On Thu, Jun 24, 2021 at 1:29 PM Thomas Hellström
> <thomas.hellstrom@linux.intel.com> wrote:
>> Reinstate the mmap ioctl for all current integrated platforms.
>> The intention was really to have it disabled for discrete graphics
>> where we enforce a single mmap mode.
>>
>> Fixes: 35cbd91eb541 ("drm/i915: Disable mmap ioctl for gen12+")
>> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
>> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
>> ---
>> v2:
>> - Added a R-B.
>> - Fixed up the code comment a bit.
>> ---
>>  drivers/gpu/drm/i915/gem/i915_gem_mman.c | 7 ++++---
>>  1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
>> index 2fd155742bd2..4f50a508c7a0 100644
>> --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
>> +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
>> @@ -62,10 +62,11 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data,
>>         struct drm_i915_gem_object *obj;
>>         unsigned long addr;
>>
>> -       /* mmap ioctl is disallowed for all platforms after TGL-LP.  This also
>> -        * covers all platforms with local memory.
>> +       /*
>> +        * mmap ioctl is disallowed for all discrete platforms,
>> +        * and for all platforms with GRAPHICS_VER > 12.
>>          */
>> -       if (GRAPHICS_VER(i915) >= 12 && !IS_TIGERLAKE(i915))
>> +       if (IS_DGFX(i915) || GRAPHICS_VER(i915) > 12)
>>                 return -EOPNOTSUPP;
>>
>>         if (args->flags & ~(I915_MMAP_WC))
>> --
>> 2.31.1
>>
>
Would keeping this change unapplied break any currently shipping platforms? If not, could we leave it as-is?
Daniel Vetter June 25, 2021, 8:03 a.m. UTC | #3
On Fri, Jun 25, 2021 at 9:48 AM Maarten Lankhorst
<maarten.lankhorst@linux.intel.com> wrote:
>
> Op 24-06-2021 om 14:04 schreef Daniel Vetter:
> > On Thu, Jun 24, 2021 at 1:29 PM Thomas Hellström
> > <thomas.hellstrom@linux.intel.com> wrote:
> >> Reinstate the mmap ioctl for all current integrated platforms.
> >> The intention was really to have it disabled for discrete graphics
> >> where we enforce a single mmap mode.
> >>
> >> Fixes: 35cbd91eb541 ("drm/i915: Disable mmap ioctl for gen12+")
> >> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> >> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
> > Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >
> >> ---
> >> v2:
> >> - Added a R-B.
> >> - Fixed up the code comment a bit.
> >> ---
> >>  drivers/gpu/drm/i915/gem/i915_gem_mman.c | 7 ++++---
> >>  1 file changed, 4 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> >> index 2fd155742bd2..4f50a508c7a0 100644
> >> --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> >> +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> >> @@ -62,10 +62,11 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data,
> >>         struct drm_i915_gem_object *obj;
> >>         unsigned long addr;
> >>
> >> -       /* mmap ioctl is disallowed for all platforms after TGL-LP.  This also
> >> -        * covers all platforms with local memory.
> >> +       /*
> >> +        * mmap ioctl is disallowed for all discrete platforms,
> >> +        * and for all platforms with GRAPHICS_VER > 12.
> >>          */
> >> -       if (GRAPHICS_VER(i915) >= 12 && !IS_TIGERLAKE(i915))
> >> +       if (IS_DGFX(i915) || GRAPHICS_VER(i915) > 12)
> >>                 return -EOPNOTSUPP;
> >>
> >>         if (args->flags & ~(I915_MMAP_WC))
> >> --
> >> 2.31.1
> >>
> >
> Would keeping this change unapplied break any currently shipping platforms? If not, could we leave it as-is?

It breaks media on rkl/adl afaik. Which should be part of the commit message.
-Daniel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
index 2fd155742bd2..4f50a508c7a0 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
@@ -62,10 +62,11 @@  i915_gem_mmap_ioctl(struct drm_device *dev, void *data,
 	struct drm_i915_gem_object *obj;
 	unsigned long addr;
 
-	/* mmap ioctl is disallowed for all platforms after TGL-LP.  This also
-	 * covers all platforms with local memory.
+	/*
+	 * mmap ioctl is disallowed for all discrete platforms,
+	 * and for all platforms with GRAPHICS_VER > 12.
 	 */
-	if (GRAPHICS_VER(i915) >= 12 && !IS_TIGERLAKE(i915))
+	if (IS_DGFX(i915) || GRAPHICS_VER(i915) > 12)
 		return -EOPNOTSUPP;
 
 	if (args->flags & ~(I915_MMAP_WC))