* [PATCH] video/console: Clip the right margin clear to the visible region
@ 2012-03-26 20:17 Chris Wilson
2012-03-30 1:16 ` Florian Tobias Schandinat
0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2012-03-26 20:17 UTC (permalink / raw)
To: linux-fbdev; +Cc: linux-kernel, Chris Wilson, Florian Tobias Schandinat
For some unknown reason, yres_virtual was 2x larger the the size specified
by i915 and so when blit_clear_margins() tried to clear the full virtual
right-hand margin it tried to write far beyond the end of the buffer.
This limits the clear to only the visible portion of the right-hand
margin, similar to how the bottom margin is treated.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id8138
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/video/console/bitblit.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/console/bitblit.c b/drivers/video/console/bitblit.c
index 28b1a83..9f89e5a 100644
--- a/drivers/video/console/bitblit.c
+++ b/drivers/video/console/bitblit.c
@@ -219,9 +219,9 @@ static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
if (rw && !bottom_only) {
region.dx = info->var.xoffset + rs;
- region.dy = 0;
+ region.dy = info->var.yoffset;
region.width = rw;
- region.height = info->var.yres_virtual;
+ region.height = info->var.yres;
info->fbops->fb_fillrect(info, ®ion);
}
--
1.7.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] video/console: Clip the right margin clear to the visible region
2012-03-26 20:17 [PATCH] video/console: Clip the right margin clear to the visible region Chris Wilson
@ 2012-03-30 1:16 ` Florian Tobias Schandinat
2012-03-30 7:56 ` Chris Wilson
0 siblings, 1 reply; 3+ messages in thread
From: Florian Tobias Schandinat @ 2012-03-30 1:16 UTC (permalink / raw)
To: Chris Wilson; +Cc: linux-fbdev, linux-kernel
Hi Chris,
On 03/26/2012 08:17 PM, Chris Wilson wrote:
> For some unknown reason, yres_virtual was 2x larger the the size specified
> by i915 and so when blit_clear_margins() tried to clear the full virtual
> right-hand margin it tried to write far beyond the end of the buffer.
>
> This limits the clear to only the visible portion of the right-hand
> margin, similar to how the bottom margin is treated.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id8138
as you also found the root of the problem and posted a patch to fix i915
(or rather all KMS-based framebuffers) by validating the virtual
resolution in check var, I don't see any reason to apply this one. I'm
not sure about it, but changing the behaviour of this function might
cause some undesired changes in user experience and as there is no
problem with this code as is, I'd prefer to not change it.
Best regards,
Florian Tobias Schandinat
> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/video/console/bitblit.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/console/bitblit.c b/drivers/video/console/bitblit.c
> index 28b1a83..9f89e5a 100644
> --- a/drivers/video/console/bitblit.c
> +++ b/drivers/video/console/bitblit.c
> @@ -219,9 +219,9 @@ static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
>
> if (rw && !bottom_only) {
> region.dx = info->var.xoffset + rs;
> - region.dy = 0;
> + region.dy = info->var.yoffset;
> region.width = rw;
> - region.height = info->var.yres_virtual;
> + region.height = info->var.yres;
> info->fbops->fb_fillrect(info, ®ion);
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] video/console: Clip the right margin clear to the visible region
2012-03-30 1:16 ` Florian Tobias Schandinat
@ 2012-03-30 7:56 ` Chris Wilson
0 siblings, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2012-03-30 7:56 UTC (permalink / raw)
To: Florian Tobias Schandinat; +Cc: linux-fbdev, linux-kernel
On Fri, 30 Mar 2012 01:16:32 +0000, Florian Tobias Schandinat <FlorianSchandinat@gmx.de> wrote:
> Hi Chris,
>
> On 03/26/2012 08:17 PM, Chris Wilson wrote:
> > For some unknown reason, yres_virtual was 2x larger the the size specified
> > by i915 and so when blit_clear_margins() tried to clear the full virtual
> > right-hand margin it tried to write far beyond the end of the buffer.
> >
> > This limits the clear to only the visible portion of the right-hand
> > margin, similar to how the bottom margin is treated.
> >
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id8138
>
> as you also found the root of the problem and posted a patch to fix i915
> (or rather all KMS-based framebuffers) by validating the virtual
> resolution in check var, I don't see any reason to apply this one. I'm
> not sure about it, but changing the behaviour of this function might
> cause some undesired changes in user experience and as there is no
> problem with this code as is, I'd prefer to not change it.
Ok, thanks for the review. Preventing userspace from programming an
unhandled value of yres_virtual is definitely the way forward.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-03-30 7:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-26 20:17 [PATCH] video/console: Clip the right margin clear to the visible region Chris Wilson
2012-03-30 1:16 ` Florian Tobias Schandinat
2012-03-30 7:56 ` Chris Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).