From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org, Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [PATCH 2/4] fbdev: Introduce fb_dirty operation.
Date: Mon, 29 Jun 2015 13:44:44 -0700 [thread overview]
Message-ID: <1435610686-2249-2-git-send-email-rodrigo.vivi@intel.com> (raw)
In-Reply-To: <1435610686-2249-1-git-send-email-rodrigo.vivi@intel.com>
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 <rodrigo.vivi@intel.com>
---
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);
--
2.1.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-06-29 20:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-29 20:44 [PATCH 1/4] drm/i915: Make fb user dirty operation to invalidate frontbuffer Rodrigo Vivi
2015-06-29 20:44 ` Rodrigo Vivi [this message]
2015-06-30 7:07 ` [PATCH 2/4] fbdev: Introduce fb_dirty operation Daniel Vetter
2015-06-29 20:44 ` [PATCH 3/4] drm/udl: Use fb_dirty ops to simplify damage calls Rodrigo Vivi
2015-06-29 20:44 ` [PATCH 4/4] drm/i915: fbdev dirty calls fb user dirty to invalidate frontbuffer Rodrigo Vivi
2015-06-30 7:11 ` [Intel-gfx] " Daniel Vetter
2015-06-30 22:44 ` Rodrigo Vivi
2015-07-01 10:31 ` shuang.he
2015-06-29 21:36 ` [PATCH] " Rodrigo Vivi
2015-06-30 6:55 ` [Intel-gfx] [PATCH 1/4] drm/i915: Make fb user dirty operation " Daniel Vetter
2015-06-30 22:41 ` Rodrigo Vivi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1435610686-2249-2-git-send-email-rodrigo.vivi@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox