From patchwork Wed Apr 17 19:18:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 2456021 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 5B65A3FC64 for ; Wed, 17 Apr 2013 19:20:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4A88CE5FF8 for ; Wed, 17 Apr 2013 12:20:13 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 7763BE5DB7 for ; Wed, 17 Apr 2013 12:18:18 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 17 Apr 2013 12:18:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,495,1363158000"; d="scan'208";a="319880345" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.168]) by orsmga002.jf.intel.com with SMTP; 17 Apr 2013 12:18:06 -0700 Received: by stinkbox (sSMTP sendmail emulation); Wed, 17 Apr 2013 22:18:05 +0300 From: ville.syrjala@linux.intel.com To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 1/5] modetest: Make RGB565 pwetty too Date: Wed, 17 Apr 2013 22:18:01 +0300 Message-Id: <1366226285-13282-1-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 1.8.1.5 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- 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) { #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 = cairo_image_surface_create_for_data(data, - CAIRO_FORMAT_ARGB32, + rgb16 ? CAIRO_FORMAT_RGB16_565 : CAIRO_FORMAT_ARGB32, width, height, stride); cr = 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 = mem; unsigned int x, y; for (y = 0; y < height; ++y) { @@ -732,6 +733,8 @@ fill_tiles_rgb16(const struct rgb_info *rgb, unsigned char *mem, } mem += 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 += stride; } - make_pwetty(mem_base, width, height, stride); + make_pwetty(mem_base, width, height, stride, 0); } static void