xserver-xorg-video-ati: Changes to 'ubuntu'
debian/changelog | 6 +
debian/control | 2
debian/patches/xmir.patch | 239 ++++++++++++++++++++++------------------------
3 files changed, 126 insertions(+), 121 deletions(-)
New commits:
commit 6511e8fb24c331b029cd0400dc88a70ff3d60a6f
Author: Christopher James Halse Rogers <raof@ubuntu.com>
Date: Sun Aug 25 21:16:37 2013 +1000
Update to new XMir MM API
diff --git a/debian/changelog b/debian/changelog
index 896c006..8bfb6e1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+xserver-xorg-video-ati (1:7.2.0-0ubuntu4) saucy; urgency=low
+
+ * Update for new XMir API
+
+ -- Christopher James Halse Rogers <raof@ubuntu.com> Thu, 29 Aug 2013 20:18:26 +1000
+
xserver-xorg-video-ati (1:7.2.0-0ubuntu3) saucy; urgency=low
* xmir.patch: Also support 1D tiling. (LP: #1195425)
diff --git a/debian/control b/debian/control
index 32fcf15..678e43f 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Build-Depends:
dh-autoreconf,
quilt,
pkg-config,
- xserver-xorg-dev (>= 2:1.14.2-0ubuntu4~),
+ xserver-xorg-dev (>= 2:1.14.2.901-2ubuntu4~),
x11proto-gl-dev,
x11proto-xext-dev,
x11proto-core-dev,
diff --git a/debian/patches/xmir.patch b/debian/patches/xmir.patch
index 8e81f76..4fdbbf8 100644
--- a/debian/patches/xmir.patch
+++ b/debian/patches/xmir.patch
@@ -6,10 +6,8 @@ Date: Mon Jul 22 17:02:17 2013 +1000
Signed-off-by: Christopher James Halse Rogers <raof@ubuntu.com>
-Index: xf86-video-ati/src/drmmode_display.c
-===================================================================
---- xf86-video-ati.orig/src/drmmode_display.c 2013-08-15 09:44:05.626352176 +1000
-+++ xf86-video-ati/src/drmmode_display.c 2013-08-15 09:44:05.622352176 +1000
+--- a/src/drmmode_display.c
++++ b/src/drmmode_display.c
@@ -1941,7 +1941,7 @@
if (!miCreateDefColormap(pScreen))
return FALSE;
@@ -19,10 +17,8 @@ Index: xf86-video-ati/src/drmmode_display.c
drmmode_load_palette, NULL,
CMAP_PALETTED_TRUECOLOR
#if 0 /* This option messes up text mode! (eich@suse.de) */
-Index: xf86-video-ati/src/radeon.h
-===================================================================
---- xf86-video-ati.orig/src/radeon.h 2013-08-15 09:44:05.626352176 +1000
-+++ xf86-video-ati/src/radeon.h 2013-08-15 09:44:05.622352176 +1000
+--- a/src/radeon.h
++++ b/src/radeon.h
@@ -87,6 +87,14 @@
#include "picturestr.h"
#endif
@@ -51,10 +47,8 @@ Index: xf86-video-ati/src/radeon.h
} RADEONInfoRec, *RADEONInfoPtr;
/* radeon_accel.c */
-Index: xf86-video-ati/src/radeon_bo_helper.c
-===================================================================
---- xf86-video-ati.orig/src/radeon_bo_helper.c 2013-08-15 09:44:05.626352176 +1000
-+++ xf86-video-ati/src/radeon_bo_helper.c 2013-08-15 10:00:04.206385137 +1000
+--- a/src/radeon_bo_helper.c
++++ b/src/radeon_bo_helper.c
@@ -201,19 +201,25 @@
}
@@ -114,10 +108,8 @@ Index: xf86-video-ati/src/radeon_bo_helper.c
}
radeon_set_pixmap_bo(ppix, bo);
-Index: xf86-video-ati/src/radeon_bo_helper.h
-===================================================================
---- xf86-video-ati.orig/src/radeon_bo_helper.h 2013-08-15 09:44:05.626352176 +1000
-+++ xf86-video-ati/src/radeon_bo_helper.h 2013-08-15 09:44:05.622352176 +1000
+--- a/src/radeon_bo_helper.h
++++ b/src/radeon_bo_helper.h
@@ -33,6 +33,7 @@
extern Bool
@@ -127,10 +119,8 @@ Index: xf86-video-ati/src/radeon_bo_helper.h
+ uint32_t *tiling_flags, uint32_t *pitch);
#endif /* RADEON_BO_HELPER_H */
-Index: xf86-video-ati/src/radeon_dri2.c
-===================================================================
---- xf86-video-ati.orig/src/radeon_dri2.c 2013-08-15 09:44:05.626352176 +1000
-+++ xf86-video-ati/src/radeon_dri2.c 2013-08-15 09:44:05.622352176 +1000
+--- a/src/radeon_dri2.c
++++ b/src/radeon_dri2.c
@@ -1535,6 +1535,18 @@
#endif /* USE_DRI2_SCHEDULING */
@@ -171,10 +161,8 @@ Index: xf86-video-ati/src/radeon_dri2.c
#if DRI2INFOREC_VERSION >= 9
dri2_info.version = 9;
dri2_info.CreateBuffer2 = radeon_dri2_create_buffer2;
-Index: xf86-video-ati/src/radeon_exa.c
-===================================================================
---- xf86-video-ati.orig/src/radeon_exa.c 2013-08-15 09:44:05.626352176 +1000
-+++ xf86-video-ati/src/radeon_exa.c 2013-08-15 09:44:05.622352176 +1000
+--- a/src/radeon_exa.c
++++ b/src/radeon_exa.c
@@ -326,12 +326,12 @@
Bool RADEONEXASetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle)
{
@@ -190,10 +178,8 @@ Index: xf86-video-ati/src/radeon_exa.c
return TRUE;
}
#endif
-Index: xf86-video-ati/src/radeon_glamor.c
-===================================================================
---- xf86-video-ati.orig/src/radeon_glamor.c 2013-08-15 09:44:05.626352176 +1000
-+++ xf86-video-ati/src/radeon_glamor.c 2013-08-15 09:44:05.622352176 +1000
+--- a/src/radeon_glamor.c
++++ b/src/radeon_glamor.c
@@ -277,14 +277,15 @@
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
struct radeon_surface surface;
@@ -213,10 +199,8 @@ Index: xf86-video-ati/src/radeon_glamor.c
if (!radeon_glamor_create_textured_pixmap(pixmap)) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
-Index: xf86-video-ati/src/radeon_kms.c
-===================================================================
---- xf86-video-ati.orig/src/radeon_kms.c 2013-08-15 09:44:05.626352176 +1000
-+++ xf86-video-ati/src/radeon_kms.c 2013-08-15 09:44:05.626352176 +1000
+--- a/src/radeon_kms.c
++++ b/src/radeon_kms.c
@@ -220,7 +220,11 @@
return FALSE;
pScreen->CreateScreenResources = RADEONCreateScreenResources_KMS;
@@ -230,29 +214,34 @@ Index: xf86-video-ati/src/radeon_kms.c
return FALSE;
drmmode_uevent_init(pScrn, &info->drmmode);
-@@ -285,6 +289,102 @@
+@@ -285,6 +289,66 @@
}
#endif
+static void
-+radeon_xmir_copy_pixmap_to_mir(PixmapPtr src, int prime_fd)
++radeon_xmir_copy_to_mir(xmir_window *xmir_win, RegionPtr region)
+{
++ WindowPtr win = xmir_window_to_windowptr(xmir_win);
++ PixmapPtr src = (*win->drawable.pScreen->GetWindowPixmap)(win);
+ ScreenPtr pScreen = src->drawable.pScreen;
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+ RADEONInfoPtr info = RADEONPTR(pScrn);
++ BoxPtr output_box = xmir_window_get_drawable_region(xmir_win);
++ BoxPtr damage_box = RegionExtents(region);
+ if (info->accel_state->exa) {
+ PixmapPtr dst;
+ int ret;
-+ int fd_copy = dup(prime_fd);
++ int fd_copy = dup(xmir_window_get_fd(xmir_win));
+ /* TODO: Create this scratch pixmap once to avoid allocation overhead */
+ dst = pScreen->CreatePixmap(pScreen, 0, 0, pScrn->depth, 0);
+ if (dst == NullPixmap)
+ return;
+
+ if (!pScreen->ModifyPixmapHeader(dst,
-+ pScrn->virtualX, pScrn->virtualY,
++ output_box->x2 - output_box->x1,
++ output_box->y2 - output_box->y1,
+ pScrn->depth, pScrn->bitsPerPixel,
-+ src->devKind, NULL))
++ xmir_window_get_stride(xmir_win), NULL))
+ goto cleanup_dst;
+
+
@@ -262,87 +251,46 @@ Index: xf86-video-ati/src/radeon_kms.c
+ -1, -1, GXcopy, FB_ALLONES);
+ if (!ret)
+ goto cleanup_dst;
-+ info->accel_state->exa->Copy (dst, 0, 0, 0, 0,
-+ pScrn->virtualX, pScrn->virtualY);
++ info->accel_state->exa->Copy (dst,
++ damage_box->x1, damage_box->y1,
++ damage_box->x1 - output_box->x1,
++ damage_box->y1 - output_box->y1,
++ output_box->x2 - output_box->x1,
++ output_box->y2 - output_box->y1);
+ info->accel_state->exa->DoneCopy (dst);
+
+ radeon_cs_flush_indirect(pScrn);
+
++ xmir_submit_rendering_for_window(xmir_win, region);
+cleanup_dst:
+ pScreen->DestroyPixmap(dst);
+ } else if (0) {
+ /* TODO: glamor accel */
+ } else {
-+ /* Hideously bad software copy */
-+ struct radeon_bo *bo_src = radeon_get_pixmap_bo(src);
-+ struct radeon_bo *bo_dst = radeon_gem_bo_open_prime(info->bufmgr, prime_fd, src->devKind * src->drawable.height);
-+
-+ radeon_bo_map(bo_src, FALSE);
-+ radeon_bo_map(bo_dst, TRUE);
-+
-+ memcpy(bo_dst->ptr, bo_src->ptr, bo_dst->size);
-+
-+ radeon_bo_unmap(bo_src);
-+ radeon_bo_unmap(bo_dst);
-+
-+ radeon_bo_unref(bo_dst);
-+ }
-+}
-+
-+static void
-+radeon_xmir_buffer_available(WindowPtr win)
-+{
-+ int window_fd;
-+ PixmapPtr window_pixmap;
-+
-+ if(!xmir_window_is_dirty(win))
-+ return;
-+
-+ window_fd = xmir_prime_fd_for_window(win);
-+
-+ window_pixmap = (*win->drawable.pScreen->GetWindowPixmap)(win);
-+ radeon_xmir_copy_pixmap_to_mir(window_pixmap, window_fd);
-+
-+ xmir_submit_rendering_for_window(win, NULL);
-+}
-+
-+static void
-+radeon_submit_dirty_window(WindowPtr win)
-+{
-+ int window_fd;
-+ PixmapPtr window_pixmap;
-+
-+ if(!xmir_window_has_free_buffer(win))
-+ return;
-+
-+ window_fd = xmir_prime_fd_for_window(win);
-+
-+ window_pixmap = (*win->drawable.pScreen->GetWindowPixmap)(win);
-+ radeon_xmir_copy_pixmap_to_mir(window_pixmap, window_fd);
-+
-+ xmir_submit_rendering_for_window(win, NULL);
++ /* Software copy; let's just give up */
++ }
+}
+
+#ifdef XMIR
+static xmir_driver xmir_radeon_driver = {
+ XMIR_DRIVER_VERSION,
-+ radeon_xmir_buffer_available
++ radeon_xmir_copy_to_mir
+};
+#endif
+
static void RADEONBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)
{
SCREEN_PTR(arg);
-@@ -302,6 +402,8 @@
+@@ -302,6 +366,8 @@
#ifdef RADEON_PIXMAP_SHARING
radeon_dirty_update(pScreen);
#endif
+ if(info->xmir)
-+ xmir_screen_for_each_damaged_window(info->xmir, radeon_submit_dirty_window);
++ xmir_screen_for_each_damaged_window(info->xmir, radeon_xmir_copy_to_mir);
}
static void
-@@ -606,6 +708,24 @@
+@@ -606,6 +672,24 @@
dev->domain, dev->bus, dev->dev, dev->func);
#endif
@@ -367,7 +315,7 @@ Index: xf86-video-ati/src/radeon_kms.c
info->dri2.drm_fd = drmOpen("radeon", busid);
if (info->dri2.drm_fd == -1) {
-@@ -835,6 +955,14 @@
+@@ -835,6 +919,14 @@
if (!RADEONPreInitChipType_KMS(pScrn))
goto fail;
@@ -382,7 +330,12 @@ Index: xf86-video-ati/src/radeon_kms.c
if (radeon_open_drm_master(pScrn) == FALSE) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Kernel modesetting setup failed\n");
goto fail;
-@@ -913,6 +1041,10 @@
+@@ -909,10 +1001,14 @@
+ }
+
+ info->swapBuffersWait = xf86ReturnOptValBool(info->Options,
+- OPTION_SWAPBUFFERS_WAIT, TRUE);
++ OPTION_SWAPBUFFERS_WAIT, !xorgMir);
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"SwapBuffers wait for vsync: %sabled\n", info->swapBuffersWait ? "en" : "dis");
@@ -393,7 +346,7 @@ Index: xf86-video-ati/src/radeon_kms.c
if (drmmode_pre_init(pScrn, &info->drmmode, pScrn->bitsPerPixel / 8) == FALSE) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Kernel modesetting setup failed\n");
goto fail;
-@@ -922,7 +1054,10 @@
+@@ -922,7 +1018,10 @@
pRADEONEnt->HasCRTC2 = FALSE;
else
pRADEONEnt->HasCRTC2 = TRUE;
@@ -405,7 +358,7 @@ Index: xf86-video-ati/src/radeon_kms.c
/* fix up cloning on rn50 cards
* since they only have one crtc sometimes the xserver doesn't assign
-@@ -1122,6 +1257,11 @@
+@@ -1122,6 +1221,11 @@
if (info->accel_state->use_vbos)
radeon_vbo_free_lists(pScrn);
@@ -417,7 +370,29 @@ Index: xf86-video-ati/src/radeon_kms.c
drmDropMaster(info->dri2.drm_fd);
drmmode_fini(pScrn, &info->drmmode);
-@@ -1157,7 +1297,7 @@
+@@ -1150,6 +1254,21 @@
+ RADEONFreeRec(pScrn);
+ }
+
++static void
++RADEONSetScreenPixmap_KMS(PixmapPtr pixmap)
++{
++ ScrnInfoPtr pScrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
++ RADEONInfoPtr info = RADEONPTR(pScrn);
++
++ if (info->accel_state->exa)
++ exaMoveInPixmap(pixmap);
++
++ info->front_bo = radeon_get_pixmap_bo(pixmap);
++ memmove(&info->front_surface, radeon_get_pixmap_surface(pixmap), sizeof info->front_surface);
++
++ pixmap->drawable.pScreen->devPrivate = pixmap;
++}
++
+ Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
+ {
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+@@ -1157,7 +1276,7 @@
int subPixelOrder = SubPixelUnknown;
char* s;
void *front_ptr;
@@ -426,7 +401,7 @@ Index: xf86-video-ati/src/radeon_kms.c
pScrn->fbOffset = 0;
-@@ -1168,7 +1308,8 @@
+@@ -1168,7 +1287,8 @@
pScrn->defaultVisual)) return FALSE;
miSetPixmapDepths ();
@@ -436,7 +411,7 @@ Index: xf86-video-ati/src/radeon_kms.c
if (ret) {
ErrorF("Unable to retrieve master\n");
return FALSE;
-@@ -1185,7 +1326,8 @@
+@@ -1185,7 +1305,8 @@
"failed to initialise GEM buffer manager");
return FALSE;
}
@@ -446,26 +421,28 @@ Index: xf86-video-ati/src/radeon_kms.c
if (!info->csm)
info->csm = radeon_cs_manager_gem_ctor(info->dri2.drm_fd);
-@@ -1259,6 +1401,9 @@
- /* Must be after RGB order fixed */
- fbPictureInit (pScreen, 0, 0);
-
-+ if (info->xmir)
-+ xmir_screen_init(pScreen, info->xmir);
-+
- #ifdef RENDER
- if ((s = xf86GetOptValString(info->Options, OPTION_SUBPIXEL_ORDER))) {
- if (strcmp(s, "RGB") == 0) subPixelOrder = SubPixelHorizontalRGB;
-@@ -1309,7 +1454,7 @@
+@@ -1309,7 +1430,10 @@
/* Cursor setup */
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
- if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) {
++ if (info->xmir)
++ xmir_screen_init(pScreen, info->xmir);
++
+ if (!info->xmir && !xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) {
if (RADEONCursorInit_KMS(pScreen)) {
}
}
-@@ -1385,13 +1530,13 @@
+@@ -1351,6 +1475,8 @@
+ info->CreateScreenResources = pScreen->CreateScreenResources;
+ pScreen->CreateScreenResources = RADEONCreateScreenResources_KMS;
+
++ pScreen->SetScreenPixmap = RADEONSetScreenPixmap_KMS;
++
+ #ifdef RADEON_PIXMAP_SHARING
+ pScreen->StartPixmapTracking = PixmapStartDirtyTracking;
+ pScreen->StopPixmapTracking = PixmapStopDirtyTracking;
+@@ -1385,13 +1511,13 @@
{
SCRN_INFO_PTR(arg);
RADEONInfoPtr info = RADEONPTR(pScrn);
@@ -482,7 +459,7 @@ Index: xf86-video-ati/src/radeon_kms.c
if (ret)
ErrorF("Unable to retrieve master\n");
info->accel_state->XInited3D = FALSE;
-@@ -1399,7 +1544,9 @@
+@@ -1399,7 +1525,9 @@
pScrn->vtSema = TRUE;
@@ -493,7 +470,17 @@ Index: xf86-video-ati/src/radeon_kms.c
return FALSE;
return TRUE;
-@@ -1540,6 +1687,7 @@
+@@ -1414,7 +1542,8 @@
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
+ "RADEONLeaveVT_KMS\n");
+
+- drmDropMaster(info->dri2.drm_fd);
++ if (!xorgMir)
++ drmDropMaster(info->dri2.drm_fd);
+
+ xf86RotateFreeShadow(pScrn);
+
+@@ -1540,6 +1669,7 @@
}
info->front_surface = surface;
}
@@ -501,10 +488,8 @@ Index: xf86-video-ati/src/radeon_kms.c
{
int cursor_size;
int c;
-Index: xf86-video-ati/src/radeon_probe.c
-===================================================================
---- xf86-video-ati.orig/src/radeon_probe.c 2013-08-15 09:44:05.626352176 +1000
-+++ xf86-video-ati/src/radeon_probe.c 2013-08-15 09:44:05.626352176 +1000
+--- a/src/radeon_probe.c
++++ b/src/radeon_probe.c
@@ -40,6 +40,7 @@
* KMS support - Dave Airlie <airlied@redhat.com>
*/
@@ -609,10 +594,14 @@ Index: xf86-video-ati/src/radeon_probe.c
if (!radeon_kernel_mode_enabled(pScrn, dev->pdev))
return FALSE;
-Index: xf86-video-ati/src/radeon_video.c
-===================================================================
---- xf86-video-ati.orig/src/radeon_video.c 2013-08-15 09:44:05.626352176 +1000
-+++ xf86-video-ati/src/radeon_video.c 2013-08-15 09:44:05.626352176 +1000
+--- a/src/radeon_video.c
++++ b/src/radeon_video.c
+@@ -1,4 +1,4 @@
+-
++
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
@@ -70,7 +70,10 @@
Bool radeon_crtc_is_enabled(xf86CrtcPtr crtc)
{
@@ -625,3 +614,13 @@ Index: xf86-video-ati/src/radeon_video.c
}
uint32_t radeon_get_interpolated_vblanks(xf86CrtcPtr crtc)
+@@ -92,6 +95,9 @@
+ if (!pScrn->vtSema)
+ return NULL;
+
++ if (xorgMir)
++ return NULL;
++
+ box.x1 = x1;
+ box.x2 = x2;
+ box.y1 = y1;
Reply to: