xorg driver, added randr

This commit is contained in:
Jay Sorg 2013-07-16 21:04:00 -07:00
parent e7039c4603
commit e7741d040c
5 changed files with 286 additions and 2 deletions

View File

@ -4,7 +4,7 @@ rdpCopyArea.o rdpCopyPlane.o rdpPolyPoint.o rdpPolylines.o rdpPolySegment.o \
rdpPolyRectangle.o rdpPolyArc.o rdpFillPolygon.o rdpPolyFillRect.o \ rdpPolyRectangle.o rdpPolyArc.o rdpFillPolygon.o rdpPolyFillRect.o \
rdpPolyFillArc.o rdpPolyText8.o rdpPolyText16.o rdpImageText8.o \ rdpPolyFillArc.o rdpPolyText8.o rdpPolyText16.o rdpImageText8.o \
rdpImageText16.o rdpImageGlyphBlt.o rdpPolyGlyphBlt.o rdpPushPixels.o \ rdpImageText16.o rdpImageGlyphBlt.o rdpPolyGlyphBlt.o rdpPushPixels.o \
rdpCursor.o rdpMain.o rdpCursor.o rdpMain.o rdpRandR.o
CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1

View File

@ -26,13 +26,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <scrnintstr.h> #include <scrnintstr.h>
#include <gcstruct.h> #include <gcstruct.h>
#include <mipointer.h> #include <mipointer.h>
#include <randrstr.h>
#include "rdpPri.h" #include "rdpPri.h"
/* move this to common header */ /* move this to common header */
struct _rdpRec struct _rdpRec
{ {
char data[1024];
int width; int width;
int height; int height;
int num_modes; int num_modes;
@ -49,6 +49,20 @@ struct _rdpRec
miPointerScreenFuncPtr pCursorFuncs; miPointerScreenFuncPtr pCursorFuncs;
/* RandR */
RRSetConfigProcPtr rrSetConfig;
RRGetInfoProcPtr rrGetInfo;
RRScreenSetSizeProcPtr rrScreenSetSize;
RRCrtcSetProcPtr rrCrtcSet;
RRCrtcSetGammaProcPtr rrCrtcSetGamma;
RRCrtcGetGammaProcPtr rrCrtcGetGamma;
RROutputSetPropertyProcPtr rrOutputSetProperty;
RROutputValidateModeProcPtr rrOutputValidateMode;
RRModeDestroyProcPtr rrModeDestroy;
RROutputGetPropertyProcPtr rrOutputGetProperty;
RRGetPanningProcPtr rrGetPanning;
RRSetPanningProcPtr rrSetPanning;
}; };
typedef struct _rdpRec rdpRec; typedef struct _rdpRec rdpRec;
typedef struct _rdpRec * rdpPtr; typedef struct _rdpRec * rdpPtr;

View File

@ -0,0 +1,156 @@
/*
Copyright 2011-2013 Jay Sorg
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice 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
OPEN GROUP 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.
RandR draw calls
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* this should be before all X11 .h files */
#include <xorg-server.h>
/* all driver need this */
#include <xf86.h>
#include <xf86_OSproc.h>
#include <mipointer.h>
#include <fb.h>
#include <micmap.h>
#include <mi.h>
#include "rdp.h"
/******************************************************************************/
#define LOG_LEVEL 1
#define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
/******************************************************************************/
Bool
rdpRRRegisterSize(ScreenPtr pScreen, int width, int height)
{
LLOGLN(0, ("rdpRRRegisterSize:"));
return TRUE;
}
/******************************************************************************/
Bool
rdpRRSetConfig(ScreenPtr pScreen, Rotation rotateKind, int rate,
RRScreenSizePtr pSize)
{
LLOGLN(0, ("rdpRRSetConfig:"));
return TRUE;
}
/******************************************************************************/
Bool
rdpRRGetInfo(ScreenPtr pScreen, Rotation *pRotations)
{
LLOGLN(0, ("rdpRRGetInfo:"));
return TRUE;
}
/******************************************************************************/
Bool
rdpRRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
CARD32 mmWidth, CARD32 mmHeight)
{
LLOGLN(0, ("rdpRRScreenSetSize:"));
return TRUE;
}
/******************************************************************************/
Bool
rdpRRCrtcSet(ScreenPtr pScreen, RRCrtcPtr crtc, RRModePtr mode,
int x, int y, Rotation rotation, int numOutputs,
RROutputPtr *outputs)
{
LLOGLN(0, ("rdpRRCrtcSet:"));
return TRUE;
}
/******************************************************************************/
Bool
rdpRRCrtcSetGamma(ScreenPtr pScreen, RRCrtcPtr crtc)
{
LLOGLN(0, ("rdpRRCrtcSetGamma:"));
return TRUE;
}
/******************************************************************************/
Bool
rdpRRCrtcGetGamma(ScreenPtr pScreen, RRCrtcPtr crtc)
{
LLOGLN(0, ("rdpRRCrtcGetGamma:"));
return TRUE;
}
/******************************************************************************/
Bool
rdpRROutputSetProperty(ScreenPtr pScreen, RROutputPtr output, Atom property,
RRPropertyValuePtr value)
{
LLOGLN(0, ("rdpRROutputSetProperty:"));
return TRUE;
}
/******************************************************************************/
Bool
rdpRROutputValidateMode(ScreenPtr pScreen, RROutputPtr output,
RRModePtr mode)
{
LLOGLN(0, ("rdpRROutputValidateMode:"));
return TRUE;
}
/******************************************************************************/
void
rdpRRModeDestroy(ScreenPtr pScreen, RRModePtr mode)
{
LLOGLN(0, ("rdpRRModeDestroy:"));
}
/******************************************************************************/
Bool
rdpRROutputGetProperty(ScreenPtr pScreen, RROutputPtr output, Atom property)
{
LLOGLN(0, ("rdpRROutputGetProperty:"));
return TRUE;
}
/******************************************************************************/
Bool
rdpRRGetPanning(ScreenPtr pScrn, RRCrtcPtr crtc, BoxPtr totalArea,
BoxPtr trackingArea, INT16 *border)
{
LLOGLN(0, ("rdpRRGetPanning:"));
return TRUE;
}
/******************************************************************************/
Bool
rdpRRSetPanning(ScreenPtr pScrn, RRCrtcPtr crtc, BoxPtr totalArea,
BoxPtr trackingArea, INT16 *border)
{
LLOGLN(0, ("rdpRRSetPanning:"));
return TRUE;
}

View File

@ -0,0 +1,60 @@
/*
Copyright 2011-2013 Jay Sorg
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice 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
OPEN GROUP 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.
*/
#ifndef _RDPRANDR_H
#define _RDPRANDR_H
Bool
rdpRRRegisterSize(ScreenPtr pScreen, int width, int height);
Bool
rdpRRGetInfo(ScreenPtr pScreen, Rotation* pRotations);
Bool
rdpRRSetConfig(ScreenPtr pScreen, Rotation rotateKind, int rate,
RRScreenSizePtr pSize);
Bool
rdpRRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
CARD32 mmWidth, CARD32 mmHeight);
Bool
rdpRRCrtcSet(ScreenPtr pScreen, RRCrtcPtr crtc, RRModePtr mode,
int x, int y, Rotation rotation, int numOutputs,
RROutputPtr* outputs);
Bool
rdpRRCrtcSetGamma(ScreenPtr pScreen, RRCrtcPtr crtc);
Bool
rdpRRCrtcGetGamma(ScreenPtr pScreen, RRCrtcPtr crtc);
Bool
rdpRROutputSetProperty(ScreenPtr pScreen, RROutputPtr output, Atom property,
RRPropertyValuePtr value);
Bool
rdpRROutputValidateMode(ScreenPtr pScreen, RROutputPtr output,
RRModePtr mode);
void
rdpRRModeDestroy(ScreenPtr pScreen, RRModePtr mode);
Bool
rdpRROutputGetProperty(ScreenPtr pScreen, RROutputPtr output, Atom property);
Bool
rdpRRGetPanning(ScreenPtr pScrn, RRCrtcPtr crtc, BoxPtr totalArea,
BoxPtr trackingArea, INT16* border);
Bool
rdpRRSetPanning(ScreenPtr pScrn, RRCrtcPtr crtc, BoxPtr totalArea,
BoxPtr trackingArea, INT16* border);
#endif

View File

@ -36,12 +36,14 @@ This is the main driver file
#include <fb.h> #include <fb.h>
#include <micmap.h> #include <micmap.h>
#include <mi.h> #include <mi.h>
#include <randrstr.h>
#include "rdp.h" #include "rdp.h"
#include "rdpPri.h" #include "rdpPri.h"
#include "rdpDraw.h" #include "rdpDraw.h"
#include "rdpGC.h" #include "rdpGC.h"
#include "rdpCursor.h" #include "rdpCursor.h"
#include "rdpRandR.h"
#define XRDP_DRIVER_NAME "XRDPDEV" #define XRDP_DRIVER_NAME "XRDPDEV"
#define XRDP_NAME "XRDPDEV" #define XRDP_NAME "XRDPDEV"
@ -74,6 +76,7 @@ int g_blueOffset = 0;
int g_blueBits = 8; int g_blueBits = 8;
static int g_setup_done = 0; static int g_setup_done = 0;
static OsTimerPtr g_timer = 0;
/* Supported "chipsets" */ /* Supported "chipsets" */
static SymTabRec g_Chipsets[] = static SymTabRec g_Chipsets[] =
@ -276,6 +279,55 @@ rdpSaveScreen(ScreenPtr pScreen, int on)
return 1; return 1;
} }
/******************************************************************************/
static CARD32
rdpDeferredRandR(OsTimerPtr timer, CARD32 now, pointer arg)
{
ScreenPtr pScreen;
rrScrPrivPtr pRRScrPriv;
ScrnInfoPtr pScrn;
rdpPtr dev;
pScreen = (ScreenPtr) arg;
pScrn = xf86Screens[pScreen->myNum];
dev = XRDPPTR(pScrn);
LLOGLN(10, ("rdpDeferredRandR:"));
pRRScrPriv = rrGetScrPriv(pScreen);
if (pRRScrPriv == 0)
{
LLOGLN(0, ("rdpDeferredRandR: rrGetScrPriv failed"));
return 1;
}
dev->rrSetConfig = pRRScrPriv->rrSetConfig;
dev->rrGetInfo = pRRScrPriv->rrGetInfo;
dev->rrScreenSetSize = pRRScrPriv->rrScreenSetSize;
dev->rrCrtcSet = pRRScrPriv->rrCrtcSet;
dev->rrCrtcSetGamma = pRRScrPriv->rrCrtcSetGamma;
dev->rrCrtcGetGamma = pRRScrPriv->rrCrtcGetGamma;
dev->rrOutputSetProperty = pRRScrPriv->rrOutputSetProperty;
dev->rrOutputValidateMode = pRRScrPriv->rrOutputValidateMode;
dev->rrModeDestroy = pRRScrPriv->rrModeDestroy;
dev->rrOutputGetProperty = pRRScrPriv->rrOutputGetProperty;
dev->rrGetPanning = pRRScrPriv->rrGetPanning;
dev->rrSetPanning = pRRScrPriv->rrSetPanning;
pRRScrPriv->rrSetConfig = rdpRRSetConfig;
pRRScrPriv->rrGetInfo = rdpRRGetInfo;
pRRScrPriv->rrScreenSetSize = rdpRRScreenSetSize;
pRRScrPriv->rrCrtcSet = rdpRRCrtcSet;
pRRScrPriv->rrCrtcSetGamma = rdpRRCrtcSetGamma;
pRRScrPriv->rrCrtcGetGamma = rdpRRCrtcGetGamma;
pRRScrPriv->rrOutputSetProperty = rdpRROutputSetProperty;
pRRScrPriv->rrOutputValidateMode = rdpRROutputValidateMode;
pRRScrPriv->rrModeDestroy = rdpRRModeDestroy;
pRRScrPriv->rrOutputGetProperty = rdpRROutputGetProperty;
pRRScrPriv->rrGetPanning = rdpRRGetPanning;
pRRScrPriv->rrSetPanning = rdpRRSetPanning;
return 0;
}
/*****************************************************************************/ /*****************************************************************************/
static Bool static Bool
rdpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) rdpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
@ -382,6 +434,8 @@ rdpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
dev->ModifyPixmapHeader = pScreen->ModifyPixmapHeader; dev->ModifyPixmapHeader = pScreen->ModifyPixmapHeader;
pScreen->ModifyPixmapHeader = rdpModifyPixmapHeader; pScreen->ModifyPixmapHeader = rdpModifyPixmapHeader;
g_timer = TimerSet(g_timer, 0, 10, rdpDeferredRandR, pScreen);
LLOGLN(0, ("rdpScreenInit: out")); LLOGLN(0, ("rdpScreenInit: out"));
return 1; return 1;
} }