mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-09 23:22:22 +00:00
parent
9f47780ecd
commit
9e8c20b0d4
11 changed files with 20 additions and 355 deletions
|
|
@ -82,17 +82,6 @@ xf86CrtcSetSizeRange (ScrnInfoPtr scrn,
|
|||
config->maxHeight = maxHeight;
|
||||
}
|
||||
|
||||
void
|
||||
xf86CrtcSetScanoutFormats(ScrnInfoPtr scrn,
|
||||
int num_formats,
|
||||
xf86CrtcScanoutFormat *formats)
|
||||
{
|
||||
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
|
||||
|
||||
config->num_scanout_formats = num_formats;
|
||||
config->scanout_formats = formats;
|
||||
}
|
||||
|
||||
/*
|
||||
* Crtc functions
|
||||
*/
|
||||
|
|
@ -276,7 +265,6 @@ xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set)
|
|||
Rotation saved_rotation;
|
||||
RRTransformRec saved_transform;
|
||||
Bool saved_transform_present;
|
||||
PixmapPtr saved_scanout_pixmap;
|
||||
|
||||
crtc->enabled = xf86CrtcInUse (crtc);
|
||||
|
||||
|
|
@ -296,7 +284,6 @@ xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set)
|
|||
saved_x = crtc->x;
|
||||
saved_y = crtc->y;
|
||||
saved_rotation = crtc->rotation;
|
||||
saved_scanout_pixmap = crtc->scanoutPixmap;
|
||||
if (crtc->transformPresent) {
|
||||
RRTransformInit (&saved_transform);
|
||||
RRTransformCopy (&saved_transform, &crtc->transform);
|
||||
|
|
@ -314,8 +301,6 @@ xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set)
|
|||
}
|
||||
if (set->flags & XF86CrtcSetRotation)
|
||||
crtc->rotation = set->rotation;
|
||||
if (set->flags & XF86CrtcSetScanoutPixmap)
|
||||
crtc->scanoutPixmap = set->scanout_pixmap;
|
||||
|
||||
if (set->flags & XF86CrtcSetTransform) {
|
||||
if (set->transform) {
|
||||
|
|
@ -414,10 +399,6 @@ done:
|
|||
crtc->active = TRUE;
|
||||
if (scrn->pScreen)
|
||||
xf86CrtcSetScreenSubpixelOrder (scrn->pScreen);
|
||||
if (crtc->scanoutPixmap)
|
||||
++crtc->scanoutPixmap->refcnt;
|
||||
if (saved_scanout_pixmap)
|
||||
(*scrn->pScreen->DestroyPixmap)(saved_scanout_pixmap);
|
||||
if (scrn->ModeSet)
|
||||
scrn->ModeSet(scrn);
|
||||
} else {
|
||||
|
|
@ -428,7 +409,6 @@ done:
|
|||
if (saved_transform_present)
|
||||
RRTransformCopy (&crtc->transform, &saved_transform);
|
||||
crtc->transformPresent = saved_transform_present;
|
||||
crtc->scanoutPixmap = saved_scanout_pixmap;
|
||||
}
|
||||
|
||||
if (adjusted_mode) {
|
||||
|
|
|
|||
|
|
@ -79,7 +79,6 @@ typedef enum _xf86CrtcSetFlags {
|
|||
XF86CrtcSetTransform = 8, /* transform */
|
||||
XF86CrtcSetRotation = 16, /* rotation */
|
||||
XF86CrtcSetProperty = 32, /* output property */
|
||||
XF86CrtcSetScanoutPixmap = 64, /* scanout pixmap */
|
||||
} xf86CrtcSetFlags;
|
||||
|
||||
typedef struct _xf86CrtcSet {
|
||||
|
|
@ -88,7 +87,6 @@ typedef struct _xf86CrtcSet {
|
|||
Rotation rotation;
|
||||
RRTransformPtr transform;
|
||||
int x, y;
|
||||
PixmapPtr scanout_pixmap;
|
||||
} xf86CrtcSetRec;
|
||||
|
||||
typedef struct _xf86CrtcFuncs {
|
||||
|
|
@ -279,7 +277,6 @@ struct _xf86Crtc {
|
|||
Rotation rotation;
|
||||
PixmapPtr rotatedPixmap;
|
||||
void *rotatedData;
|
||||
PixmapPtr scanoutPixmap;
|
||||
|
||||
/**
|
||||
* Position on screen
|
||||
|
|
@ -673,14 +670,6 @@ typedef struct _xf86CrtcSetConfig {
|
|||
int pixmap_x, pixmap_y;
|
||||
} xf86CrtcSetConfigRec, *xf86CrtcSetConfigPtr;
|
||||
|
||||
typedef struct _xf86CrtcScanoutFormat {
|
||||
int depth;
|
||||
int bitsPerPixel;
|
||||
int maxWidth, maxHeight;
|
||||
Rotation rotations;
|
||||
PictFormatShort format;
|
||||
} xf86CrtcScanoutFormat;
|
||||
|
||||
typedef struct _xf86CrtcConfigFuncs {
|
||||
/**
|
||||
* Requests that the driver resize the screen.
|
||||
|
|
@ -704,17 +693,6 @@ typedef struct _xf86CrtcConfigFuncs {
|
|||
RRScreenConfigPtr screen_config,
|
||||
xf86CrtcSetConfigPtr crtc_configs,
|
||||
int num_configs);
|
||||
|
||||
/**
|
||||
* Create a scanout pixmap
|
||||
*/
|
||||
PixmapPtr
|
||||
(*create_scanout_pixmap)(ScrnInfoPtr scrn,
|
||||
int width,
|
||||
int height,
|
||||
Rotation rotations,
|
||||
xf86CrtcScanoutFormat *format);
|
||||
|
||||
} xf86CrtcConfigFuncsRec, *xf86CrtcConfigFuncsPtr;
|
||||
|
||||
typedef void (*xf86_crtc_notify_proc_ptr) (ScreenPtr pScreen);
|
||||
|
|
@ -774,11 +752,6 @@ typedef struct _xf86CrtcConfig {
|
|||
/* callback when crtc configuration changes */
|
||||
xf86_crtc_notify_proc_ptr xf86_crtc_notify;
|
||||
|
||||
/*
|
||||
* Supported scanout pixmap formats
|
||||
*/
|
||||
int num_scanout_formats;
|
||||
xf86CrtcScanoutFormat *scanout_formats;
|
||||
} xf86CrtcConfigRec, *xf86CrtcConfigPtr;
|
||||
|
||||
extern _X_EXPORT int xf86CrtcConfigPrivateIndex;
|
||||
|
|
@ -824,11 +797,6 @@ xf86CrtcSetSizeRange (ScrnInfoPtr scrn,
|
|||
int minWidth, int minHeight,
|
||||
int maxWidth, int maxHeight);
|
||||
|
||||
extern _X_EXPORT void
|
||||
xf86CrtcSetScanoutFormats (ScrnInfoPtr scrn,
|
||||
int num_formats,
|
||||
xf86CrtcScanoutFormat *formats);
|
||||
|
||||
/*
|
||||
* Crtc functions
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1083,7 +1083,7 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc)
|
|||
ret = RRCrtcNotify (randr_crtc, randr_mode, x, y,
|
||||
rotation,
|
||||
crtc->transformPresent ? &crtc->transform : NULL,
|
||||
numOutputs, randr_outputs, crtc->scanoutPixmap);
|
||||
numOutputs, randr_outputs);
|
||||
free(randr_outputs);
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -1126,8 +1126,7 @@ xf86RandR12CrtcSet (ScreenPtr pScreen,
|
|||
int y,
|
||||
Rotation rotation,
|
||||
int num_randr_outputs,
|
||||
RROutputPtr *randr_outputs,
|
||||
PixmapPtr scanout_pixmap)
|
||||
RROutputPtr *randr_outputs)
|
||||
{
|
||||
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||
|
|
@ -1158,9 +1157,6 @@ xf86RandR12CrtcSet (ScreenPtr pScreen,
|
|||
sizeof (transform->transform)) != 0)
|
||||
flags |= XF86CrtcSetTransform;
|
||||
|
||||
if (scanout_pixmap != crtc->scanoutPixmap)
|
||||
flags |= XF86CrtcSetScanoutPixmap;
|
||||
|
||||
if (x != crtc->x || y != crtc->y)
|
||||
flags |= XF86CrtcSetOrigin;
|
||||
for (o = 0; o < config->num_output; o++)
|
||||
|
|
@ -1207,7 +1203,6 @@ xf86RandR12CrtcSet (ScreenPtr pScreen,
|
|||
set.transform = transform;
|
||||
set.x = x;
|
||||
set.y = y;
|
||||
set.scanout_pixmap = scanout_pixmap;
|
||||
set.flags = flags;
|
||||
if (!xf86CrtcSet(crtc, &set))
|
||||
{
|
||||
|
|
@ -1737,54 +1732,6 @@ xf86RandR12ChangeGamma(int scrnIndex, Gamma gamma)
|
|||
return Success;
|
||||
}
|
||||
|
||||
static RRScanoutPixmapInfo *
|
||||
xf86RRQueryScanoutPixmaps(ScreenPtr screen, int *n_info)
|
||||
{
|
||||
ScrnInfoPtr scrn = xf86Screens[screen->myNum];
|
||||
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
|
||||
RRScanoutPixmapInfo *info;
|
||||
int f;
|
||||
|
||||
info = calloc(config->num_scanout_formats, sizeof (RRScanoutPixmapInfo));
|
||||
if (config->num_scanout_formats && !info) {
|
||||
*n_info = 0;
|
||||
return NULL;
|
||||
}
|
||||
for (f = 0; f < config->num_scanout_formats; f++) {
|
||||
info[f].maxWidth = config->scanout_formats[f].maxWidth;
|
||||
info[f].maxHeight = config->scanout_formats[f].maxHeight;
|
||||
info[f].depth = config->scanout_formats[f].depth;
|
||||
info[f].rotations = config->scanout_formats[f].rotations;
|
||||
info[f].format = PictureMatchFormat (screen, info[f].depth,
|
||||
config->scanout_formats[f].format);
|
||||
}
|
||||
*n_info = config->num_scanout_formats;
|
||||
return info;
|
||||
}
|
||||
|
||||
static PixmapPtr
|
||||
xf86RRCreateScanoutPixmap(ScreenPtr screen,
|
||||
int width, int height, int depth,
|
||||
Rotation rotations,
|
||||
PictFormatPtr format)
|
||||
{
|
||||
ScrnInfoPtr scrn = xf86Screens[screen->myNum];
|
||||
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
|
||||
int f;
|
||||
|
||||
if (!config->funcs->create_scanout_pixmap)
|
||||
return NullPixmap;
|
||||
|
||||
for (f = 0; f < config->num_scanout_formats; f++)
|
||||
if (config->scanout_formats[f].depth == depth &&
|
||||
(config->scanout_formats[f].format & 0xffffff) == format->format) {
|
||||
return (*config->funcs->create_scanout_pixmap) (scrn, width, height,
|
||||
rotations,
|
||||
&config->scanout_formats[f]);
|
||||
}
|
||||
return NullPixmap;
|
||||
}
|
||||
|
||||
static void
|
||||
xf86RandR14SetCrtcSpriteTransform(ScreenPtr pScreen,
|
||||
RRCrtcPtr randr_crtc,
|
||||
|
|
@ -1946,17 +1893,17 @@ xf86RandR12Init12 (ScreenPtr pScreen)
|
|||
rp->rrCrtcGetGamma = xf86RandR12CrtcGetGamma;
|
||||
rp->rrOutputSetProperty = xf86RandR12OutputSetProperty;
|
||||
rp->rrOutputValidateMode = xf86RandR12OutputValidateMode;
|
||||
#if RANDR_13_INTERFACE
|
||||
rp->rrOutputGetProperty = xf86RandR13OutputGetProperty;
|
||||
rp->rrGetPanning = xf86RandR13GetPanning;
|
||||
rp->rrSetPanning = xf86RandR13SetPanning;
|
||||
#endif
|
||||
rp->rrModeDestroy = xf86RandR12ModeDestroy;
|
||||
rp->rrSetConfig = NULL;
|
||||
pScrn->PointerMoved = xf86RandR12PointerMoved;
|
||||
pScrn->ChangeGamma = xf86RandR12ChangeGamma;
|
||||
rp->rrSetCrtcSpriteTransform = xf86RandR14SetCrtcSpriteTransform;
|
||||
rp->rrSetCrtcConfigs = xf86RRSetCrtcConfigs;
|
||||
rp->rrQueryScanoutPixmaps = xf86RRQueryScanoutPixmaps;
|
||||
rp->rrCreateScanoutPixmap = xf86RRCreateScanoutPixmap;
|
||||
|
||||
randrp->orig_EnterVT = pScrn->EnterVT;
|
||||
pScrn->EnterVT = xf86RandR12EnterVT;
|
||||
|
|
|
|||
Loading…
Reference in a new issue