From patchwork Tue Nov 27 19:14:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Lespiau X-Patchwork-Id: 1812411 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 5678CDF254 for ; Tue, 27 Nov 2012 19:14:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0304BE5C54 for ; Tue, 27 Nov 2012 11:14:23 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id D9E14E5C54 for ; Tue, 27 Nov 2012 11:14:12 -0800 (PST) Received: by mail-wg0-f43.google.com with SMTP id dq12so5126678wgb.12 for ; Tue, 27 Nov 2012 11:14:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer; bh=rFVGGGFUtxa21anUFXj1VR3wAX52tMRUTwA9DcPyx5I=; b=G6Sfoa4nPDP1g9yAg8H4yWO0LrSuyvTa1bhUNwLda8AtouIdBhbyRZnek4pX1nAK8r GmpUZXahxw9OflUn4bHsVHOdbFC3pFHkqQrPq0giscl7PojWMx7Abn9q7lYchaOXAY1k EPT0QIlhGRSYSsTkNPkbLxhf13AbpgKumrM8Q6R3ucsDAwtVukxNnD83mrvHHdG5UJys xlstwB/B9JQAxsuVPAB2FN3dH2sYl16XrM3cCuDEVjcEg2gZKcfsM8uqAxITbR5fzAmE /XpjKS+V9DbIYIdrCFiJxagrdUjOLraJHtptgJ+dawvKFcntle89qksBr1boV2Gv80PA rtbw== Received: by 10.216.200.75 with SMTP id y53mr5869755wen.189.1354043651936; Tue, 27 Nov 2012 11:14:11 -0800 (PST) Received: from localhost.localdomain ([83.217.123.106]) by mx.google.com with ESMTPS id dm3sm3755415wib.9.2012.11.27.11.14.09 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 27 Nov 2012 11:14:10 -0800 (PST) From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Tue, 27 Nov 2012 19:14:05 +0000 Message-Id: <1354043645-32581-1-git-send-email-damien.lespiau@gmail.com> X-Mailer: git-send-email 1.7.11.7 Subject: [Intel-gfx] [PATCH] testdisplay: Use the fb stride when painting the color key X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org From: Damien Lespiau Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55901 Signed-off-by: Damien Lespiau --- tests/testdisplay.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testdisplay.c b/tests/testdisplay.c index cd83d9c..7287487 100644 --- a/tests/testdisplay.c +++ b/tests/testdisplay.c @@ -334,7 +334,7 @@ static void connector_find_preferred_mode(struct connector *c) } static void -paint_color_key(void) +paint_color_key(struct kmstest_fb *fb_info) { int i, j; @@ -342,7 +342,7 @@ paint_color_key(void) for (j = crtc_x; j < crtc_x + crtc_w; j++) { uint32_t offset; - offset = (i * width) + j; + offset = (i * fb_info->stride / 4) + j; fb_ptr[offset] = SPRITE_COLOR_KEY; } } @@ -530,7 +530,7 @@ set_mode(struct connector *c) fb_ptr = gem_mmap(drm_fd, fb_info.gem_handle, fb_info.size, PROT_READ | PROT_WRITE); assert(fb_ptr); - paint_color_key(); + paint_color_key(&fb_info); gem_close(drm_fd, fb_info.gem_handle);