From patchwork Mon Jun 29 20:44:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 6692001 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BCAF7C05AC for ; Mon, 29 Jun 2015 20:45:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C079E2053D for ; Mon, 29 Jun 2015 20:44:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C7D20205F9 for ; Mon, 29 Jun 2015 20:44:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B6800720BC; Mon, 29 Jun 2015 13:44:53 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 0BA1B6E960; Mon, 29 Jun 2015 13:44:52 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 29 Jun 2015 13:44:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,372,1432623600"; d="scan'208";a="596961174" Received: from rdvivi-talin.jf.intel.com ([10.7.196.149]) by orsmga003.jf.intel.com with ESMTP; 29 Jun 2015 13:44:50 -0700 From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Subject: [PATCH 2/4] fbdev: Introduce fb_dirty operation. Date: Mon, 29 Jun 2015 13:44:44 -0700 Message-Id: <1435610686-2249-2-git-send-email-rodrigo.vivi@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1435610686-2249-1-git-send-email-rodrigo.vivi@intel.com> References: <1435610686-2249-1-git-send-email-rodrigo.vivi@intel.com> Cc: dri-devel@lists.freedesktop.org, Rodrigo Vivi X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 There are cases we need to mark dirty/damaged areas, specially with operations that touches frontbuffer directly. To cover these cases this patch introduces the optional fb_dirty operation. Signed-off-by: Rodrigo Vivi --- drivers/video/fbdev/core/cfbcopyarea.c | 3 +++ drivers/video/fbdev/core/cfbfillrect.c | 3 +++ drivers/video/fbdev/core/cfbimgblt.c | 4 ++++ drivers/video/fbdev/core/syscopyarea.c | 3 +++ drivers/video/fbdev/core/sysfillrect.c | 3 +++ drivers/video/fbdev/core/sysimgblt.c | 4 ++++ include/linux/fb.h | 3 +++ 7 files changed, 23 insertions(+) diff --git a/drivers/video/fbdev/core/cfbcopyarea.c b/drivers/video/fbdev/core/cfbcopyarea.c index 6d4bfee..2e5b69f 100644 --- a/drivers/video/fbdev/core/cfbcopyarea.c +++ b/drivers/video/fbdev/core/cfbcopyarea.c @@ -427,6 +427,9 @@ void cfb_copyarea(struct fb_info *p, const struct fb_copyarea *area) src_idx += bits_per_line; } } + + if (p->fbops->fb_dirty) + p->fbops->fb_dirty(p, dx, dy, width, height); } EXPORT_SYMBOL(cfb_copyarea); diff --git a/drivers/video/fbdev/core/cfbfillrect.c b/drivers/video/fbdev/core/cfbfillrect.c index ba9f58b..c8732d5 100644 --- a/drivers/video/fbdev/core/cfbfillrect.c +++ b/drivers/video/fbdev/core/cfbfillrect.c @@ -362,6 +362,9 @@ void cfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect) dst_idx += p->fix.line_length*8; } } + + if (p->fbops->fb_dirty) + p->fbops->fb_dirty(p, rect->dx, rect->dy, width, height); } EXPORT_SYMBOL(cfb_fillrect); diff --git a/drivers/video/fbdev/core/cfbimgblt.c b/drivers/video/fbdev/core/cfbimgblt.c index a2bb276..09c2dbe 100644 --- a/drivers/video/fbdev/core/cfbimgblt.c +++ b/drivers/video/fbdev/core/cfbimgblt.c @@ -267,6 +267,7 @@ void cfb_imageblit(struct fb_info *p, const struct fb_image *image) u32 fgcolor, bgcolor, start_index, bitstart, pitch_index = 0; u32 bpl = sizeof(u32), bpp = p->var.bits_per_pixel; u32 width = image->width; + u32 height = image->height; u32 dx = image->dx, dy = image->dy; u8 __iomem *dst1; @@ -303,6 +304,9 @@ void cfb_imageblit(struct fb_info *p, const struct fb_image *image) start_index, pitch_index); } else color_imageblit(image, p, dst1, start_index, pitch_index); + + if (p->fbops->fb_dirty) + p->fbops->fb_dirty(p, dx, dy, width, height); } EXPORT_SYMBOL(cfb_imageblit); diff --git a/drivers/video/fbdev/core/syscopyarea.c b/drivers/video/fbdev/core/syscopyarea.c index c1eda31..3f74683 100644 --- a/drivers/video/fbdev/core/syscopyarea.c +++ b/drivers/video/fbdev/core/syscopyarea.c @@ -360,6 +360,9 @@ void sys_copyarea(struct fb_info *p, const struct fb_copyarea *area) src_idx += bits_per_line; } } + + if (p->fbops->fb_dirty) + p->fbops->fb_dirty(p, dx, dy, width, height); } EXPORT_SYMBOL(sys_copyarea); diff --git a/drivers/video/fbdev/core/sysfillrect.c b/drivers/video/fbdev/core/sysfillrect.c index 33ee3d3..f2c3efa 100644 --- a/drivers/video/fbdev/core/sysfillrect.c +++ b/drivers/video/fbdev/core/sysfillrect.c @@ -326,6 +326,9 @@ void sys_fillrect(struct fb_info *p, const struct fb_fillrect *rect) dst_idx += p->fix.line_length*8; } } + + if (p->fbops->fb_dirty) + p->fbops->fb_dirty(p, rect->dx, rect->dy, width, height); } EXPORT_SYMBOL(sys_fillrect); diff --git a/drivers/video/fbdev/core/sysimgblt.c b/drivers/video/fbdev/core/sysimgblt.c index a4d05b1..d690fb5 100644 --- a/drivers/video/fbdev/core/sysimgblt.c +++ b/drivers/video/fbdev/core/sysimgblt.c @@ -243,6 +243,7 @@ void sys_imageblit(struct fb_info *p, const struct fb_image *image) u32 bpl = sizeof(u32), bpp = p->var.bits_per_pixel; u32 width = image->width; u32 dx = image->dx, dy = image->dy; + u32 height = image->height; void *dst1; if (p->state != FBINFO_STATE_RUNNING) @@ -278,6 +279,9 @@ void sys_imageblit(struct fb_info *p, const struct fb_image *image) start_index, pitch_index); } else color_imageblit(image, p, dst1, start_index, pitch_index); + + if (p->fbops->fb_dirty) + p->fbops->fb_dirty(p, dx, dy, width, height); } EXPORT_SYMBOL(sys_imageblit); diff --git a/include/linux/fb.h b/include/linux/fb.h index 043f328..e17e4b7 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -284,6 +284,9 @@ struct fb_ops { /* wait for blit idle, optional */ int (*fb_sync)(struct fb_info *info); + /* Mark rect as dirty (optional) */ + void (*fb_dirty)(struct fb_info *info, u32 x1, u32 y1, u32 x2, u32 y2); + /* perform fb specific ioctl (optional) */ int (*fb_ioctl)(struct fb_info *info, unsigned int cmd, unsigned long arg);