xorg-server: merge patches from LFS for two bugfixes.

- Fix PRIME support
- Fix modesetting with hidden cursor
This commit is contained in:
Juan RP 2015-05-15 09:55:34 +02:00
parent b7b3da232b
commit 96589a7690
3 changed files with 185 additions and 1 deletions

View file

@ -0,0 +1,92 @@
Submitted By: Armin K. <krejzi at email dot com>
Date: 2012-12-30
Initial Package Version: 1.13.1
Upstream Status: Not submitted.
Origin: Upstream mailing list.
Description: Adds PRIME support to Xorg Server to make GPU offloading work.
--- hw/xfree86/common/xf86Init.c 2014-06-04 12:49:11.000000000 +0200
+++ hw/xfree86/common/xf86Init.c 2014-06-04 14:00:29.539324458 +0200
@@ -363,6 +363,16 @@
return ret;
}
+extern void xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master);
+static void
+xf86AutoConfigOutputDevices(void)
+{
+ int i;
+
+ for (i = 0; i < xf86NumGPUScreens; i++)
+ xf86AutoConfigOutputDevice(xf86GPUScreens[i], xf86Screens[0]);
+}
+
static void
InstallSignalHandlers(void)
{
@@ -952,6 +962,8 @@
for (i = 0; i < xf86NumGPUScreens; i++)
AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
+ xf86AutoConfigOutputDevices();
+
xf86VGAarbiterWrapFunctions();
if (sigio_blocked)
OsReleaseSIGIO();
--- hw/xfree86/common/xf86platformBus.c 2014-06-04 12:49:11.000000000 +0200
+++ hw/xfree86/common/xf86platformBus.c 2014-06-04 14:00:29.539324458 +0200
@@ -426,6 +426,8 @@
return foundScreen;
}
+extern void xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master);
+
int
xf86platformAddDevice(int index)
{
@@ -494,6 +496,7 @@
}
/* attach unbound to 0 protocol screen */
AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
+ xf86AutoConfigOutputDevice(xf86GPUScreens[i], xf86Screens[0]);
RRResourcesChanged(xf86Screens[0]->pScreen);
RRTellChanged(xf86Screens[0]->pScreen);
--- hw/xfree86/modes/xf86Crtc.c 2014-06-04 12:49:11.000000000 +0200
+++ hw/xfree86/modes/xf86Crtc.c 2014-06-04 14:00:29.540324474 +0200
@@ -3387,3 +3387,35 @@
crtc->x = crtc->y = 0;
}
}
+
+
+void xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master)
+{
+ RRProviderPtr master_provider;
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(master);
+ xf86CrtcConfigPtr slave_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ Bool unbound = FALSE;
+
+ if (!config || !slave_config)
+ return;
+
+ master_provider = config->randr_provider;
+
+ if ((master->capabilities & RR_Capability_SinkOffload) &&
+ pScrn->capabilities & RR_Capability_SourceOffload) {
+ /* source offload */
+
+ DetachUnboundGPU(pScrn->pScreen);
+ unbound = TRUE;
+ AttachOffloadGPU(master->pScreen, pScrn->pScreen);
+ slave_config->randr_provider->offload_sink = master_provider;
+ }
+ if ((master->capabilities & RR_Capability_SourceOutput) &&
+ pScrn->capabilities & RR_Capability_SinkOutput) {
+ /* sink offload */
+ if (!unbound)
+ DetachUnboundGPU(pScrn->pScreen);
+ AttachOutputGPU(master->pScreen, pScrn->pScreen);
+ slave_config->randr_provider->output_source = master_provider;
+ }
+}

View file

@ -0,0 +1,92 @@
Submitted By: Pierre Labastie <pierre at linuxfromscratch dot org>
Date: 2015-02-28
Initial Package Version: 1.17.1
Upstream Status: submitted and partly reviewed
Origin: Takashi Iwai <tiwai at suse.de>
Description: Fix 32 bit breakage and mouse pointer disappearing.
--- hw/xfree86/drivers/modesetting/drmmode_display.c 2015-01-30 14:09:13.000000000 +0100
+++ hw/xfree86/drivers/modesetting/drmmode_display.c 2015-02-28 17:57:23.932964255 +0100
@@ -409,7 +409,7 @@
drmModeMoveCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, x, y);
}
-static void
+static Bool
drmmode_set_cursor(xf86CrtcPtr crtc)
{
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
@@ -427,10 +427,10 @@
drmModeSetCursor2(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
handle, ms->cursor_width, ms->cursor_height,
cursor->bits->xhot, cursor->bits->yhot);
- if (ret == -EINVAL)
+ if (ret)
use_set_cursor2 = FALSE;
else
- return;
+ return TRUE;
}
ret = drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle,
@@ -443,16 +443,21 @@
cursor_info->MaxWidth = cursor_info->MaxHeight = 0;
drmmode_crtc->drmmode->sw_cursor = TRUE;
/* fallback to swcursor */
+ return FALSE;
}
+ return TRUE;
}
-static void
-drmmode_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
+static void drmmode_hide_cursor(xf86CrtcPtr crtc);
+
+static Bool
+drmmode_load_cursor_argb_check(xf86CrtcPtr crtc, CARD32 *image)
{
modesettingPtr ms = modesettingPTR(crtc->scrn);
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
int i;
uint32_t *ptr;
+ static Bool first_time = TRUE;
/* cursor should be mapped already */
ptr = (uint32_t *) (drmmode_crtc->cursor_bo->ptr);
@@ -460,8 +465,14 @@
for (i = 0; i < ms->cursor_width * ms->cursor_height; i++)
ptr[i] = image[i]; // cpu_to_le32(image[i]);
- if (drmmode_crtc->cursor_up)
- drmmode_set_cursor(crtc);
+ if (drmmode_crtc->cursor_up || first_time) {
+ Bool ret = drmmode_set_cursor(crtc);
+ if (!drmmode_crtc->cursor_up)
+ drmmode_hide_cursor(crtc);
+ first_time = FALSE;
+ return ret;
+ }
+ return TRUE;
}
static void
@@ -665,7 +676,7 @@
.set_cursor_position = drmmode_set_cursor_position,
.show_cursor = drmmode_show_cursor,
.hide_cursor = drmmode_hide_cursor,
- .load_cursor_argb = drmmode_load_cursor_argb,
+ .load_cursor_argb_check = drmmode_load_cursor_argb_check,
.gamma_set = drmmode_crtc_gamma_set,
.destroy = NULL, /* XXX */
--- hw/xfree86/drivers/modesetting/dumb_bo.c 2015-01-18 00:42:52.000000000 +0100
+++ hw/xfree86/drivers/modesetting/dumb_bo.c 2015-02-28 17:53:22.028967314 +0100
@@ -25,6 +25,8 @@
*
*/
+#define _FILE_OFFSET_BITS 64
+
#include "dumb_bo.h"
#include <errno.h>

View file

@ -1,7 +1,7 @@
# Template build file for 'xorg-server'.
pkgname=xorg-server
version=1.17.1
revision=10
revision=11
build_pie=yes
build_style=gnu-configure
configure_args="--enable-ipv6 --enable-record --enable-xorg