sna: Wrap direct access to ScrnInfoPtr->pScreen
Admittedly ScrnInfoPtr->pScreen has nearly always existed, but for completeness wrap it up in a compat macro. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
3cfde9f043
commit
b7feeca073
|
|
@ -39,7 +39,13 @@
|
|||
|
||||
#ifndef XF86_HAS_SCRN_CONV
|
||||
#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
|
||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,1,0,0,0)
|
||||
#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
|
||||
#else
|
||||
#define xf86ScrnToScreen(s) ((s)->pScreen)
|
||||
#endif
|
||||
#else
|
||||
#define xf86ScrnToScreen(s) ((s)->pScreen)
|
||||
#endif
|
||||
|
||||
#ifndef XF86_SCRN_INTERFACE
|
||||
|
|
|
|||
|
|
@ -462,6 +462,11 @@ to_sna_from_screen(ScreenPtr screen)
|
|||
return to_sna(xf86ScreenToScrn(screen));
|
||||
}
|
||||
|
||||
pure static inline ScreenPtr to_screen_from_sna(struct sna *sna)
|
||||
{
|
||||
return xf86ScrnToScreen(sna->scrn);
|
||||
}
|
||||
|
||||
pure static inline struct sna *
|
||||
to_sna_from_pixmap(PixmapPtr pixmap)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1420,7 +1420,7 @@ static void __sna_free_pixmap(struct sna *sna,
|
|||
sna_accel_watch_flush(sna, -1);
|
||||
|
||||
if (priv->header) {
|
||||
assert(pixmap->drawable.pScreen == sna->scrn->pScreen);
|
||||
assert(pixmap->drawable.pScreen == to_screen_from_sna(sna));
|
||||
assert(!priv->shm);
|
||||
pixmap->devPrivate.ptr = sna->freed_pixmap;
|
||||
sna->freed_pixmap = pixmap;
|
||||
|
|
@ -17247,7 +17247,7 @@ static void sna_accel_disarm_timer(struct sna *sna, int id)
|
|||
static bool has_offload_slaves(struct sna *sna)
|
||||
{
|
||||
#if HAS_PIXMAP_SHARING
|
||||
ScreenPtr screen = sna->scrn->pScreen;
|
||||
ScreenPtr screen = to_screen_from_sna(sna);
|
||||
PixmapDirtyUpdatePtr dirty;
|
||||
|
||||
xorg_list_for_each_entry(dirty, &screen->pixmap_dirty_list, ent) {
|
||||
|
|
@ -17395,7 +17395,7 @@ static bool sna_accel_do_expire(struct sna *sna)
|
|||
static void sna_accel_post_damage(struct sna *sna)
|
||||
{
|
||||
#if HAS_PIXMAP_SHARING
|
||||
ScreenPtr screen = sna->scrn->pScreen;
|
||||
ScreenPtr screen = to_screen_from_sna(sna);
|
||||
PixmapDirtyUpdatePtr dirty;
|
||||
bool flush = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -1378,7 +1378,7 @@ bool sna_pixmap_discard_shadow_damage(struct sna_pixmap *priv,
|
|||
|
||||
static bool sna_mode_enable_shadow(struct sna *sna)
|
||||
{
|
||||
ScreenPtr screen = sna->scrn->pScreen;
|
||||
ScreenPtr screen = to_screen_from_sna(sna);
|
||||
|
||||
DBG(("%s\n", __FUNCTION__));
|
||||
assert(sna->mode.shadow == NULL);
|
||||
|
|
@ -1465,7 +1465,8 @@ static bool sna_crtc_enable_shadow(struct sna *sna, struct sna_crtc *crtc)
|
|||
__FUNCTION__, crtc->id, crtc->pipe, crtc->slave_pixmap->drawable.serialNumber));
|
||||
crtc->slave_damage = DamageCreate(sna_crtc_slave_damage, NULL,
|
||||
DamageReportRawRegion, TRUE,
|
||||
sna->scrn->pScreen, crtc);
|
||||
to_screen_from_sna(sna),
|
||||
crtc);
|
||||
if (crtc->slave_damage == NULL) {
|
||||
if (!--sna->mode.shadow_active)
|
||||
sna_mode_disable_shadow(sna);
|
||||
|
|
@ -1746,7 +1747,7 @@ void sna_copy_fbcon(struct sna *sna)
|
|||
kgem_bo_destroy(&sna->kgem, bo);
|
||||
|
||||
#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(10, 0)
|
||||
sna->scrn->pScreen->canDoBGNoneRoot = ok;
|
||||
to_screen_from_sna(sna)->canDoBGNoneRoot = ok;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -2221,7 +2222,7 @@ static void sna_crtc_randr(xf86CrtcPtr crtc)
|
|||
static void
|
||||
sna_crtc_damage(xf86CrtcPtr crtc)
|
||||
{
|
||||
ScreenPtr screen = crtc->scrn->pScreen;
|
||||
ScreenPtr screen = xf86ScrnToScreen(crtc->scrn);
|
||||
struct sna *sna = to_sna(crtc->scrn);
|
||||
RegionRec region, *damage;
|
||||
|
||||
|
|
@ -4347,7 +4348,7 @@ sna_mode_resize(ScrnInfoPtr scrn, int width, int height)
|
|||
{
|
||||
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
|
||||
struct sna *sna = to_sna(scrn);
|
||||
ScreenPtr screen = scrn->pScreen;
|
||||
ScreenPtr screen = xf86ScrnToScreen(scrn);
|
||||
PixmapPtr new_front;
|
||||
int i;
|
||||
|
||||
|
|
@ -6698,7 +6699,7 @@ sna_crtc_redisplay__fallback(xf86CrtcPtr crtc, RegionPtr region, struct kgem_bo
|
|||
{
|
||||
int16_t sx, sy;
|
||||
struct sna *sna = to_sna(crtc->scrn);
|
||||
ScreenPtr screen = sna->scrn->pScreen;
|
||||
ScreenPtr screen = xf86ScrnToScreen(crtc->scrn);
|
||||
DrawablePtr draw = crtc_source(crtc, &sx, &sy);
|
||||
PictFormatPtr format;
|
||||
PictTransform T;
|
||||
|
|
@ -6796,7 +6797,7 @@ sna_crtc_redisplay__composite(xf86CrtcPtr crtc, RegionPtr region, struct kgem_bo
|
|||
{
|
||||
int16_t sx, sy;
|
||||
struct sna *sna = to_sna(crtc->scrn);
|
||||
ScreenPtr screen = crtc->scrn->pScreen;
|
||||
ScreenPtr screen = xf86ScrnToScreen(crtc->scrn);
|
||||
DrawablePtr draw = crtc_source(crtc, &sx, &sy);
|
||||
struct sna_composite_op tmp;
|
||||
PictFormatPtr format;
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ static const xf86OutputFuncsRec sna_output_funcs = {
|
|||
static Bool
|
||||
sna_mode_resize(ScrnInfoPtr scrn, int width, int height)
|
||||
{
|
||||
ScreenPtr screen = scrn->pScreen;
|
||||
ScreenPtr screen = xf86ScrnToScreen(scrn);
|
||||
PixmapPtr new_front;
|
||||
|
||||
DBG(("%s (%d, %d) -> (%d, %d)\n", __FUNCTION__,
|
||||
|
|
|
|||
|
|
@ -185,8 +185,8 @@ sna_set_fallback_mode(ScrnInfoPtr scrn)
|
|||
|
||||
xf86DisableUnusedFunctions(scrn);
|
||||
#ifdef RANDR_12_INTERFACE
|
||||
if (get_root_window(scrn->pScreen))
|
||||
xf86RandR12TellChanged(scrn->pScreen);
|
||||
if (get_root_window(xf86ScrnToScreen(scrn)))
|
||||
xf86RandR12TellChanged(xf86ScrnToScreen(scrn));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -222,7 +222,7 @@ static Bool sna_create_screen_resources(ScreenPtr screen)
|
|||
screen->width, screen->height, screen->rootDepth));
|
||||
|
||||
assert(sna->scrn == xf86ScreenToScrn(screen));
|
||||
assert(sna->scrn->pScreen == screen);
|
||||
assert(to_screen_from_sna(sna) == screen);
|
||||
|
||||
/* free the data used during miInitScreen */
|
||||
free(screen->devPrivate);
|
||||
|
|
@ -1137,7 +1137,7 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL)
|
|||
DBG(("%s\n", __FUNCTION__));
|
||||
|
||||
assert(sna->scrn == scrn);
|
||||
assert(scrn->pScreen == NULL); /* set afterwards */
|
||||
assert(to_screen_from_sna(sna) == NULL); /* set afterwards */
|
||||
|
||||
assert(sna->freed_pixmap == NULL);
|
||||
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ void sna_glyphs_close(struct sna *sna)
|
|||
*/
|
||||
bool sna_glyphs_create(struct sna *sna)
|
||||
{
|
||||
ScreenPtr screen = sna->scrn->pScreen;
|
||||
ScreenPtr screen = to_screen_from_sna(sna);
|
||||
pixman_color_t white = { 0xffff, 0xffff, 0xffff, 0xffff };
|
||||
unsigned int formats[] = {
|
||||
PIXMAN_a8,
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ static int sna_video_overlay_stop(ddStopVideo_ARGS)
|
|||
|
||||
DBG(("%s()\n", __FUNCTION__));
|
||||
|
||||
REGION_EMPTY(scrn->pScreen, &video->clip);
|
||||
REGION_EMPTY(to_screen_from_sna(sna), &video->clip);
|
||||
|
||||
request.flags = 0;
|
||||
(void)drmIoctl(sna->kgem.fd,
|
||||
|
|
|
|||
Loading…
Reference in New Issue