[PATCH v2 xserver 00/11] modesetting: MS_ALL_IN_ONE

Hans de Goede hdegoede at redhat.com
Sun Jan 8 10:45:36 UTC 2017


Hi,

On 07-01-17 09:01, Qiang Yu wrote:
> V2: add PATCH 11 to support GPUScreen capable of display
>
> This is for hybrid drm device use case that one drm device
> is only capable of display and the other is only capable of
> rendering.
>
> Usage: start xserver with MS_ALL_IN_ONE=1, and configure both
> the display (Screen) and render (GPUScreen) drm devices using
> modesetting DDX, it will use Screen as display, GPUScreen as
> render and create one screen for them. If the render device
> is also capable of display, create a GPUScreen for it in
> addition.
>
> Client see only the render device and load render device's DRI
> driver. Server side render is also accelerated by the render
> device. Display device only display what render device draws.
>
> There is still one problem: DRI3 can't support page flip because
> client doesn't know when to create a linear pixmap for flip.

I've recently more or less made the same thing work for the
nvidia binary driver, but in a much simpler way. If you
write a xorg.conf which sets the render-only GPU as primary
then no changes to the modesetting driver are necessary
at all. Specifically some patches of mine were recently
merged to master allowing to do this without needing to
specify bus-ids, a xorg.conf snippet like this one is
sufficient:

https://fedorapeople.org/~jwrdegoede/10-nvidia-driver.conf

The trick here is these 2 lines:

	MatchDriver "nvidia-drm"
	Option "PrimaryGPU" "yes"

Which make any GPU which has the nvidia-drm kernel driver
be seen as primary, overriding the default primary detection
which looks at which GPU has its vga registers mmio mapped.

At least this works with the nvidia binary driver, it may be
that some small changes are needed when using the modesetting
driver on the render GPU.

I wonder if you can do something similar for your use case
without needing all these changes.

Eitherway depending on an environment variable for this
behavior is unacceptable IMHO, this really should be configured
through a xorg.conf snippet.

 > Tested on a laptop with Intel iGPU and AMD dGPU.

On such a setup you should be able to get things to work using
master + a config snippet similar to:

https://fedorapeople.org/~jwrdegoede/10-nvidia-driver.conf

Without needing a patches modesetting driver at all.

Regards,

Hans








>
> Qiang Yu (11):
>   modesetting: add MS_ALL_IN_ONE handling
>   modesetting: add is_primary to mark entity type
>   modesetting: remove unused PciInfo in modesettingRec
>   modesetting: add render entity init and free
>   Revert "modesetting: Delete dead drmmode_bo_for_pixmap function."
>   dri2: refine dri2_probe_driver_name
>   modesetting: separate render and display
>   modesetting: use drmmode_bo_for_pixmap in ms_do_pageflip
>   modesetting: dri2 allocate linear backbuffer
>   modesetting: allow display node has no gbm support
>   modesetting: still create GPUScreen when it's capable of display
>
>  hw/xfree86/dri2/dri2.c                           |  35 +--
>  hw/xfree86/drivers/modesetting/dri2.c            |  33 ++-
>  hw/xfree86/drivers/modesetting/driver.c          | 265 ++++++++++++++++-------
>  hw/xfree86/drivers/modesetting/driver.h          |   9 +-
>  hw/xfree86/drivers/modesetting/drmmode_display.c | 128 ++++++++++-
>  hw/xfree86/drivers/modesetting/drmmode_display.h |   3 +
>  hw/xfree86/drivers/modesetting/dumb_bo.c         |  11 +
>  hw/xfree86/drivers/modesetting/dumb_bo.h         |   1 +
>  hw/xfree86/drivers/modesetting/pageflip.c        |   4 +-
>  hw/xfree86/drivers/modesetting/present.c         |   6 +
>  10 files changed, 385 insertions(+), 110 deletions(-)
>


More information about the xorg-devel mailing list