From patchwork Tue Jul 14 19:29:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 6788571 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 133CC9F731 for ; Tue, 14 Jul 2015 19:30:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45EB120729 for ; Tue, 14 Jul 2015 19:30:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 53A412071E for ; Tue, 14 Jul 2015 19:30:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DB9C66EA8B; Tue, 14 Jul 2015 12:30:03 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qk0-f193.google.com (mail-qk0-f193.google.com [209.85.220.193]) by gabe.freedesktop.org (Postfix) with ESMTPS id E35666EA8B for ; Tue, 14 Jul 2015 12:30:01 -0700 (PDT) Received: by qkdv3 with SMTP id v3so1332522qkd.2 for ; Tue, 14 Jul 2015 12:30:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0FZOaPmZ4bd5ea/jaH03Nj3dfajrsEHQdC/ixMvSJGU=; b=yr4HSRcmbxZ87mJpizv/K0XC6QwsB2NPodVZ/KdFmk9R6Wn+GBVw7jT25I1FxAtKNV KE6L/a1DRcMjR7+cwlGNyIHCbOqv99VavizbY2MaVnXK+GY2cXqEHNhNdLgqfBGgeppL NCGAfFy6r51+z6mgIZcn3XykNwWh2hjH2cavy4hh7rk6BCUnw5bi9zTTJ7Dza+4PDWKp pxgrv6mx3kPUP+pfstjNaKnstolb0bd174Fi48lPRd9lc3dd38b0WcKE5l0v0YriaWlW pxk4gER8agewm1joo3t9bmJVx6FDg8v0Ku26SK/IhxWB/p2F6mh1u7l0WHEtG8v7Jhyr +x4A== X-Received: by 10.140.82.72 with SMTP id g66mr425213qgd.41.1436902201264; Tue, 14 Jul 2015 12:30:01 -0700 (PDT) Received: from localhost.localdomain (r130-pw-tresbarras.ibys.com.br. [189.76.1.243]) by smtp.gmail.com with ESMTPSA id f199sm957698qka.9.2015.07.14.12.29.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Jul 2015 12:30:00 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Tue, 14 Jul 2015 16:29:12 -0300 Message-Id: <1436902154-6979-4-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1436902154-6979-1-git-send-email-przanoni@gmail.com> References: <1436902154-6979-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH igt] kms_frontbuffer_tracking: use the dirty ioctl after MMAP_WC calls 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=-5.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Paulo Zanoni We can't add this to igt_draw since igt_draw doesn't care whether it's writing on a frontbuffer or not. PS: the ENOSYS is for Kernels without the patch implementing the IOCTL. Signed-off-by: Paulo Zanoni --- tests/kms_frontbuffer_tracking.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index e162e91..1c45429 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -826,6 +826,21 @@ static struct rect pat4_get_rect(struct fb_region *fb, int r) return rect; } +static void fb_dirty_ioctl(struct fb_region *fb, struct rect *rect) +{ + int rc; + drmModeClip clip = { + .x1 = rect->x, + .x2 = rect->x + rect->w, + .y1 = rect->y, + .y2 = rect->y + rect->h, + }; + + rc = drmModeDirtyFB(drm.fd, fb->fb->fb_id, &clip, 1); + + igt_assert(rc == 0 || rc == -ENOSYS); +} + static void draw_rect(struct draw_pattern_info *pattern, struct fb_region *fb, enum igt_draw_method method, int r) { @@ -834,6 +849,9 @@ static void draw_rect(struct draw_pattern_info *pattern, struct fb_region *fb, igt_draw_rect_fb(drm.fd, drm.bufmgr, NULL, fb->fb, method, fb->x + rect.x, fb->y + rect.y, rect.w, rect.h, rect.color); + + if (method == IGT_DRAW_MMAP_WC) + fb_dirty_ioctl(fb, &rect); } static void draw_rect_igt_fb(struct draw_pattern_info *pattern,