[Intel-gfx] [PATCH 1/1] drm/i915: Disable pread/pwrite ioctl's for future platforms (v2)

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Fri Mar 12 11:37:01 UTC 2021


Op 2021-03-12 om 04:28 schreef Dixit, Ashutosh:
> On Thu, 11 Mar 2021 12:20:17 -0800, Jason Ekstrand wrote:
>> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
>> index b2e3b5cfccb4a..78ad5a9dd4784 100644
>> --- a/drivers/gpu/drm/i915/i915_gem.c
>> +++ b/drivers/gpu/drm/i915/i915_gem.c
>> @@ -374,10 +374,19 @@ int
>>  i915_gem_pread_ioctl(struct drm_device *dev, void *data,
>> 		     struct drm_file *file)
>>  {
>> +	struct drm_i915_private *i915 = to_i915(dev);
>> 	struct drm_i915_gem_pread *args = data;
>> 	struct drm_i915_gem_object *obj;
>> 	int ret;
>>
>> +	/* Pread is disallowed for all platforms after TGL-LP */
>> +	if (INTEL_GEN(i915) >= 12 && !IS_TIGERLAKE(i915))
>> +		return -EOPNOTSUPP;
>> +
>> +	/* All discrete memory platforms are Gen12 or above */
>> +	if (WARN_ON(HAS_LMEM(i915)))
>> +		return -EOPNOTSUPP;
> Not sure but you are probably trying to make it explicit that pread/pwrite
> are truly gone on dGfx? Because real dGfx are Gen12+ the code will return
> from the first if statement and never get to the second if statement. And
> there's talk on the relocation thread about tripping fake LMEM here for
> platforms prior to Gen12.
>
> So I'd suggest get rid of this second if statement and only retain the
> first (for both pread and pwrite) since that seems to be entirely
> sufficient.
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

I think this should probably be a -ENODEV return code, otherwise patch looks good to me.

We probably don't want to break fake lmem until it's removed..

Cc drm maintainers on next version?



More information about the Intel-gfx mailing list