From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuFpi-0002T2-17 for qemu-devel@nongnu.org; Mon, 18 May 2015 03:51:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuFpe-0008Pj-QN for qemu-devel@nongnu.org; Mon, 18 May 2015 03:51:29 -0400 Received: from greensocs.com ([193.104.36.180]:44066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuFpe-0008Pc-F1 for qemu-devel@nongnu.org; Mon, 18 May 2015 03:51:26 -0400 Message-ID: <555999F8.80609@greensocs.com> Date: Mon, 18 May 2015 09:51:20 +0200 From: Frederic Konrad MIME-Version: 1.0 References: <1431544326-13372-1-git-send-email-fred.konrad@greensocs.com> <1431544326-13372-4-git-send-email-fred.konrad@greensocs.com> <1431934462.10826.1.camel@nilsson.home.kraxel.org> In-Reply-To: <1431934462.10826.1.camel@nilsson.home.kraxel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/8] console: add qemu_alloc_display_format. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: peter.crosthwaite@xilinx.com, mark.burton@greensocs.com, qemu-devel@nongnu.org, hyunk@xilinx.com On 18/05/2015 09:34, Gerd Hoffmann wrote: > On Mi, 2015-05-13 at 21:12 +0200, fred.konrad@greensocs.com wrote: >> From: KONRAD Frederic >> >> 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