summaryrefslogtreecommitdiff
path: root/hw/xfree86
diff options
context:
space:
mode:
authorMichel Dänzer <mdaenzer@redhat.com>2019-11-22 18:32:38 +0100
committerMichel Dänzer <michel@daenzer.net>2019-11-25 18:47:37 +0100
commit60003023fa5b301dd621da4797f8a93035ebeeca (patch)
tree7f1238a7b75b9d7a76bfca681041ade97b6b6e7d /hw/xfree86
parent9ba13bac9dd076f166ff0d063fc144b904a40d12 (diff)
modesetting: Use glamor_clear_pixmap in drmmode_clear_pixmap
Should be slightly more efficient. Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'hw/xfree86')
-rw-r--r--hw/xfree86/drivers/modesetting/driver.c1
-rw-r--r--hw/xfree86/drivers/modesetting/driver.h1
-rw-r--r--hw/xfree86/drivers/modesetting/drmmode_display.c8
3 files changed, 10 insertions, 0 deletions
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 386e33460..6c7d7eaf0 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -748,6 +748,7 @@ bind_glamor_api(void *mod, modesettingPtr ms)
{
ms->glamor.back_pixmap_from_fd = LoaderSymbolFromModule(mod, "glamor_back_pixmap_from_fd");
ms->glamor.block_handler = LoaderSymbolFromModule(mod, "glamor_block_handler");
+ ms->glamor.clear_pixmap = LoaderSymbolFromModule(mod, "glamor_clear_pixmap");
ms->glamor.egl_create_textured_pixmap = LoaderSymbolFromModule(mod, "glamor_egl_create_textured_pixmap");
ms->glamor.egl_create_textured_pixmap_from_gbm_bo = LoaderSymbolFromModule(mod, "glamor_egl_create_textured_pixmap_from_gbm_bo");
ms->glamor.egl_exchange_buffers = LoaderSymbolFromModule(mod, "glamor_egl_exchange_buffers");
diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h
index 4c524c4eb..5909829a0 100644
--- a/hw/xfree86/drivers/modesetting/driver.h
+++ b/hw/xfree86/drivers/modesetting/driver.h
@@ -137,6 +137,7 @@ typedef struct _modesettingRec {
Bool (*back_pixmap_from_fd)(PixmapPtr, int, CARD16, CARD16, CARD16,
CARD8, CARD8);
void (*block_handler)(ScreenPtr);
+ void (*clear_pixmap)(PixmapPtr);
Bool (*egl_create_textured_pixmap)(PixmapPtr, int, int);
Bool (*egl_create_textured_pixmap_from_gbm_bo)(PixmapPtr,
struct gbm_bo *,
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 8a9dc2d80..9a6abc249 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1804,6 +1804,14 @@ drmmode_clear_pixmap(PixmapPtr pixmap)
{
ScreenPtr screen = pixmap->drawable.pScreen;
GCPtr gc;
+#ifdef GLAMOR_HAS_GBM
+ modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(screen));
+
+ if (ms->drmmode.glamor) {
+ ms->glamor.clear_pixmap(pixmap);
+ return;
+ }
+#endif
gc = GetScratchGC(pixmap->drawable.depth, screen);
if (gc) {