Commit e094e3c8 authored by Jerome Oufella's avatar Jerome Oufella Committed by Siarhei Siamashka
Browse files

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: default avatarJérôme Oufella <jerome.oufella@savoirfairelinux.com>
parent 046a7714
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment