All of lore.kernel.org
 help / color / mirror / Atom feed
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

WARNING: multiple messages have this Message-ID (diff)
From: Jinoh Kang <jinoh.kang.kr@gmail.com>
To: "Chris Wilson" <chris@chris-wilson.co.uk>,
	"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
Cc: dri-devel@lists.freedesktop.org, David Airlie <airlied@linux.ie>,
	intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Matthew Auld <matthew.auld@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Jinoh Kang <jinoh.kang.kr@gmail.com>
To: "Chris Wilson" <chris@chris-wilson.co.uk>,
	"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
Cc: dri-devel@lists.freedesktop.org, David Airlie <airlied@linux.ie>,
	intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Matthew Auld <matthew.auld@intel.com>
Subject: Re: [Intel-gfx] [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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2021-01-15 17:04 UTC|newest]

Thread overview: 19+ 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
2021-01-15 16:23 ` [Intel-gfx] " Jinoh Kang
2021-01-15 16:23 ` Jinoh Kang
2021-01-15 16:56 ` Chris Wilson
2021-01-15 16:56   ` [Intel-gfx] " Chris Wilson
2021-01-15 17:03   ` Jinoh Kang [this message]
2021-01-15 17:03     ` Jinoh Kang
2021-01-15 17:03     ` Jinoh Kang
2021-01-15 17:07   ` Chris Wilson
2021-01-15 17:07     ` [Intel-gfx] " Chris Wilson
2021-01-16  5:11     ` Jinoh Kang
2021-01-16  5:11       ` [Intel-gfx] " Jinoh Kang
2021-01-16  5:11       ` Jinoh Kang
2021-01-15 20:46 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2021-01-15 21:16 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-01-16  4:11 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-01-19 18:58 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/userptr: detect un-GUP-able pages early (rev2) Patchwork
2021-01-19 19:27 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-01-19 22:41 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.