From 4bb5ab0b4453208573b91b334940f190a8f7210a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Mar 2006 22:03:18 +0000 Subject: [PATCH] Add a DownloadFromScreen implementation, used for testing GetImage acceleration, and set the migration scheme to Always on init (since this is all for testing, and Always should make migration happen more frequently than Greedy). --- ChangeLog | 9 +++++++++ hw/kdrive/ephyr/ephyr_draw.c | 25 +++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/ChangeLog b/ChangeLog index 02c31ce2a..b4c53d8e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-03-29 Eric Anholt + + * hw/kdrive/ephyr/ephyr_draw.c: (ephyrDownloadFromScreen), + (ephyrDrawInit), (exaDDXDriverInit): + Add a DownloadFromScreen implementation, used for testing GetImage + acceleration, and set the migration scheme to Always on init (since + this is all for testing, and Always should make migration happen more + frequently than Greedy). + 2006-3-29 Deron Johnson * xorg/composite/compinit.c diff --git a/hw/kdrive/ephyr/ephyr_draw.c b/hw/kdrive/ephyr/ephyr_draw.c index 6525183d6..93cb23b3c 100644 --- a/hw/kdrive/ephyr/ephyr_draw.c +++ b/hw/kdrive/ephyr/ephyr_draw.c @@ -226,6 +226,26 @@ ephyrDoneComposite(PixmapPtr pDst) { } +/** + * Does an fbGetImage to pull image data from a pixmap. + */ +static Bool +ephyrDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, char *dst, + int dst_pitch) +{ + /* Only "accelerate" it if we can hand it off to fbGetImage, which expects + * the dst pitch to match the width of the image. + */ + if (dst_pitch != PixmapBytePad(&pSrc->drawable, w)) + return FALSE; + + fbGetImage(&pSrc->drawable, x, y, w, h, ZPixmap, FB_ALLONES, dst); + + exaMarkSync(pSrc->drawable.pScreen); + + return TRUE; +} + /** * In fakexa, we currently only track whether we have synced to the latest * "accelerated" drawing that has happened or not. This will be used by an @@ -310,6 +330,8 @@ ephyrDrawInit(ScreenPtr pScreen) fakexa->exa->Composite = ephyrComposite; fakexa->exa->DoneComposite = ephyrDoneComposite; + fakexa->exa->DownloadFromScreen = ephyrDownloadFromScreen; + fakexa->exa->MarkSync = ephyrMarkSync; fakexa->exa->WaitMarker = ephyrWaitMarker; @@ -357,4 +379,7 @@ ephyrDrawFini(ScreenPtr pScreen) void exaDDXDriverInit(ScreenPtr pScreen) { + ExaScreenPriv(pScreen); + + pExaScr->migration = ExaMigrationAlways; }