From patchwork Tue Mar 8 14:51:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 8535001 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 E89AE9F8A8 for ; Tue, 8 Mar 2016 14:52:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ECEA9201FE for ; Tue, 8 Mar 2016 14:52:48 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9E1E2201E4 for ; Tue, 8 Mar 2016 14:52:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B1B996E133; Tue, 8 Mar 2016 14:52:45 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id A36116E6EE for ; Tue, 8 Mar 2016 14:52:23 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id l68so4534844wml.3 for ; Tue, 08 Mar 2016 06:52:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=zLd3V7mv/bCt0pf6Av5/pu3yEql/W4RhdXIXSARMhj0=; b=fX6fqT/kBKp42Nq00KWsK4Kqn2RCgGaAm04tAXmUtFKCnuGlKf/FwHvs24x8FnWBak 3rPb63766SHv6EKaEdgY4/Kibe8T/mnsoFu1YP8+rtgf6WS0H0s1r9CKPyUvRmDRCs/w 8Mk3A01lG20EfUj5stw7I/MxI+UAonkaxWlEWIuI1ec0TlMLEM52ZHmegP+dj2nobyJO k2a+/Qub4e593rBDgUzTxeikDDrLrKEUT/IQAgRDshT1YyKWtG8W0Ec84bkDpFKNrPSX rjaOyQ2EK+9/owyosAR0b0IAyNavlhb3g/88Z9UZI0dr85Ibbn2kR5+MUCFWL7+e4g0n gm+A== 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 :in-reply-to:references; bh=zLd3V7mv/bCt0pf6Av5/pu3yEql/W4RhdXIXSARMhj0=; b=UBSR4mzOIHqdQLHlWs82ORIHrljMA6cITrs9+5bp3jLTMMRTPY1PhnpuoD9lp+MkHu aEYs0OEt9Z7LOiE5k9RYzg2uhGhFkYp4YqOaoEwHge1N9nsoh8YihSsMnNbZsrdfk/XP RQHmsT4cfUQllZJBl5G2SdcZ9wnpHLEwZl+bMgUr77LuqgjeHpVW5E/xTg3CJDNiagDo 8lsWUDzZLGwM5TCw9G3Wles6qlelGG+RFhyW4x2wKhf4sT8Q7j0WHfbfLt0qLJCeSTE3 FPLQbmVAxN1WVv3NuCohJaTpbf/fWktADB52ct/F9l5ytewqNJ0lcuWGvZLViC7XSTCg eLdg== X-Gm-Message-State: AD7BkJL9OrlvPG1RNBTK8lO9Zb1abWN/SyI5jM1k4JTDNKmc5fNNgsMMHrxRcrrV1KdHSQ== X-Received: by 10.28.142.202 with SMTP id q193mr19042326wmd.60.1457448741802; Tue, 08 Mar 2016 06:52:21 -0800 (PST) Received: from cizrna.lan ([109.72.12.208]) by smtp.gmail.com with ESMTPSA id 3sm3781979wmp.14.2016.03.08.06.52.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Mar 2016 06:52:20 -0800 (PST) From: Tomeu Vizoso To: Intel GFX discussion Date: Tue, 8 Mar 2016 15:51:31 +0100 Message-Id: <1457448699-9778-10-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1457448699-9778-1-git-send-email-tomeu.vizoso@collabora.com> References: <1457448699-9778-1-git-send-email-tomeu.vizoso@collabora.com> Cc: Daniel Stone , Tomeu Vizoso , Micah Fedke , Gustavo Padovan , Emil Velikov Subject: [Intel-gfx] [i-g-t PATCH v2 09/17] lib: Add igt_dirty_fb 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=-4.1 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 Just wraps drmModeDirtyFB and for now invalidates the whole FB. Signed-off-by: Tomeu Vizoso --- Changes in v2: - Add igt_dirty_fb lib/igt_fb.c | 14 ++++++++++++++ lib/igt_fb.h | 1 + 2 files changed, 15 insertions(+) diff --git a/lib/igt_fb.c b/lib/igt_fb.c index f936961a484f..9d6cff0edd23 100644 --- a/lib/igt_fb.c +++ b/lib/igt_fb.c @@ -979,6 +979,20 @@ static void create_cairo_surface__blit(int fd, struct igt_fb *fb) blit, destroy_cairo_surface__blit); } +/** + * igt_dirty_fb: + * @fd: open drm file descriptor + * @fb: pointer to an #igt_fb structure + * + * Flushes out the whole framebuffer. + * + * Returns: 0 upon success. + */ +int igt_dirty_fb(int fd, struct igt_fb *fb) +{ + return drmModeDirtyFB(fb->fd, fb->fb_id, NULL, 0); +} + static void destroy_cairo_surface__gtt(void *arg) { struct igt_fb *fb = arg; diff --git a/lib/igt_fb.h b/lib/igt_fb.h index 6cfd1bbd5008..ec88854ddeb7 100644 --- a/lib/igt_fb.h +++ b/lib/igt_fb.h @@ -97,6 +97,7 @@ unsigned int igt_create_image_fb(int drm_fd, int width, int height, unsigned int igt_create_stereo_fb(int drm_fd, drmModeModeInfo *mode, uint32_t format, uint64_t tiling); void igt_remove_fb(int fd, struct igt_fb *fb); +int igt_dirty_fb(int fd, struct igt_fb *fb); /* cairo-based painting */ cairo_t *igt_get_cairo_ctx(int fd, struct igt_fb *fb);