From 4a35e2f33d9cdfb608423046391311109f96fb6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 5 Mar 2015 18:34:07 +0900 Subject: Fold radeon_glamor_flush into radeon_cs_flush_indirect Reviewed-by: Alex Deucher --- src/radeon_glamor.c | 9 --------- src/radeon_glamor.h | 4 ---- src/radeon_kms.c | 18 +++++++++++------- 3 files changed, 11 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c index 950f8916..f0996fe6 100644 --- a/src/radeon_glamor.c +++ b/src/radeon_glamor.c @@ -363,15 +363,6 @@ radeon_glamor_init(ScreenPtr screen) return TRUE; } -void -radeon_glamor_flush(ScrnInfoPtr pScrn) -{ - RADEONInfoPtr info = RADEONPTR(pScrn); - - if (info->use_glamor) - glamor_block_handler(pScrn->pScreen); -} - 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 548ea989..c402a10a 100644 --- a/src/radeon_glamor.h +++ b/src/radeon_glamor.h @@ -40,8 +40,6 @@ Bool radeon_glamor_init(ScreenPtr screen); Bool radeon_glamor_create_screen_resources(ScreenPtr screen); void radeon_glamor_free_screen(int scrnIndex, int flags); -void radeon_glamor_flush(ScrnInfoPtr pScrn); - Bool radeon_glamor_create_textured_pixmap(PixmapPtr pixmap); void radeon_glamor_exchange_buffers(PixmapPtr src, PixmapPtr dst); @@ -56,8 +54,6 @@ static inline Bool radeon_glamor_init(ScreenPtr screen) { return FALSE; } static inline Bool radeon_glamor_create_screen_resources(ScreenPtr screen) { return FALSE; } static inline void radeon_glamor_free_screen(int scrnIndex, int flags) { } -static inline void radeon_glamor_flush(ScrnInfoPtr pScrn) { } - static inline Bool radeon_glamor_create_textured_pixmap(PixmapPtr pixmap) { return TRUE; } static inline void radeon_glamor_exchange_buffers(PixmapPtr src, PixmapPtr dst) {} diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 23c06943..d25d7f53 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -84,12 +84,21 @@ const OptionInfoRec *RADEONOptionsWeak(void) { return RADEONOptions_KMS; } void radeon_cs_flush_indirect(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); - struct radeon_accel_state *accel_state = info->accel_state; + struct radeon_accel_state *accel_state; int ret; +#ifdef USE_GLAMOR + if (info->use_glamor) { + glamor_block_handler(pScrn->pScreen); + return; + } +#endif + if (!info->cs->cdw) return; + accel_state = info->accel_state; + /* release the current VBO so we don't block on mapping it later */ if (info->accel_state->vbo.vb_offset && info->accel_state->vbo.vb_bo) { radeon_vbo_put(pScrn, &info->accel_state->vbo); @@ -307,9 +316,6 @@ static void RADEONBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL) (*pScreen->BlockHandler) (BLOCKHANDLER_ARGS); pScreen->BlockHandler = RADEONBlockHandler_KMS; - if (info->use_glamor) - radeon_glamor_flush(pScrn); - radeon_cs_flush_indirect(pScrn); #ifdef RADEON_PIXMAP_SHARING radeon_dirty_update(pScreen); @@ -322,10 +328,8 @@ radeon_flush_callback(CallbackListPtr *list, { ScrnInfoPtr pScrn = user_data; - if (pScrn->vtSema) { + if (pScrn->vtSema) radeon_cs_flush_indirect(pScrn); - radeon_glamor_flush(pScrn); - } } static Bool RADEONIsFastFBWorking(ScrnInfoPtr pScrn) -- cgit v1.2.3