From patchwork Fri May 6 13:36:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 9033261 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AFC3D9F1D3 for ; Fri, 6 May 2016 13:37:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC94220392 for ; Fri, 6 May 2016 13:37:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8AFDF20390 for ; Fri, 6 May 2016 13:37:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B60EE6EAC5; Fri, 6 May 2016 13:37:24 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id CD4616EAC3 for ; Fri, 6 May 2016 13:37:22 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id n129so8820585wmn.1 for ; Fri, 06 May 2016 06:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=+L4/IB7i09M6namGI/JzOMSe5xBsQAlQLvNdgUyFc7k=; b=wwy4biXVJAv9GJPkw/B12qujKOxscOvG2o4vPGHDnD1lOdEQuShdjyVGKU7gHAicFG n7YGoqyvrrUv3RUnYQWHigWYjMM2iVtdgb8938Lw+9ibdOf45gnJbnhy4JipE6QROI0m KhLQ5Y+ctvqM3s8eTyrv89cN5NjY59FYOc07PESXHzOs39U3bwCYHqdwq5KCvaKFxQc7 +czKwnDtOOB2bEz4x+0H6eF6pWh00svkxIUUG/scj6Vb2jw2/1EtlVX9CDhKqPnYARtL 4TbaDbCfcVtcMPY0AKO2EYztFl020ZqiNyYWlcMMvNHTF8yTfoCMujd6Nb/BSmt/pZyv wZhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=+L4/IB7i09M6namGI/JzOMSe5xBsQAlQLvNdgUyFc7k=; b=J3OiMYOrp7b4LWAhseCkM0Og7/K+irNB6ftA+xtG2+11qhVAd5+5CPfdmirmSfhuYN sAqMQL5Iya5O5SqDN8W7/0q36MgFBH4VJkofwp8/JA3bsBvzCo2cb1FNgez51r6G+d7q uW4B4iNS9/z7T+suFgGRqPOIwDuyPpH6g/xHnh2j41b/IjldV99b0Kqdeau5R4bwc+6p vKkF7OgcSgiMJLoAv6G3fqNYVM5xAT6LSUoVyWse3PA2Wz/A1AC8kbo/4nXj2nrN7rEH rpZxlTw43tXgp4a81mjAvwVo2ekAmzQYDGNFlo0PhjHaT8uVeH8Wb8fgbApsQKyp45Kz Bm9w== X-Gm-Message-State: AOPr4FVIicp8QxUgGNuJNwFROUzuP6qXg6rdXTkoZLs7wgkt+d9XTsR6LN7q3V7YoA0VjA== X-Received: by 10.194.118.5 with SMTP id ki5mr19970188wjb.138.1462541841423; Fri, 06 May 2016 06:37:21 -0700 (PDT) Received: from cizrna.lan ([109.72.12.78]) by smtp.gmail.com with ESMTPSA id wb10sm15039167wjc.8.2016.05.06.06.37.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 May 2016 06:37:20 -0700 (PDT) From: Tomeu Vizoso To: Intel GFX discussion Date: Fri, 6 May 2016 15:36:22 +0200 Message-Id: <1462541783-9761-1-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.5.5 Cc: Tomeu Vizoso Subject: [Intel-gfx] [PATCH i-g-t 1/2] tests/testdisplay: Use cairo helpers to draw to plane X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Paint the color key with cairo, so the test doesn't have to map the BO by itself, which depends on the driver being tested. Signed-off-by: Tomeu Vizoso --- Don't know what's the purpose of drawing this rect, so it would be better to remove it if it isn't needed. --- tests/testdisplay.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/testdisplay.c b/tests/testdisplay.c index 00b47bd06280..f821bcc64779 100644 --- a/tests/testdisplay.c +++ b/tests/testdisplay.c @@ -226,21 +226,15 @@ static void connector_find_preferred_mode(uint32_t connector_id, static void paint_color_key(struct igt_fb *fb_info) { - int i, j; - uint32_t *fb_ptr; - - fb_ptr = gem_mmap__gtt(drm_fd, fb_info->gem_handle, fb_info->size, - PROT_READ | PROT_WRITE); + cairo_t *cr = igt_get_cairo_ctx(drm_fd, fb_info); - for (i = crtc_y; i < crtc_y + crtc_h; i++) - for (j = crtc_x; j < crtc_x + crtc_w; j++) { - uint32_t offset; + cairo_rectangle(cr, crtc_x, crtc_y, crtc_w, crtc_h); + cairo_set_source_rgb(cr, .8, .8, .8); + cairo_fill(cr); - offset = (i * fb_info->stride / 4) + j; - fb_ptr[offset] = SPRITE_COLOR_KEY; - } + igt_assert(!cairo_status(cr)); - munmap(fb_ptr, fb_info->size); + cairo_destroy(cr); } static void paint_image(cairo_t *cr, const char *file)