From: Jinoh Kang <jinoh.kang.kr@gmail.com>
To: "Chris Wilson" <chris@chris-wilson.co.uk>,
"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Matthew Auld <matthew.auld@intel.com>,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/i915/userptr: detect un-GUP-able pages early
Date: Fri, 15 Jan 2021 17:03:18 +0000 [thread overview]
Message-ID: <1277b18e-9a19-fd0c-41fc-4923bcd772fd@gmail.com> (raw)
In-Reply-To: <161072980241.18103.11713889922046524226@build.alporthouse.com>
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 https://patchwork.freedesktop.org/series/33449/ 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
>
--
Sincerely,
Jinoh Kang
next prev parent reply other threads:[~2021-01-15 17:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-15 16:23 [PATCH] drm/i915/userptr: detect un-GUP-able pages early Jinoh Kang
[not found] ` <161072980241.18103.11713889922046524226@build.alporthouse.com>
2021-01-15 17:03 ` Jinoh Kang [this message]
[not found] ` <161073047349.18103.16410031184146072179@build.alporthouse.com>
2021-01-16 5:11 ` Jinoh Kang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1277b18e-9a19-fd0c-41fc-4923bcd772fd@gmail.com \
--to=jinoh.kang.kr@gmail.com \
--cc=airlied@linux.ie \
--cc=chris@chris-wilson.co.uk \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marmarek@invisiblethingslab.com \
--cc=matthew.auld@intel.com \
--cc=rodrigo.vivi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox