[lkml]   [2021]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] drm/i915/userptr: detect un-GUP-able pages early
On 1/15/21 4:56 PM, Chris Wilson wrote:
> Quoting Jinoh Kang (2021-01-15 16:23:31)
>> If GUP-ineligible pages are passed to a GEM userptr object, -EFAULT is
>> returned only when the object is actually bound.
>> The xf86-video-intel userspace driver cannot differentiate this
>> condition, and marks the GPU as wedged.
> The idea was to call gem_set_domain on the object to validate the pages
> after creation. I only did that for read-only... I did however make mesa
> use set-domain for validation.

Thanks for the info!

> As a question how are you getting to call userptr on something that
> wasn't passed by SHM ipc?

Basically XShmAttachFd, which is not exposed on libX11.

>> This not only disables graphics
>> acceleration but may also cripple other functions such as VT switch.
> That should be a non-sequitur; certainly VT switch works without ever
> using the GPU.

Not that VT switch doesn't work; rather, there's some heavy graphic
artifacts such as blank rectangles or part of window going completely
transparent. I suppose that's another issue.

>> Solve this by "prefaulting" user pages on GEM object creation, testing
>> whether all pages are eligible for get_user_pages() in the process.
>> On failure, return -EFAULT so that userspace can fallback to software
>> blitting.
> See for adding PROBE |
> POPULATE flags.
> But we can just use set-domain.

So this patch was unnecessary. Thanks for the pointer as to how to
patch the userspace.

> -Chris

Jinoh Kang

 \ /
  Last update: 2021-01-15 18:04    [W:0.184 / U:0.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site