summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Oufella <jerome.oufella@savoirfairelinux.com>2015-03-05 23:31:07 +0300
committerSiarhei Siamashka <siarhei.siamashka@gmail.com>2015-03-05 23:57:08 +0300
commite094e3c8f9004ca3347694bd05b99d136e8621b9 (patch)
treee5bd32c2b9c1357f5dfc0781e6abe9651866b2f2
parent046a7714cdf1f3f8eb39a8167ef2e5109cf7a4f9 (diff)
downloadxf86-video-fbturbo-e094e3c8f9004ca3347694bd05b99d136e8621b9.tar.xz
sunxi: probe both screen layers at disp probing
Some boards use an inverted screen layer configuration, making the original code unable to enable disp layers functionality properly. This commit adds a fallback mechanism to the actual disp probing sequence, allowing those cases to be properly handled. Signed-off-by: Jérôme Oufella <jerome.oufella@savoirfairelinux.com>
-rw-r--r--src/sunxi_disp.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/sunxi_disp.c b/src/sunxi_disp.c
index dcd8bb5..7830360 100644
--- a/src/sunxi_disp.c
+++ b/src/sunxi_disp.c
@@ -140,10 +140,16 @@ sunxi_disp_t *sunxi_disp_init(const char *device, void *xserver_fbmem)
ctx->fb_id == 0 ? FBIOGET_LAYER_HDL_0 : FBIOGET_LAYER_HDL_1,
&ctx->gfx_layer_id))
{
- close(ctx->fd_fb);
- close(ctx->fd_disp);
- free(ctx);
- return NULL;
+ /* Some boards use an inverted screen layer configuration */
+ if (ioctl(ctx->fd_fb,
+ ctx->fb_id == 0 ? FBIOGET_LAYER_HDL_1 : FBIOGET_LAYER_HDL_0,
+ &ctx->gfx_layer_id))
+ {
+ close(ctx->fd_fb);
+ close(ctx->fd_disp);
+ free(ctx);
+ return NULL;
+ }
}
if (sunxi_layer_reserve(ctx) < 0)