On 18/05/2015 09:34, Gerd Hoffmann wrote:
On Mi, 2015-05-13 at 21:12 +0200, fred.kon...@greensocs.com wrote:
From: KONRAD Frederic <fred.kon...@greensocs.com>
This allows to create a surface with a different format than xrgb8888.
What is the use case for this?
cheers,
Gerd
Hi,
The Display Port introduced in patch 7 and the driver use differents
pixel format.
eg: rgb565, RGB888, etc. see xilinx_dp_change_graphic_fmt in patch 7:
+static void xilinx_dp_change_graphic_fmt(XilinxDPState *s)
+{
+ switch (s->avbufm_registers[AV_BUF_FORMAT] & DP_GRAPHIC_MASK) {
+ case DP_GRAPHIC_RGBA8888:
+ s->planes[0].format = PIXMAN_r8g8b8a8;
+ break;
+ case DP_GRAPHIC_ABGR8888:
+ s->planes[0].format = PIXMAN_a8b8g8r8;
+ break;
+ case DP_GRAPHIC_RGB565:
+ s->planes[0].format = PIXMAN_r5g6b5;
+ break;
+ case DP_GRAPHIC_RGB888:
+ s->planes[0].format = PIXMAN_r8g8b8;
+ break;
+ case DP_GRAPHIC_BGR888:
+ s->planes[0].format = PIXMAN_b8g8r8;
+ break;
+ default:
+ DPRINTF("error: unsupported graphic format %u.\n",
+ s->avbufm_registers[AV_BUF_FORMAT] & DP_GRAPHIC_MASK);
+ abort();
+ break;
+ }
+
+ switch (s->avbufm_registers[AV_BUF_FORMAT] & DP_NL_VID_FMT_MASK) {
+ case 0:
+ s->planes[1].format = PIXMAN_r8g8b8a8;
+ break;
+ case DP_NL_VID_RGBA8880:
+ s->planes[1].format = PIXMAN_r8g8b8a8;
+ break;
+ default:
+ DPRINTF("error: unsupported video format %u.\n",
+ s->avbufm_registers[AV_BUF_FORMAT] & DP_NL_VID_FMT_MASK);
+ abort();
+ break;
+ }
+
+ xilinx_dp_recreate_surface(s);
+}
It needs alpha blending of two planes as well. I do this work with pixman.
Thanks,
Fred