[xorg-x11-drv-qxl] qxl: fix compat driver for new API
Dave Airlie
airlied at fedoraproject.org
Wed Jul 18 20:56:09 UTC 2012
commit 956f6dbbeca335ba07753ea7ac99845e02df735a
Author: Dave Airlie <airlied at redhat.com>
Date: Wed Jul 18 17:02:23 2012 -0400
qxl: fix compat driver for new API
0001-compat-bump-to-new-server-API-changes.patch | 191 ++++++++++++++++++++++
xorg-x11-drv-qxl.spec | 6 +-
2 files changed, 195 insertions(+), 2 deletions(-)
---
diff --git a/0001-compat-bump-to-new-server-API-changes.patch b/0001-compat-bump-to-new-server-API-changes.patch
new file mode 100644
index 0000000..96b7d98
--- /dev/null
+++ b/0001-compat-bump-to-new-server-API-changes.patch
@@ -0,0 +1,191 @@
+From 733db0447c9279797baccefaaf6e60382184a039 Mon Sep 17 00:00:00 2001
+From: Dave Airlie <airlied at gmail.com>
+Date: Thu, 19 Jul 2012 06:53:59 +1000
+Subject: [PATCH] compat: bump to new server API changes
+
+---
+ src/compat/compat-qxl.h | 1 +
+ src/compat/compat-qxl_driver.c | 51 ++++++++++++++++++++--------------------
+ 2 files changed, 27 insertions(+), 25 deletions(-)
+
+diff --git a/src/compat/compat-qxl.h b/src/compat/compat-qxl.h
+index 2c61699..eed3a2f 100644
+--- a/src/compat/compat-qxl.h
++++ b/src/compat/compat-qxl.h
+@@ -41,6 +41,7 @@
+ #include "fb.h"
+ #include "vgaHW.h"
+
++#include "../compat-api.h"
+ #define hidden _X_HIDDEN
+
+ #define QXL_NAME "compat_qxl"
+diff --git a/src/compat/compat-qxl_driver.c b/src/compat/compat-qxl_driver.c
+index 758ee24..0047382 100644
+--- a/src/compat/compat-qxl_driver.c
++++ b/src/compat/compat-qxl_driver.c
+@@ -260,14 +260,14 @@ compat_qxl_restore_state(ScrnInfoPtr pScrn)
+ }
+
+ static Bool
+-compat_qxl_close_screen(int scrnIndex, ScreenPtr pScreen)
++compat_qxl_close_screen(CLOSE_SCREEN_ARGS_DECL)
+ {
+- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
++ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+ compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
+
+ if (pScrn->vtSema) {
+ compat_qxl_restore_state(pScrn);
+- compat_qxl_unmap_memory(compat_qxl, scrnIndex);
++ compat_qxl_unmap_memory(compat_qxl, pScrn->scrnIndex);
+ }
+ pScrn->vtSema = FALSE;
+
+@@ -276,14 +276,15 @@ compat_qxl_close_screen(int scrnIndex, ScreenPtr pScreen)
+ pScreen->CreateScreenResources = compat_qxl->create_screen_resources;
+ pScreen->CloseScreen = compat_qxl->close_screen;
+
+- return pScreen->CloseScreen(scrnIndex, pScreen);
++ return pScreen->CloseScreen(CLOSE_SCREEN_ARGS);
+ }
+
+ static Bool
+-compat_qxl_switch_mode(int scrnIndex, DisplayModePtr p, int flags)
++compat_qxl_switch_mode(SWITCH_MODE_ARGS_DECL)
+ {
+- compat_qxl_screen_t *compat_qxl = xf86Screens[scrnIndex]->driverPrivate;
+- int mode_index = (int)(unsigned long)p->Private;
++ SCRN_INFO_PTR(arg);
++ compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
++ int mode_index = (int)(unsigned long)mode->Private;
+ struct compat_qxl_mode *m = compat_qxl->modes + mode_index;
+ ScreenPtr pScreen = compat_qxl->pScrn->pScreen;
+
+@@ -291,8 +292,8 @@ compat_qxl_switch_mode(int scrnIndex, DisplayModePtr p, int flags)
+ return FALSE;
+
+ /* if (debug) */
+- xf86DrvMsg (scrnIndex, X_INFO, "Setting mode %d (%d x %d) (%d x %d) %p\n",
+- m->id, m->x_res, m->y_res, p->HDisplay, p->VDisplay, p);
++ xf86DrvMsg (pScrn->scrnIndex, X_INFO, "Setting mode %d (%d x %d) (%d x %d) %p\n",
++ m->id, m->x_res, m->y_res, mode->HDisplay, mode->VDisplay, mode);
+
+ outb(compat_qxl->io_base + QXL_IO_RESET, 0);
+
+@@ -571,7 +572,7 @@ compat_qxl_sanity_check (compat_qxl_screen_t *compat_qxl)
+ if (compat_qxl->rom->mode == ~0)
+ {
+ ErrorF("QXL device jumped back to VGA mode - resetting mode\n");
+- compat_qxl_switch_mode(compat_qxl->pScrn->scrnIndex, compat_qxl->pScrn->currentMode, 0);
++ compat_qxl_switch_mode(SWITCH_MODE_ARGS(compat_qxl->pScrn, compat_qxl->pScrn->currentMode));
+ }
+ }
+
+@@ -638,7 +639,7 @@ compat_qxl_on_damage (DamagePtr pDamage, RegionPtr pRegion, pointer closure)
+ static Bool
+ compat_qxl_create_screen_resources(ScreenPtr pScreen)
+ {
+- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
++ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+ compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
+ Bool ret;
+ PixmapPtr pPixmap;
+@@ -691,7 +692,7 @@ compat_qxl_poly_fill_rect (DrawablePtr pDrawable,
+ int nrect,
+ xRectangle *prect)
+ {
+- ScrnInfoPtr pScrn = xf86Screens[pDrawable->pScreen->myNum];
++ ScrnInfoPtr pScrn = xf86ScreenToScrn(pDrawable->pScreen);
+ compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
+ PixmapPtr pPixmap;
+ int xoff, yoff;
+@@ -746,7 +747,7 @@ compat_qxl_copy_n_to_n (DrawablePtr pSrcDrawable,
+ void *closure)
+ {
+ ScreenPtr pScreen = pSrcDrawable->pScreen;
+- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
++ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+ compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
+ int src_xoff, src_yoff;
+ int dst_xoff, dst_yoff;
+@@ -859,7 +860,7 @@ static void
+ compat_qxl_fill_region_solid (DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel)
+ {
+ ScreenPtr pScreen = pDrawable->pScreen;
+- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
++ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+ compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
+ PixmapPtr pPixmap;
+ int xoff, yoff;
+@@ -937,9 +938,9 @@ compat_qxl_create_gc (GCPtr pGC)
+ }
+
+ static Bool
+-compat_qxl_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
++compat_qxl_screen_init(SCREEN_INIT_ARGS_DECL)
+ {
+- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
++ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+ compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
+ struct compat_qxl_rom *rom;
+ struct compat_qxl_ram_header *ram_header;
+@@ -949,7 +950,7 @@ compat_qxl_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+
+ compat_qxl->pScrn = pScrn;
+
+- if (!compat_qxl_map_memory(compat_qxl, scrnIndex))
++ if (!compat_qxl_map_memory(compat_qxl, pScrn->scrnIndex))
+ return FALSE;
+
+ rom = compat_qxl->rom;
+@@ -1053,7 +1054,7 @@ compat_qxl_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+
+ CHECK_POINT();
+
+- compat_qxl_switch_mode(scrnIndex, pScrn->currentMode, 0);
++ compat_qxl_switch_mode(SWITCH_MODE_ARGS(pScrn, pScrn->currentMode));
+
+ CHECK_POINT();
+
+@@ -1064,20 +1065,20 @@ out:
+ }
+
+ static Bool
+-compat_qxl_enter_vt(int scrnIndex, int flags)
++compat_qxl_enter_vt(VT_FUNC_ARGS_DECL)
+ {
+- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
++ SCRN_INFO_PTR(arg);
+
+ compat_qxl_save_state(pScrn);
+- compat_qxl_switch_mode(scrnIndex, pScrn->currentMode, 0);
++ compat_qxl_switch_mode(SWITCH_MODE_ARGS(pScrn, pScrn->currentMode));
+
+ return TRUE;
+ }
+
+ static void
+-compat_qxl_leave_vt(int scrnIndex, int flags)
++compat_qxl_leave_vt(VT_FUNC_ARGS_DECL)
+ {
+- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
++ SCRN_INFO_PTR(arg);
+
+ compat_qxl_restore_state(pScrn);
+ }
+@@ -1212,9 +1213,9 @@ compat_qxl_find_native_mode(ScrnInfoPtr pScrn, DisplayModePtr p)
+ }
+
+ static ModeStatus
+-compat_qxl_valid_mode(int scrn, DisplayModePtr p, Bool flag, int pass)
++compat_qxl_valid_mode(SCRN_ARG_TYPE arg, DisplayModePtr p, Bool flag, int pass)
+ {
+- ScrnInfoPtr pScrn = xf86Screens[scrn];
++ SCRN_INFO_PTR(arg);
+ compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
+ int bpp = pScrn->bitsPerPixel;
+ int mode_idx;
+--
+1.7.10.4
+
diff --git a/xorg-x11-drv-qxl.spec b/xorg-x11-drv-qxl.spec
index 41818c4..7d11f58 100644
--- a/xorg-x11-drv-qxl.spec
+++ b/xorg-x11-drv-qxl.spec
@@ -22,6 +22,7 @@ Source0: %{tarball}-%{gitdate}.tar.bz2
# Support for old revision 1 qxl device (which won't go upstream)
Patch8: 0008-Add-old-driver-in-as-a-compatibility-layer.patch
Patch9: 0009-Link-in-the-compat-driver-various-renamings.patch
+Patch10: 0001-compat-bump-to-new-server-API-changes.patch
License: MIT
Group: User Interface/X Hardware Support
@@ -58,6 +59,7 @@ XSpice is both an X and a Spice server.a
%setup -q -n %{tarball}-%{?gitdate:%{gitdate}}%{!?gitdate:%{tarversion}}
%patch8 -p1
%patch9 -p1
+%patch10 -p1
autoreconf -f -i
@@ -91,14 +93,14 @@ rm $RPM_BUILD_ROOT/usr/share/doc/xf86-video-qxl/spiceqxl.xorg.conf.example
%files
%defattr(-,root,root,-)
-%doc COPYING README ChangeLog
+%doc COPYING README
%{driverdir}/qxl_drv.so
%ifarch x86_64
%files -n xorg-x11-server-Xspice
%defattr(-,root,root,-)
-%doc COPYING README.xspice README ChangeLog examples/spiceqxl.xorg.conf.example
+%doc COPYING README.xspice README examples/spiceqxl.xorg.conf.example
%config(noreplace) %{_sysconfdir}/X11/spiceqxl.xorg.conf
%{_bindir}/Xspice
%{driverdir}/spiceqxl_drv.so
More information about the scm-commits
mailing list