Re: [PATCH xserver] glamor: Fix crash when master gpu is using glamor and another gpu is hotplugged

2016-09-07 Thread Hans de Goede
Hi, On 06-09-16 22:22, Eric Anholt wrote: Hans de Goede writes: When a GPU gets hotplugged while X is already running, glamor_egl_init() gets called and changes the current egl context at a point where glamor does not expect this. This causes glamor to e.g. crash in the

Re: [PATCH v5 xserver 6/7] xf86Cursor: Deal with rotation on GPU screens using a hw-cursor

2016-09-07 Thread Hans de Goede
Hi, On 07-09-16 03:34, Michel Dänzer wrote: On 06/09/16 08:31 PM, Hans De Goede wrote: When a slave-output is rotated the transformation is done on the blit from master to slave GPU, so crtc->transform_in_use is not set, but we still need to adjust the mouse position for things to work.

[PATCH xserver v2] xfree86: recognize primary BUS_PCI device in xf86IsPrimaryPlatform()

2016-09-07 Thread Laszlo Ersek
The new platform bus code and the old PCI bus code overlap. Platform bus can handle any type of device, including PCI devices, whereas the PCI code can only handle PCI devices. Some drivers only support the old style PCI-probe methods, but the primary device detection code is server based, not

[PATCH v6 xserver 3/7] xf86Cursor: Add xf86CheckHWCursor() helper function

2016-09-07 Thread Hans de Goede
From: Dave Airlie This is a preparation patch for adding prime hw-cursor support. Signed-off-by: Dave Airlie Signed-off-by: Hans de Goede --- Changes in v6 (Hans de Goede): -Do not remove xorg_list_is_empty(>pixmap_dirty_list)

[PATCH v6 xserver 7/7] xf86Cursor: Add hw cursor support for prime

2016-09-07 Thread Hans de Goede
From: Dave Airlie Currently with PRIME if we detect a secondary GPU, we switch to using SW cursors, this isn't optimal, esp for the intel/nvidia combinations, we have no choice for the USB offload devices. This patch checks on each slave screen if hw cursors are enabled, and

[PATCH v6 xserver 6/7] xf86Cursor: Deal with rotation on GPU screens using a hw-cursor

2016-09-07 Thread Hans de Goede
When a slave-output is rotated the transformation is done on the blit from master to slave GPU, so crtc->transform_in_use is not set, but we still need to adjust the mouse position for things to work. Signed-off-by: Hans de Goede --- hw/xfree86/modes/xf86Cursors.c | 33

[PATCH v6 xserver 1/7] dix: Add dixPrivatesCreated helper function

2016-09-07 Thread Hans de Goede
From: Dave Airlie This is a preparation patch for adding prime hw-cursor support. Signed-off-by: Dave Airlie Signed-off-by: Hans de Goede Reviewed-by: Michel Dänzer --- dix/privates.c | 9 +

[PATCH v6 xserver 4/7] xf86Cursor: Fix xf86CurrentCursor to work on slave GPU Screens

2016-09-07 Thread Hans de Goede
The CurrentCursor is always attached to the master GPU. Signed-off-by: Hans de Goede Reviewed-by: Michel Dänzer --- hw/xfree86/ramdac/xf86Cursor.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git

[PATCH v6 xserver 2/7] randr: Add RRHasScanoutPixmap helper function

2016-09-07 Thread Hans de Goede
This is a preparation patch for adding prime hw-cursor support. Signed-off-by: Hans de Goede Reviewed-by: Michel Dänzer --- randr/randrstr.h | 6 ++ randr/rrcrtc.c | 19 +++ 2 files changed, 25 insertions(+) diff --git

Re: [PATCH v5 xserver 1/7] dix: Add dixPrivatesCreated helper function

2016-09-07 Thread Keith Packard
Hans de Goede writes: > TL;DR: Yes this is not ideal, but the workaround > is tiny and the improvements this patch-set brings > are large, so I do not consider this a blocker. Yeah, I was reading that code and it looks possible to make it work in the future, but it's not

Re: [v5,xserver,3/7] xf86Cursor: Add xf86CheckHWCursor() helper function

2016-09-07 Thread Hans de Goede
Hi, On 07-09-16 02:57, Michel Dänzer wrote: On 06/09/16 08:31 PM, Hans De Goede wrote: From: Dave Airlie This is a preparation patch for adding prime hw-cursor support. [...] diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c index

Re: [PATCH v5 xserver 5/7] xf86Cursor: Fix xf86_crtc_rotate_coord_back using width/height wrongly

2016-09-07 Thread Hans de Goede
Hi, On 07-09-16 03:21, Michel Dänzer wrote: On 06/09/16 08:31 PM, Hans De Goede wrote: xf86_crtc_rotate_coord_back should be the exact inverse operation of xf86_crtc_rotate_coord, but when calculating x / y for 90 / 270 degrees rotation it was using height to calculate x / width to calculate

Re: [PATCH v5 xserver 1/7] dix: Add dixPrivatesCreated helper function

2016-09-07 Thread Hans de Goede
Hi, On 06-09-16 16:41, Keith Packard wrote: Hans de Goede writes: From: Dave Airlie This is a preparation patch for adding prime hw-cursor support. I'm fine with this function, but the prime hw-cursor support which uses it is a pretty ugly kludge,

Re: [PATCH v5 xserver 5/7] xf86Cursor: Fix xf86_crtc_rotate_coord_back using width/height wrongly

2016-09-07 Thread Hans de Goede
Hi, On 08-09-16 03:10, Michel Dänzer wrote: On 08/09/16 12:43 AM, Hans de Goede wrote: /* * Given a screen coordinate, rotate back to a cursor source coordinate */ xf86_crtc_rotate_coord(...) /* * Given a cursor source coordinate, rotate to a screen coordinate */

Re: [PATCH xserver] glamor: Fix crash when master gpu is using glamor and another gpu is hotplugged

2016-09-07 Thread Hans de Goede
Hi, On 07-09-16 20:19, Eric Anholt wrote: Hans de Goede writes: Hi, On 06-09-16 22:22, Eric Anholt wrote: Hans de Goede writes: When a GPU gets hotplugged while X is already running, glamor_egl_init() gets called and changes the current egl

Re: [PATCH xserver v2] xfree86: recognize primary BUS_PCI device in xf86IsPrimaryPlatform()

2016-09-07 Thread Marcin Juszkiewicz
W dniu 07.09.2016 o 15:08, Laszlo Ersek pisze: > Notes: - F24 scratch build: > > > - Marcin, can you please test this too on your phys hw setup? > Thanks! Tested-By: Marcin Juszkiewicz

Re: [PATCH v6 xserver 7/7] xf86Cursor: Add hw cursor support for prime

2016-09-07 Thread Aaron Plattner
Adding Alex. On 09/07/2016 05:26 AM, Hans de Goede wrote: From: Dave Airlie Currently with PRIME if we detect a secondary GPU, we switch to using SW cursors, this isn't optimal, esp for the intel/nvidia combinations, we have no choice for the USB offload devices. This

Re: [PATCH v6 xserver 7/7] xf86Cursor: Add hw cursor support for prime

2016-09-07 Thread Hans de Goede
Hi, On 07-09-16 17:02, Aaron Plattner wrote: Adding Alex. On 09/07/2016 05:26 AM, Hans de Goede wrote: From: Dave Airlie Currently with PRIME if we detect a secondary GPU, we switch to using SW cursors, this isn't optimal, esp for the intel/nvidia combinations, we have

[PATCH v6 xserver] autobind GPUs to the screen

2016-09-07 Thread Hans de Goede
From: Dave Airlie This is a modified version of a patch we've been carry-ing in Fedora and RHEL for years now. This patch automatically adds secondary GPUs to the master as output sink / offload source making e.g. the use of slave-outputs just work, with requiring the user to

Re: [PATCH v5 xserver 5/7] xf86Cursor: Fix xf86_crtc_rotate_coord_back using width/height wrongly

2016-09-07 Thread Hans de Goede
Hi, On 07-09-16 17:19, Michel Dänzer wrote: On 07/09/16 08:43 PM, Hans de Goede wrote: On 07-09-16 03:21, Michel Dänzer wrote: On 06/09/16 08:31 PM, Hans De Goede wrote: xf86_crtc_rotate_coord_back should be the exact inverse operation of xf86_crtc_rotate_coord, but when calculating x / y

Re: [PATCH v6 xserver 7/7] xf86Cursor: Add hw cursor support for prime

2016-09-07 Thread Hans de Goede
Hi, On 07-09-16 17:38, Aaron Plattner wrote: On 09/07/2016 08:24 AM, Hans de Goede wrote: Hi, On 07-09-16 17:02, Aaron Plattner wrote: Adding Alex. On 09/07/2016 05:26 AM, Hans de Goede wrote: From: Dave Airlie Currently with PRIME if we detect a secondary GPU, we

Re: [PATCH v5 xserver 1/7] dix: Add dixPrivatesCreated helper function

2016-09-07 Thread Hans de Goede
Hi, On 07-09-16 15:06, Keith Packard wrote: Hans de Goede writes: TL;DR: Yes this is not ideal, but the workaround is tiny and the improvements this patch-set brings are large, so I do not consider this a blocker. Yeah, I was reading that code and it looks possible to

Re: [PATCH xserver v2] xfree86: recognize primary BUS_PCI device in xf86IsPrimaryPlatform()

2016-09-07 Thread Hans de Goede
Hi, On 07-09-16 15:08, Laszlo Ersek wrote: The new platform bus code and the old PCI bus code overlap. Platform bus can handle any type of device, including PCI devices, whereas the PCI code can only handle PCI devices. Some drivers only support the old style PCI-probe methods, but the primary

Re: [PATCH v5 xserver 5/7] xf86Cursor: Fix xf86_crtc_rotate_coord_back using width/height wrongly

2016-09-07 Thread Michel Dänzer
On 07/09/16 08:43 PM, Hans de Goede wrote: > On 07-09-16 03:21, Michel Dänzer wrote: >> On 06/09/16 08:31 PM, Hans De Goede wrote: >>> xf86_crtc_rotate_coord_back should be the exact inverse operation of >>> xf86_crtc_rotate_coord, but when calculating x / y for 90 / 270 degrees >>> rotation it

Re: [PATCH v6 xserver 7/7] xf86Cursor: Add hw cursor support for prime

2016-09-07 Thread Aaron Plattner
On 09/07/2016 08:24 AM, Hans de Goede wrote: Hi, On 07-09-16 17:02, Aaron Plattner wrote: Adding Alex. On 09/07/2016 05:26 AM, Hans de Goede wrote: From: Dave Airlie Currently with PRIME if we detect a secondary GPU, we switch to using SW cursors, this isn't optimal,

Re: [PATCH v6 xserver 7/7] xf86Cursor: Add hw cursor support for prime

2016-09-07 Thread Aaron Plattner
On 09/07/2016 08:51 AM, Hans de Goede wrote: > Hi, > > On 07-09-16 17:38, Aaron Plattner wrote: >> On 09/07/2016 08:24 AM, Hans de Goede wrote: >>> Hi, >>> >>> On 07-09-16 17:02, Aaron Plattner wrote: Adding Alex. On 09/07/2016 05:26 AM, Hans de Goede wrote: > From: Dave Airlie

Re: [PATCH v6 xserver 7/7] xf86Cursor: Add hw cursor support for prime

2016-09-07 Thread Alex Goins
Hi Hans, Thanks for this, it will definitely be a big improvement. I've been testing these patches against the NVIDIA driver. Some concerns - What would be the best way to query from the master if the slave is using a HW cursor? We typically composite the cursor onto the shared pixmap, and with

Re: [PATCH v5 xserver 5/7] xf86Cursor: Fix xf86_crtc_rotate_coord_back using width/height wrongly

2016-09-07 Thread Michel Dänzer
On 08/09/16 12:43 AM, Hans de Goede wrote: > > /* > * Given a screen coordinate, rotate back to a cursor source coordinate > */ > xf86_crtc_rotate_coord(...) > > /* > * Given a cursor source coordinate, rotate to a screen coordinate > */ > xf86_crtc_rotate_coord_back(...) > > Looking at

Re: [PATCH v6 xserver 7/7] xf86Cursor: Add hw cursor support for prime

2016-09-07 Thread Michel Dänzer
On 08/09/16 08:32 AM, Alex Goins wrote: > > I'm encountering some very strange issues when running these with PRIME > Synchronization enabled, even after fixing our internal cursor handling. When > moving the cursor around without damaging anything, it's smooth. When having > an > application

Re: [PATCH v6 xserver 7/7] xf86Cursor: Add hw cursor support for prime

2016-09-07 Thread Alex Goins
On Thu, 8 Sep 2016, Michel Dänzer wrote: > On 08/09/16 08:32 AM, Alex Goins wrote: > > > > I'm encountering some very strange issues when running these with PRIME > > Synchronization enabled, even after fixing our internal cursor handling. > > When > > moving the cursor around without damaging

Re: [PATCH v6 xserver 7/7] xf86Cursor: Add hw cursor support for prime

2016-09-07 Thread Michel Dänzer
On 08/09/16 10:23 AM, Alex Goins wrote: > On Thu, 8 Sep 2016, Michel Dänzer wrote: > >> On 08/09/16 08:32 AM, Alex Goins wrote: >>> >>> I'm encountering some very strange issues when running these with PRIME >>> Synchronization enabled, even after fixing our internal cursor handling. >>> When

Re: [PATCH xserver] glamor: Fix crash when master gpu is using glamor and another gpu is hotplugged

2016-09-07 Thread Michel Dänzer
On 08/09/16 03:19 AM, Eric Anholt wrote: > Hans de Goede writes: > >> Hi, >> >> On 06-09-16 22:22, Eric Anholt wrote: >>> Hans de Goede writes: >>> When a GPU gets hotplugged while X is already running, glamor_egl_init() gets called and

Re: [PATCH xserver 4/4] xfree86: promote one GPU screen if (NumScreens == 0 && NumGPUScreens > 0)

2016-09-07 Thread Hans de Goede
Hi, On 07-09-16 12:20, Laszlo Ersek wrote: On 09/07/16 11:54, Hans de Goede wrote: Hi, On 06-09-16 22:32, Laszlo Ersek wrote: On 09/06/16 14:46, Hans de Goede wrote: Hi, On 06-09-16 13:47, Laszlo Ersek wrote: Adding Matt and Ard On 09/06/16 00:32, Dave Airlie wrote: Picking

Re: [PATCH xserver 4/4] xfree86: promote one GPU screen if (NumScreens == 0 && NumGPUScreens > 0)

2016-09-07 Thread Hans de Goede
Hi, On 06-09-16 22:32, Laszlo Ersek wrote: On 09/06/16 14:46, Hans de Goede wrote: Hi, On 06-09-16 13:47, Laszlo Ersek wrote: Adding Matt and Ard On 09/06/16 00:32, Dave Airlie wrote: Picking different primaries on different boots sounds perfectly acceptable to me as long as: - no

Re: [PATCH xserver 4/4] xfree86: promote one GPU screen if (NumScreens == 0 && NumGPUScreens > 0)

2016-09-07 Thread Laszlo Ersek
On 09/07/16 11:54, Hans de Goede wrote: > Hi, > > On 06-09-16 22:32, Laszlo Ersek wrote: >> On 09/06/16 14:46, Hans de Goede wrote: >>> Hi, >>> >>> On 06-09-16 13:47, Laszlo Ersek wrote: Adding Matt and Ard On 09/06/16 00:32, Dave Airlie wrote: >>> >>> >>> Picking different

Re: [PATCH xserver 4/4] xfree86: promote one GPU screen if (NumScreens == 0 && NumGPUScreens > 0)

2016-09-07 Thread Laszlo Ersek
On 09/07/16 12:33, Hans de Goede wrote: > On 07-09-16 12:20, Laszlo Ersek wrote: >> On 09/07/16 11:54, Hans de Goede wrote: >>> Ah, see now we're getting somewhere, so maybe we just need to >>> teach xf86IsPrimaryPlatform to also accept devices marked >>> as primary by the xf86PciProbe() iow,

Re: [PATCH xserver 4/4] xfree86: promote one GPU screen if (NumScreens == 0 && NumGPUScreens > 0)

2016-09-07 Thread Laszlo Ersek
On 09/07/16 12:33, Hans de Goede wrote: > TL;DR: I believe that modifying the xf86IsPrimaryPlatform() > code to more or less mirror xf86IsPrimaryPci is the right thing > to do, please give this a try. Right, it works. I'll post the patch in a minute. Thanks! Laszlo

Re: [PATCH xserver] glamor: Fix crash when master gpu is using glamor and another gpu is hotplugged

2016-09-07 Thread Eric Anholt
Hans de Goede writes: > Hi, > > On 06-09-16 22:22, Eric Anholt wrote: >> Hans de Goede writes: >> >>> When a GPU gets hotplugged while X is already running, glamor_egl_init() >>> gets called and changes the current egl context at a point where glamor