mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2025-03-09 00:17:31 +00:00
alarm/xf86-video-omapfb: add patch
This commit is contained in:
parent
2a65d27085
commit
49a630a9ad
1 changed files with 252 additions and 0 deletions
252
alarm/xf86-video-omapfb/xorg-api.patch
Normal file
252
alarm/xf86-video-omapfb/xorg-api.patch
Normal file
|
@ -0,0 +1,252 @@
|
|||
diff -urN a/src/compat-api.h b/src/compat-api.h
|
||||
--- a/src/compat-api.h 1969-12-31 17:00:00.000000000 -0700
|
||||
+++ b/src/compat-api.h 2013-06-19 11:54:57.509601128 -0600
|
||||
@@ -0,0 +1,96 @@
|
||||
+/*
|
||||
+ * Copyright 2012 Red Hat, Inc.
|
||||
+ *
|
||||
+ * Permission is hereby granted, free of charge, to any person obtaining a
|
||||
+ * copy of this software and associated documentation files (the "Software"),
|
||||
+ * to deal in the Software without restriction, including without limitation
|
||||
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
+ * and/or sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice (including the next
|
||||
+ * paragraph) shall be included in all copies or substantial portions of the
|
||||
+ * Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
+ * DEALINGS IN THE SOFTWARE.
|
||||
+ *
|
||||
+ * Author: Dave Airlie <airlied@redhat.com>
|
||||
+ */
|
||||
+
|
||||
+/* this file provides API compat between server post 1.13 and pre it,
|
||||
+ it should be reused inside as many drivers as possible */
|
||||
+#ifndef COMPAT_API_H
|
||||
+#define COMPAT_API_H
|
||||
+
|
||||
+#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
|
||||
+#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
|
||||
+#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
|
||||
+#endif
|
||||
+
|
||||
+#ifndef XF86_HAS_SCRN_CONV
|
||||
+#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
|
||||
+#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
|
||||
+#endif
|
||||
+
|
||||
+#ifndef XF86_SCRN_INTERFACE
|
||||
+
|
||||
+#define SCRN_ARG_TYPE int
|
||||
+#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)]
|
||||
+
|
||||
+#define SCREEN_ARG_TYPE int
|
||||
+#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
|
||||
+
|
||||
+#define SCREEN_INIT_ARGS_DECL int index, ScreenPtr pScreen, int argc, char **argv
|
||||
+
|
||||
+#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
|
||||
+#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
|
||||
+
|
||||
+#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen
|
||||
+#define CLOSE_SCREEN_ARGS scrnIndex, pScreen
|
||||
+
|
||||
+#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
|
||||
+
|
||||
+#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags
|
||||
+
|
||||
+#define FREE_SCREEN_ARGS_DECL int arg, int flags
|
||||
+#define FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0
|
||||
+
|
||||
+#define VT_FUNC_ARGS_DECL int arg, int flags
|
||||
+#define VT_FUNC_ARGS(flags) pScrn->scrnIndex, (flags)
|
||||
+
|
||||
+#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)
|
||||
+#else
|
||||
+#define SCRN_ARG_TYPE ScrnInfoPtr
|
||||
+#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
|
||||
+
|
||||
+#define SCREEN_ARG_TYPE ScreenPtr
|
||||
+#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)
|
||||
+
|
||||
+#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
|
||||
+
|
||||
+#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
|
||||
+#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
|
||||
+
|
||||
+#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
|
||||
+#define CLOSE_SCREEN_ARGS pScreen
|
||||
+
|
||||
+#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y
|
||||
+#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode
|
||||
+
|
||||
+#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg
|
||||
+#define FREE_SCREEN_ARGS(x) (x)
|
||||
+
|
||||
+#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
|
||||
+#define VT_FUNC_ARGS(flags) pScrn
|
||||
+
|
||||
+#define XF86_ENABLEDISABLEFB_ARG(x) (x)
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+#endif
|
||||
diff -urN a/src/omapfb-driver.c b/src/omapfb-driver.c
|
||||
--- a/src/omapfb-driver.c 2011-03-27 21:59:56.000000000 -0600
|
||||
+++ b/src/omapfb-driver.c 2013-06-19 11:56:22.509162085 -0600
|
||||
@@ -44,6 +44,8 @@
|
||||
|
||||
#include "exa.h"
|
||||
|
||||
+#include "compat-api.h"
|
||||
+
|
||||
#ifdef HAVE_XEXTPROTO_71
|
||||
#include <X11/extensions/dpmsconst.h>
|
||||
#else
|
||||
@@ -69,10 +71,10 @@
|
||||
|
||||
static Bool OMAPFBProbe(DriverPtr drv, int flags);
|
||||
static Bool OMAPFBPreInit(ScrnInfoPtr pScrn, int flags);
|
||||
-static Bool OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv);
|
||||
-static Bool OMAPFBEnterVT(int scrnIndex, int flags);
|
||||
-static void OMAPFBLeaveVT(int scrnIndex, int flags);
|
||||
-static Bool OMAPFBSwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
|
||||
+static Bool OMAPFBScreenInit(SCREEN_INIT_ARGS_DECL);
|
||||
+static Bool OMAPFBEnterVT(VT_FUNC_ARGS_DECL);
|
||||
+static void OMAPFBLeaveVT(VT_FUNC_ARGS_DECL);
|
||||
+static Bool OMAPFBSwitchMode(SWITCH_MODE_ARGS_DECL);
|
||||
|
||||
static Bool
|
||||
OMAPFBEnsureRec(ScrnInfoPtr pScrn)
|
||||
@@ -475,7 +477,7 @@
|
||||
}
|
||||
|
||||
static Bool
|
||||
-OMAPFBCloseScreen(int scrnIndex, ScreenPtr pScreen)
|
||||
+OMAPFBCloseScreen(CLOSE_SCREEN_ARGS_DECL)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||
OMAPFBPtr ofb = OMAPFB(pScrn);
|
||||
@@ -484,11 +486,11 @@
|
||||
|
||||
pScreen->CloseScreen = ofb->CloseScreen;
|
||||
|
||||
- return (*pScreen->CloseScreen)(scrnIndex, pScreen);
|
||||
+ return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
|
||||
}
|
||||
|
||||
static Bool
|
||||
-OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
+OMAPFBScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||
OMAPFBPtr ofb = OMAPFB(pScrn);
|
||||
@@ -501,7 +503,7 @@
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED,
|
||||
ofb->fd, 0);
|
||||
if (ofb->fb == NULL) {
|
||||
- xf86DrvMsg(scrnIndex, X_ERROR, "Mapping framebuffer memory failed\n");
|
||||
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Mapping framebuffer memory failed, wanted %d bytes.\n", ofb->mem_info.size);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -511,7 +513,7 @@
|
||||
/* Only support TrueColor for now */
|
||||
if (!miSetVisualTypes(pScrn->depth, TrueColorMask,
|
||||
pScrn->rgbBits, pScrn->defaultVisual)) {
|
||||
- xf86DrvMsg(scrnIndex, X_ERROR, "visual type setup failed"
|
||||
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "visual type setup failed"
|
||||
" for %d bits per pixel [1]\n",
|
||||
pScrn->bitsPerPixel);
|
||||
return FALSE;
|
||||
@@ -519,7 +521,7 @@
|
||||
|
||||
/* Set up pixmap depth information */
|
||||
if (!miSetPixmapDepths()) {
|
||||
- xf86DrvMsg(scrnIndex,X_ERROR,"pixmap depth setup failed\n");
|
||||
+ xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"pixmap depth setup failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -531,7 +533,7 @@
|
||||
pScrn->virtualY, pScrn->xDpi,
|
||||
pScrn->yDpi, pScrn->displayWidth,
|
||||
pScrn->bitsPerPixel)) {
|
||||
- xf86DrvMsg(scrnIndex, X_ERROR, "fbScreenInit failed\n");
|
||||
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "fbScreenInit failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -552,7 +554,7 @@
|
||||
|
||||
/* Initialize XRender fallbacks */
|
||||
if (!fbPictureInit(pScreen, NULL, 0)) {
|
||||
- xf86DrvMsg(scrnIndex, X_ERROR, "fbPictureInit failed\n");
|
||||
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "fbPictureInit failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -564,7 +566,7 @@
|
||||
|
||||
/* Initialize default colormap */
|
||||
if (!miCreateDefColormap(pScreen)) {
|
||||
- xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"creating default colormap failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
@@ -574,7 +576,7 @@
|
||||
/* This is non-fatal since we might be running against older
|
||||
* kernel driver in which case we only do basic 2D stuff...
|
||||
*/
|
||||
- xf86DrvMsg(scrnIndex, X_ERROR, "Reading plane info failed\n");
|
||||
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Reading plane info failed\n");
|
||||
} else if (!ofb->dss) {
|
||||
|
||||
ofb->plane_info.enabled = 1;
|
||||
@@ -582,7 +584,7 @@
|
||||
ofb->plane_info.out_height = ofb->state_info.yres;
|
||||
|
||||
if (ioctl (ofb->fd, OMAPFB_SETUP_PLANE, &ofb->plane_info)) {
|
||||
- xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"%s: Plane setup failed: %s\n",
|
||||
__FUNCTION__, strerror(errno));
|
||||
return FALSE;
|
||||
@@ -625,9 +627,10 @@
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
-static Bool OMAPFBSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
|
||||
+static Bool OMAPFBSwitchMode(SWITCH_MODE_ARGS_DECL)
|
||||
{
|
||||
- return xf86SetSingleMode (xf86Screens[scrnIndex], mode, RR_Rotate_0);
|
||||
+ SCRN_INFO_PTR(arg);
|
||||
+ return xf86SetSingleMode (pScrn, mode, RR_Rotate_0);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -679,14 +682,14 @@
|
||||
/*** Unimplemented: */
|
||||
|
||||
static Bool
|
||||
-OMAPFBEnterVT(int scrnIndex, int flags)
|
||||
+OMAPFBEnterVT(VT_FUNC_ARGS_DECL)
|
||||
{
|
||||
xf86Msg(X_NOT_IMPLEMENTED, "%s\n", __FUNCTION__);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
-OMAPFBLeaveVT(int scrnIndex, int flags)
|
||||
+OMAPFBLeaveVT(VT_FUNC_ARGS_DECL)
|
||||
{
|
||||
xf86Msg(X_NOT_IMPLEMENTED, "%s\n", __FUNCTION__);
|
||||
}
|
Loading…
Reference in a new issue