[PATCH 1/2] glamor: Restore ScreenRec hooks during CloseScreen
Alex Deucher
alexdeucher at gmail.com
Wed Nov 11 05:31:15 PST 2015
On Tue, Nov 10, 2015 at 3:41 AM, Michel Dänzer <michel at daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
For the series:
Reviewed-by: <alexander.deucher at amd.com>
> ---
> src/radeon.h | 12 ++++++++----
> src/radeon_glamor.c | 20 ++++++++++++++++++++
> src/radeon_glamor.h | 2 ++
> src/radeon_glamor_wrappers.c | 5 -----
> src/radeon_kms.c | 2 ++
> 5 files changed, 32 insertions(+), 9 deletions(-)
>
> diff --git a/src/radeon.h b/src/radeon.h
> index e2fd41c..0ee6adc 100644
> --- a/src/radeon.h
> +++ b/src/radeon.h
> @@ -157,6 +157,10 @@ typedef enum {
> } RADEONOpts;
>
>
> +#if XF86_CRTC_VERSION >= 5
> +#define RADEON_PIXMAP_SHARING 1
> +#endif
> +
> #define RADEON_VSYNC_TIMEOUT 20000 /* Maximum wait for VSYNC (in usecs) */
>
> /* Buffer are aligned on 4096 byte boundaries */
> @@ -561,6 +565,10 @@ typedef struct {
> AddTrapsProcPtr SavedAddTraps;
> UnrealizeGlyphProcPtr SavedUnrealizeGlyph;
> #endif
> +#ifdef RADEON_PIXMAP_SHARING
> + SharePixmapBackingProcPtr SavedSharePixmapBacking;
> + SetSharedPixmapBackingProcPtr SavedSetSharedPixmapBacking;
> +#endif
> } glamor;
> #endif /* USE_GLAMOR */
> } RADEONInfoRec, *RADEONInfoPtr;
> @@ -623,10 +631,6 @@ extern RADEONEntPtr RADEONEntPriv(ScrnInfoPtr pScrn);
>
> drmVBlankSeqType radeon_populate_vbl_request_type(xf86CrtcPtr crtc);
>
> -#if XF86_CRTC_VERSION >= 5
> -#define RADEON_PIXMAP_SHARING 1
> -#endif
> -
> static inline struct radeon_surface *radeon_get_pixmap_surface(PixmapPtr pPix)
> {
> #ifdef USE_GLAMOR
> diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
> index fdd5aea..8fb3a1e 100644
> --- a/src/radeon_glamor.c
> +++ b/src/radeon_glamor.c
> @@ -368,10 +368,14 @@ radeon_glamor_init(ScreenPtr screen)
> ps->UnrealizeGlyph = SavedUnrealizeGlyph;
> #endif
>
> + info->glamor.SavedCreatePixmap = screen->CreatePixmap;
> screen->CreatePixmap = radeon_glamor_create_pixmap;
> + info->glamor.SavedDestroyPixmap = screen->DestroyPixmap;
> screen->DestroyPixmap = radeon_glamor_destroy_pixmap;
> #ifdef RADEON_PIXMAP_SHARING
> + info->glamor.SavedSharePixmapBacking = screen->SharePixmapBacking;
> screen->SharePixmapBacking = radeon_glamor_share_pixmap_backing;
> + info->glamor.SavedSetSharedPixmapBacking = screen->SetSharedPixmapBacking;
> screen->SetSharedPixmapBacking = radeon_glamor_set_shared_pixmap_backing;
> #endif
>
> @@ -380,6 +384,22 @@ radeon_glamor_init(ScreenPtr screen)
> return TRUE;
> }
>
> +void
> +radeon_glamor_fini(ScreenPtr screen)
> +{
> + RADEONInfoPtr info = RADEONPTR(xf86ScreenToScrn(screen));
> +
> + if (!info->use_glamor)
> + return;
> +
> + screen->CreatePixmap = info->glamor.SavedCreatePixmap;
> + screen->DestroyPixmap = info->glamor.SavedDestroyPixmap;
> +#ifdef RADEON_PIXMAP_SHARING
> + screen->SharePixmapBacking = info->glamor.SavedSharePixmapBacking;
> + screen->SetSharedPixmapBacking = info->glamor.SavedSetSharedPixmapBacking;
> +#endif
> +}
> +
> XF86VideoAdaptorPtr radeon_glamor_xv_init(ScreenPtr pScreen, int num_adapt)
> {
> return glamor_xv_init(pScreen, num_adapt);
> diff --git a/src/radeon_glamor.h b/src/radeon_glamor.h
> index 246336b..75129f8 100644
> --- a/src/radeon_glamor.h
> +++ b/src/radeon_glamor.h
> @@ -64,6 +64,7 @@ struct radeon_pixmap;
>
> Bool radeon_glamor_pre_init(ScrnInfoPtr scrn);
> Bool radeon_glamor_init(ScreenPtr screen);
> +void radeon_glamor_fini(ScreenPtr screen);
> void radeon_glamor_screen_init(ScreenPtr screen);
> Bool radeon_glamor_create_screen_resources(ScreenPtr screen);
> void radeon_glamor_free_screen(int scrnIndex, int flags);
> @@ -77,6 +78,7 @@ XF86VideoAdaptorPtr radeon_glamor_xv_init(ScreenPtr pScreen, int num_adapt);
>
> static inline Bool radeon_glamor_pre_init(ScrnInfoPtr scrn) { return FALSE; }
> static inline Bool radeon_glamor_init(ScreenPtr screen) { return FALSE; }
> +static inline void radeon_glamor_fini(ScreenPtr screen) { }
> static inline Bool radeon_glamor_create_screen_resources(ScreenPtr screen) { return FALSE; }
> static inline void radeon_glamor_free_screen(int scrnIndex, int flags) { }
>
> diff --git a/src/radeon_glamor_wrappers.c b/src/radeon_glamor_wrappers.c
> index ec81560..cd02b06 100644
> --- a/src/radeon_glamor_wrappers.c
> +++ b/src/radeon_glamor_wrappers.c
> @@ -917,8 +917,6 @@ radeon_glamor_close_screen(CLOSE_SCREEN_ARGS_DECL)
> pScreen->CloseScreen = info->glamor.SavedCloseScreen;
> pScreen->GetImage = info->glamor.SavedGetImage;
> pScreen->GetSpans = info->glamor.SavedGetSpans;
> - pScreen->CreatePixmap = info->glamor.SavedCreatePixmap;
> - pScreen->DestroyPixmap = info->glamor.SavedDestroyPixmap;
> pScreen->CopyWindow = info->glamor.SavedCopyWindow;
> pScreen->ChangeWindowAttributes =
> info->glamor.SavedChangeWindowAttributes;
> @@ -962,9 +960,6 @@ radeon_glamor_screen_init(ScreenPtr screen)
> info->glamor.SavedGetSpans = screen->GetSpans;
> screen->GetSpans = radeon_glamor_get_spans;
>
> - info->glamor.SavedCreatePixmap = screen->CreatePixmap;
> - info->glamor.SavedDestroyPixmap = screen->DestroyPixmap;
> -
> info->glamor.SavedCopyWindow = screen->CopyWindow;
> screen->CopyWindow = radeon_glamor_copy_window;
>
> diff --git a/src/radeon_kms.c b/src/radeon_kms.c
> index 8aa7633..49b922d 100644
> --- a/src/radeon_kms.c
> +++ b/src/radeon_kms.c
> @@ -1490,6 +1490,8 @@ static Bool RADEONCloseScreen_KMS(CLOSE_SCREEN_ARGS_DECL)
> if (info->dri2.enabled)
> radeon_dri2_close_screen(pScreen);
>
> + radeon_glamor_fini(pScreen);
> +
> pScrn->vtSema = FALSE;
> xf86ClearPrimInitDone(info->pEnt->index);
> pScreen->BlockHandler = info->BlockHandler;
> --
> 2.6.2
>
> _______________________________________________
> xorg-driver-ati mailing list
> xorg-driver-ati at lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
More information about the xorg-driver-ati
mailing list