mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-25 12:49:21 +00:00
xfree86: drivers: dummy: copy over xf86-video-dummy tree
Since this driver doesn't receive much functional changes, except fixups for server ABI changes, it's a good candidate to move it back into the main Xserver tree. As the first step to move back this driver into the Xserver tree, copy over the source from last release tag. Skipped files we don't need here (eg. gitlab pipeline, automake files, ...) repo: git@github.com:X11Libre/xf86-video-dummy.git git tag: xlibre-xf86-video-dummy-0.4.1.1 Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
2
hw/xfree86/drivers/video/dummy/COPYING
Normal file
2
hw/xfree86/drivers/video/dummy/COPYING
Normal file
@@ -0,0 +1,2 @@
|
||||
Copyright 2002, SuSE Linux AG, Author: Egbert Eich
|
||||
|
||||
18
hw/xfree86/drivers/video/dummy/README.md
Normal file
18
hw/xfree86/drivers/video/dummy/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
xf86-video-dummy - virtual/offscreen frame buffer driver for the Xorg X server
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
All questions regarding this software should be directed at the
|
||||
Xorg mailing list:
|
||||
|
||||
https://lists.x.org/mailman/listinfo/xorg
|
||||
|
||||
The primary development code repository can be found at:
|
||||
|
||||
https://gitlab.freedesktop.org/xorg/driver/xf86-video-dummy
|
||||
|
||||
Please submit bug reports and requests to merge patches there.
|
||||
|
||||
For patch submission instructions, see:
|
||||
|
||||
https://www.x.org/wiki/Development/Documentation/SubmittingPatches
|
||||
|
||||
65
hw/xfree86/drivers/video/dummy/src/dummy.h
Normal file
65
hw/xfree86/drivers/video/dummy/src/dummy.h
Normal file
@@ -0,0 +1,65 @@
|
||||
|
||||
/* All drivers should typically include these */
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
|
||||
#include "xf86Cursor.h"
|
||||
|
||||
#ifdef XvExtension
|
||||
#include "xf86xv.h"
|
||||
#include <X11/extensions/Xv.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
|
||||
#define DUMMY_MAX_SCREENS 16
|
||||
|
||||
/* Supported chipsets */
|
||||
typedef enum {
|
||||
DUMMY_CHIP
|
||||
} DUMMYType;
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
extern Bool DUMMYSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode);
|
||||
extern void DUMMYAdjustFrame(ScrnInfoPtr pScrn, int x, int y);
|
||||
|
||||
/* in dummy_cursor.c */
|
||||
extern Bool DUMMYCursorInit(ScreenPtr pScrn);
|
||||
extern void DUMMYShowCursor(ScrnInfoPtr pScrn);
|
||||
extern void DUMMYHideCursor(ScrnInfoPtr pScrn);
|
||||
|
||||
/* globals */
|
||||
typedef struct _color
|
||||
{
|
||||
int red;
|
||||
int green;
|
||||
int blue;
|
||||
} dummy_colors;
|
||||
|
||||
typedef struct dummyRec
|
||||
{
|
||||
/* options */
|
||||
OptionInfoPtr Options;
|
||||
Bool swCursor;
|
||||
/* proc pointer */
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
xf86CursorInfoPtr CursorInfo;
|
||||
|
||||
Bool DummyHWCursorShown;
|
||||
int cursorX, cursorY;
|
||||
int cursorFG, cursorBG;
|
||||
|
||||
dummy_colors colors[1024];
|
||||
Bool (*CreateWindow)(WindowPtr) ; /* wrapped CreateWindow */
|
||||
Bool prop;
|
||||
/* XRANDR support begin */
|
||||
int num_screens;
|
||||
struct _xf86Crtc *paCrtcs[DUMMY_MAX_SCREENS];
|
||||
struct _xf86Output *paOutputs[DUMMY_MAX_SCREENS];
|
||||
int connected_outputs;
|
||||
/* XRANDR support end */
|
||||
} DUMMYRec, *DUMMYPtr;
|
||||
|
||||
/* The privates of the DUMMY driver */
|
||||
#define DUMMYPTR(p) ((DUMMYPtr)((p)->driverPrivate))
|
||||
|
||||
102
hw/xfree86/drivers/video/dummy/src/dummy_cursor.c
Normal file
102
hw/xfree86/drivers/video/dummy/src/dummy_cursor.c
Normal file
@@ -0,0 +1,102 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
/* All drivers should typically include these */
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
|
||||
#include "xf86Cursor.h"
|
||||
#include "cursorstr.h"
|
||||
/* Driver specific headers */
|
||||
#include "dummy.h"
|
||||
|
||||
static void
|
||||
dummyShowCursor(ScrnInfoPtr pScrn)
|
||||
{
|
||||
DUMMYPtr dPtr = DUMMYPTR(pScrn);
|
||||
|
||||
/* turn cursor on */
|
||||
dPtr->DummyHWCursorShown = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
dummyHideCursor(ScrnInfoPtr pScrn)
|
||||
{
|
||||
DUMMYPtr dPtr = DUMMYPTR(pScrn);
|
||||
|
||||
/*
|
||||
* turn cursor off
|
||||
*
|
||||
*/
|
||||
dPtr->DummyHWCursorShown = FALSE;
|
||||
}
|
||||
|
||||
#define MAX_CURS 64
|
||||
|
||||
static void
|
||||
dummySetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
|
||||
{
|
||||
DUMMYPtr dPtr = DUMMYPTR(pScrn);
|
||||
|
||||
dPtr->cursorX = x;
|
||||
dPtr->cursorY = y;
|
||||
}
|
||||
|
||||
static void
|
||||
dummySetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
|
||||
{
|
||||
DUMMYPtr dPtr = DUMMYPTR(pScrn);
|
||||
|
||||
dPtr->cursorFG = fg;
|
||||
dPtr->cursorBG = bg;
|
||||
}
|
||||
|
||||
static void
|
||||
dummyLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
|
||||
{
|
||||
}
|
||||
|
||||
static Bool
|
||||
dummyUseHWCursor(ScreenPtr pScr, CursorPtr pCurs)
|
||||
{
|
||||
DUMMYPtr dPtr = DUMMYPTR(xf86ScreenToScrn(pScr));
|
||||
return(!dPtr->swCursor);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static unsigned char*
|
||||
dummyRealizeCursor(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
Bool
|
||||
DUMMYCursorInit(ScreenPtr pScreen)
|
||||
{
|
||||
DUMMYPtr dPtr = DUMMYPTR(xf86ScreenToScrn(pScreen));
|
||||
|
||||
xf86CursorInfoPtr infoPtr;
|
||||
infoPtr = xf86CreateCursorInfoRec();
|
||||
if(!infoPtr) return FALSE;
|
||||
|
||||
dPtr->CursorInfo = infoPtr;
|
||||
|
||||
infoPtr->MaxHeight = 64;
|
||||
infoPtr->MaxWidth = 64;
|
||||
infoPtr->Flags = HARDWARE_CURSOR_TRUECOLOR_AT_8BPP;
|
||||
|
||||
infoPtr->SetCursorColors = dummySetCursorColors;
|
||||
infoPtr->SetCursorPosition = dummySetCursorPosition;
|
||||
infoPtr->LoadCursorImage = dummyLoadCursorImage;
|
||||
infoPtr->HideCursor = dummyHideCursor;
|
||||
infoPtr->ShowCursor = dummyShowCursor;
|
||||
infoPtr->UseHWCursor = dummyUseHWCursor;
|
||||
/* infoPtr->RealizeCursor = dummyRealizeCursor; */
|
||||
|
||||
return(xf86InitCursor(pScreen, infoPtr));
|
||||
}
|
||||
|
||||
|
||||
|
||||
1063
hw/xfree86/drivers/video/dummy/src/dummy_driver.c
Normal file
1063
hw/xfree86/drivers/video/dummy/src/dummy_driver.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user