dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Autoselect CONFIG_CHECKPOINT_RESTORE for SYS_kcmp
@ 2021-02-05 13:03 Chris Wilson
  2021-02-05 15:58 ` Daniel Vetter
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2021-02-05 13:03 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jani Nikula, Daniel Vetter, dri-devel, Chris Wilson

gallium (iris) depends on os_same_file_description() to disambiguate
screens and so avoid importing the same screen fd twice as two distinct
entities (that share all the kernel resources, so actions on screen
affect the other and would cause random faiure). As they depend on it,
so must we. os_same_file_description() uses SYS_kcmp to check the file
tables for the equivalent struct file, but SYS_kcmp is hidden behind
CONFIG_CHECKPOINT_RESTORE. As this is not default, we must select it for
ourselves to ensure that our userspace is fully supported.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3046
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
index 1e1cb245fca7..470a5214bd33 100644
--- a/drivers/gpu/drm/i915/Kconfig
+++ b/drivers/gpu/drm/i915/Kconfig
@@ -21,6 +21,7 @@ config DRM_I915
 	select ACPI_VIDEO if ACPI
 	select ACPI_BUTTON if ACPI
 	select SYNC_FILE
+	select CHECKPOINT_RESTORE # gallium depends on SYS_kcmp
 	select IOSF_MBI
 	select CRC32
 	select SND_HDA_I915 if SND_HDA_CORE
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: Autoselect CONFIG_CHECKPOINT_RESTORE for SYS_kcmp
  2021-02-05 13:03 [PATCH] drm/i915: Autoselect CONFIG_CHECKPOINT_RESTORE for SYS_kcmp Chris Wilson
@ 2021-02-05 15:58 ` Daniel Vetter
  2021-02-05 15:59   ` Daniel Vetter
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2021-02-05 15:58 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Jani Nikula, Daniel Vetter, intel-gfx, dri-devel

On Fri, Feb 05, 2021 at 01:03:07PM +0000, Chris Wilson wrote:
> gallium (iris) depends on os_same_file_description() to disambiguate
> screens and so avoid importing the same screen fd twice as two distinct
> entities (that share all the kernel resources, so actions on screen
> affect the other and would cause random faiure). As they depend on it,
> so must we. os_same_file_description() uses SYS_kcmp to check the file
> tables for the equivalent struct file, but SYS_kcmp is hidden behind
> CONFIG_CHECKPOINT_RESTORE. As this is not default, we must select it for
> ourselves to ensure that our userspace is fully supported.
> 
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3046
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>

Hm shouldn't we crank this up to CONFIG_DRM?

Or embedded folks going to be unhappy about that? If so I guess we'd need
to pull out just the SYS_kcmp part ...

Asking because I think Bas is also looking at this, and it's not great if
we're building on this and then users end up with very subtly broken gl/vk
stacks :-/
-Daniel

> ---
>  drivers/gpu/drm/i915/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> index 1e1cb245fca7..470a5214bd33 100644
> --- a/drivers/gpu/drm/i915/Kconfig
> +++ b/drivers/gpu/drm/i915/Kconfig
> @@ -21,6 +21,7 @@ config DRM_I915
>  	select ACPI_VIDEO if ACPI
>  	select ACPI_BUTTON if ACPI
>  	select SYNC_FILE
> +	select CHECKPOINT_RESTORE # gallium depends on SYS_kcmp
>  	select IOSF_MBI
>  	select CRC32
>  	select SND_HDA_I915 if SND_HDA_CORE
> -- 
> 2.20.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: Autoselect CONFIG_CHECKPOINT_RESTORE for SYS_kcmp
  2021-02-05 15:58 ` Daniel Vetter
@ 2021-02-05 15:59   ` Daniel Vetter
  2021-02-05 16:18     ` Lucas Stach
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2021-02-05 15:59 UTC (permalink / raw)
  To: Chris Wilson, Dave Airlie
  Cc: Jani Nikula, Daniel Vetter, intel-gfx, dri-devel

On Fri, Feb 05, 2021 at 04:58:32PM +0100, Daniel Vetter wrote:
> On Fri, Feb 05, 2021 at 01:03:07PM +0000, Chris Wilson wrote:
> > gallium (iris) depends on os_same_file_description() to disambiguate
> > screens and so avoid importing the same screen fd twice as two distinct
> > entities (that share all the kernel resources, so actions on screen
> > affect the other and would cause random faiure). As they depend on it,
> > so must we. os_same_file_description() uses SYS_kcmp to check the file
> > tables for the equivalent struct file, but SYS_kcmp is hidden behind
> > CONFIG_CHECKPOINT_RESTORE. As this is not default, we must select it for
> > ourselves to ensure that our userspace is fully supported.
> > 
> > Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3046
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Jani Nikula <jani.nikula@intel.com>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> Hm shouldn't we crank this up to CONFIG_DRM?
> 
> Or embedded folks going to be unhappy about that? If so I guess we'd need
> to pull out just the SYS_kcmp part ...
> 
> Asking because I think Bas is also looking at this, and it's not great if
> we're building on this and then users end up with very subtly broken gl/vk
> stacks :-/

Forgot to add Airlie.
-Daniel

> -Daniel
> 
> > ---
> >  drivers/gpu/drm/i915/Kconfig | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> > index 1e1cb245fca7..470a5214bd33 100644
> > --- a/drivers/gpu/drm/i915/Kconfig
> > +++ b/drivers/gpu/drm/i915/Kconfig
> > @@ -21,6 +21,7 @@ config DRM_I915
> >  	select ACPI_VIDEO if ACPI
> >  	select ACPI_BUTTON if ACPI
> >  	select SYNC_FILE
> > +	select CHECKPOINT_RESTORE # gallium depends on SYS_kcmp
> >  	select IOSF_MBI
> >  	select CRC32
> >  	select SND_HDA_I915 if SND_HDA_CORE
> > -- 
> > 2.20.1
> > 
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: Autoselect CONFIG_CHECKPOINT_RESTORE for SYS_kcmp
  2021-02-05 15:59   ` Daniel Vetter
@ 2021-02-05 16:18     ` Lucas Stach
  0 siblings, 0 replies; 4+ messages in thread
From: Lucas Stach @ 2021-02-05 16:18 UTC (permalink / raw)
  To: Daniel Vetter, Chris Wilson, Dave Airlie
  Cc: Jani Nikula, Daniel Vetter, intel-gfx, dri-devel

Am Freitag, dem 05.02.2021 um 16:59 +0100 schrieb Daniel Vetter:
> On Fri, Feb 05, 2021 at 04:58:32PM +0100, Daniel Vetter wrote:
> > On Fri, Feb 05, 2021 at 01:03:07PM +0000, Chris Wilson wrote:
> > > gallium (iris) depends on os_same_file_description() to disambiguate
> > > screens and so avoid importing the same screen fd twice as two distinct
> > > entities (that share all the kernel resources, so actions on screen
> > > affect the other and would cause random faiure). As they depend on it,
> > > so must we. os_same_file_description() uses SYS_kcmp to check the file
> > > tables for the equivalent struct file, but SYS_kcmp is hidden behind
> > > CONFIG_CHECKPOINT_RESTORE. As this is not default, we must select it for
> > > ourselves to ensure that our userspace is fully supported.
> > > 
> > > Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3046
> > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > > Cc: Jani Nikula <jani.nikula@intel.com>
> > > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > 
> > Hm shouldn't we crank this up to CONFIG_DRM?
> > 
> > Or embedded folks going to be unhappy about that? If so I guess we'd need
> > to pull out just the SYS_kcmp part ...
> > 
> > Asking because I think Bas is also looking at this, and it's not great if
> > we're building on this and then users end up with very subtly broken gl/vk
> > stacks :-/

amdgpu gallium winsys seems to also require this, so selecting it from
higher up in the Kconfig tree makes sense and I don't think embedded
would be massively unhappy about this. However kcmp seems to be useful
on its own and pulling it out of CHECKPOINT_RESTORE sounds like the
right thing to do.

Regards,
Lucas

> 
> > -Daniel
> > 
> > > ---
> > >  drivers/gpu/drm/i915/Kconfig | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> > > index 1e1cb245fca7..470a5214bd33 100644
> > > --- a/drivers/gpu/drm/i915/Kconfig
> > > +++ b/drivers/gpu/drm/i915/Kconfig
> > > @@ -21,6 +21,7 @@ config DRM_I915
> > >  	select ACPI_VIDEO if ACPI
> > >  	select ACPI_BUTTON if ACPI
> > >  	select SYNC_FILE
> > > +	select CHECKPOINT_RESTORE # gallium depends on SYS_kcmp
> > >  	select IOSF_MBI
> > >  	select CRC32
> > >  	select SND_HDA_I915 if SND_HDA_CORE
> > > -- 
> > > 2.20.1
> > > 
> > 
> > -- 
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch
> 


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-05 16:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-05 13:03 [PATCH] drm/i915: Autoselect CONFIG_CHECKPOINT_RESTORE for SYS_kcmp Chris Wilson
2021-02-05 15:58 ` Daniel Vetter
2021-02-05 15:59   ` Daniel Vetter
2021-02-05 16:18     ` Lucas Stach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).