Skip to content

Commit

Permalink
Allow to disable Raspberry Pi fb_copyarea acceleration via xorg.conf
Browse files Browse the repository at this point in the history
Now acceleration is only used in the case if the AccelMethod option
is not set (so that it is assumed to be a default choice) or when
it is explicitly set to "COPYAREA". Any other value (for example
"CPU") disables acceleration.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
  • Loading branch information
ssvb committed Oct 7, 2013
1 parent 689c082 commit a446b3b
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/fbdev.c
Expand Up @@ -942,11 +942,22 @@ FBDevScreenInit(SCREEN_INIT_ARGS_DECL)
}

if (!fPtr->SunxiG2D_private && fPtr->fb_copyarea_private) {
fb_copyarea_t *fb = fPtr->fb_copyarea_private;
if ((fPtr->SunxiG2D_private = SunxiG2D_Init(pScreen, &fb->blt2d))) {
fb->fallback_blt2d = &cpu_backend->blt2d;
if (!(accelmethod = xf86GetOptValString(fPtr->Options, OPTION_ACCELMETHOD)) ||
strcasecmp(accelmethod, "copyarea") == 0) {
fb_copyarea_t *fb = fPtr->fb_copyarea_private;
if ((fPtr->SunxiG2D_private = SunxiG2D_Init(pScreen, &fb->blt2d))) {
fb->fallback_blt2d = &cpu_backend->blt2d;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"enabled fbdev copyarea acceleration\n");
}
else {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"failed to enable fbdev copyarea acceleration\n");
}
}
else {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"enabled fbdev copyarea acceleration\n");
"fbdev copyarea acceleration is disabled via AccelMethod option\n");
}
}

Expand Down

0 comments on commit a446b3b

Please sign in to comment.