[PATCH v2 xserver 00/11] modesetting: MS_ALL_IN_ONE
Yu, Qiang
Qiang.Yu at amd.com
Sun Jan 8 14:04:00 UTC 2017
Hi Hans,
Thanks for your info, I give it a quick try:
Section "OutputClass"
Identifier "amd"
MatchDriver "amdgpu"
Driver "modesetting"
Option "PrimaryGPU" "yes"
EndSection
Section "OutputClass"
Identifier "intel"
MatchDriver "i915_bpo"
Driver "modesetting"
EndSection
Seems indeed some bugs in it, xserver start as expected with amdgpu as master
and i915 as slave (Xorg.0.log attached), but the screen is black, and run xrandr:
1. "xrandr --setprovideroutputsource 1 0" won't add any iGPU's output (0 is amdgpu, 1 is intel)
2. "xrandr --setprovideroutputsource 0 1" crash the xserver:
Xorg: ../../../xserver/dix/dispatch.c:4018: AttachOutputGPU: Assertion `new->isGPU' failed.
But I believe it can be fixed.
MS_ALL_IN_ONE method is my previous work when xserver has no proper PRIME sync.
And I find it's also useful for embedded platforms like iMX6/etnaviv. So published here.
As the MS_ALL_IN_ONE environment variable, I can change it to be an option of modesetting.
Now as the PRIME sync is upstreamed, I think they can achieve nearly same effect in theory,
but still minor difference when implementation in each DDX like modesetting need a proper
implementation of PresentSharedPixmap() for “OpenGL Syncing To VBlank”. I just provide
another way.
Regards,
Qiang
________________________________________
From: Hans de Goede <hdegoede at redhat.com>
Sent: Sunday, January 8, 2017 6:45:36 PM
To: Yu, Qiang; xorg-devel at lists.x.org
Subject: Re: [PATCH v2 xserver 00/11] modesetting: MS_ALL_IN_ONE
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(-)
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Xorg.0.log
Type: text/x-log
Size: 98279 bytes
Desc: Xorg.0.log
URL: <https://lists.x.org/archives/xorg-devel/attachments/20170108/d4e111ff/attachment-0001.bin>
More information about the xorg-devel
mailing list