From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Pinchart Subject: Re: [PATCH libdrm 1/5] modetest: Make RGB565 pwetty too Date: Thu, 18 Apr 2013 15:43:23 +0200 Message-ID: <4636590.FUlXDK7TnS@avalon> References: <1366226285-13282-1-git-send-email-ville.syrjala@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [95.142.166.194]) by gabe.freedesktop.org (Postfix) with ESMTP id 83EF6E63D4 for ; Thu, 18 Apr 2013 06:43:19 -0700 (PDT) In-Reply-To: <1366226285-13282-1-git-send-email-ville.syrjala@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org Hi Ville, Thank you for the patch. On Wednesday 17 April 2013 22:18:01 ville.syrjala@linux.intel.com wrote: > From: Ville Syrj=E4l=E4 > = > Signed-off-by: Ville Syrj=E4l=E4 > --- > tests/modetest/buffers.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > = > diff --git a/tests/modetest/buffers.c b/tests/modetest/buffers.c > index 5086381..6b117b4 100644 > --- a/tests/modetest/buffers.c > +++ b/tests/modetest/buffers.c > @@ -601,7 +601,7 @@ fill_smpte(const struct format_info *info, void > *planes[3], unsigned int width, #define BLUE 0 > = > static void > -make_pwetty(void *data, int width, int height, int stride) > +make_pwetty(void *data, int width, int height, int stride, int rgb16) What about passing the format 4cc instead ? > { > #ifdef HAVE_CAIRO > cairo_surface_t *surface; > @@ -609,7 +609,7 @@ make_pwetty(void *data, int width, int height, int > stride) int x, y; > = > surface =3D cairo_image_surface_create_for_data(data, > - CAIRO_FORMAT_ARGB32, > + rgb16 ? CAIRO_FORMAT_RGB16_565 : = CAIRO_FORMAT_ARGB32, > width, height, > stride); > cr =3D cairo_create(surface); > @@ -716,6 +716,7 @@ static void > fill_tiles_rgb16(const struct rgb_info *rgb, unsigned char *mem, > unsigned int width, unsigned int height, unsigned int stride) > { > + unsigned char *mem_base =3D mem; > unsigned int x, y; > = > for (y =3D 0; y < height; ++y) { > @@ -732,6 +733,8 @@ fill_tiles_rgb16(const struct rgb_info *rgb, unsigned > char *mem, } > mem +=3D stride; > } > + > + make_pwetty(mem_base, width, height, stride, 1); > } > = > static void > @@ -777,7 +780,7 @@ fill_tiles_rgb32(const struct rgb_info *rgb, unsigned > char *mem, mem +=3D stride; > } > = > - make_pwetty(mem_base, width, height, stride); > + make_pwetty(mem_base, width, height, stride, 0); > } > = > static void -- = Regards, Laurent Pinchart