From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
To: ext Fischer Steven-P27614 <Steven.Fischer@motorola.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: DSS2 Video Overlay Scaling Patch
Date: Tue, 04 Aug 2009 14:06:15 +0300 [thread overview]
Message-ID: <4A781627.2060405@nokia.com> (raw)
In-Reply-To: <84FF2D40FEDEB74A98203E6EA01A4E1C059446D0@de01exm63.ds.mot.com>
[-- Attachment #1: Type: text/plain, Size: 2123 bytes --]
Hi,
ext Fischer Steven-P27614 wrote:
> Ugh, messed up morning, forgot the patch as well :(
>
> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org
> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Fischer
> Steven-P27614
> Sent: Tuesday, July 07, 2009 8:05 AM
> To: linux-omap@vger.kernel.org
> Subject: RE: DSS2 Video Overlay Scaling Patch
>
> Sorry, missed the subject line.
>
> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org
> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Fischer
> Steven-P27614
> Sent: Tuesday, July 07, 2009 7:54 AM
> To: linux-omap@vger.kernel.org
> Subject:
>
> All,
>
> The DSS2 code base seems to inadvertently prevent downscaling of video
> overlay frames. Attached is my attempt at a patch to resolve this
> issue.
>
> As I gather from the code, there is an attempt to limit the overlay
> output frame size (x, y, outw, outh) to the managers updated window
> (mc->x, mc->y, mc->w, mc->h). The problem is that the input frame size
> (w & h) is being used to instead of the output frame size (outw, outh).
> Due to this, when the input frame size is large than the output frame
> size, the input frame is being cropped, thus no downscaling occurs. My
> patch corrects this issue and also attempts to properly scale the input
> frame size if indeed the output frame is cropped.
>
> In my particular case, the output frame size is never cropped, so I have
> not explicitly tested these equations, but I believe they are
> mathematically correct.
>
> With this patch overlay downscaling is functional.
>
It was indeed slightly broken. The code is there because we cannot use
partial update for scaled overlays, but we need to update the whole
overlay. Otherwise there could be visual errors on the screen.
However, your patch didn't apply to my tree, and I think it can be
solved in slightly more clear way. If the overlay in question is scaled,
we don't even need to run that code. All we have to do is to adjust x/y
depending on the x/y of the update area.
Here's a patch, can you check if it works for you?
Tomi
[-- Attachment #2: 0001-DSS2-fix-downscaling-with-manual-update.patch --]
[-- Type: text/x-patch, Size: 1949 bytes --]
>From 0bd1ee54051fa6b890a9a8b558f8f734ac0303e9 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Tue, 4 Aug 2009 13:59:54 +0300
Subject: [PATCH] DSS2: fix downscaling with manual update
Updating a downscaled overlay caused out_width/height to
be adjusted wrongly in certain cases.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
---
drivers/video/omap2/dss/manager.c | 47 +++++++++++++++++++++---------------
1 files changed, 27 insertions(+), 20 deletions(-)
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 7b8e556..c77212b 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -755,29 +755,36 @@ static int configure_overlay(enum omap_plane plane)
BUG();
}
- if (mc->x > c->pos_x) {
- x = 0;
- w -= (mc->x - c->pos_x);
- paddr += (mc->x - c->pos_x) * bpp / 8;
- } else {
+ if (dispc_is_overlay_scaled(c)) {
+ /* If the overlay is scaled, the update area has already been
+ * enlarged to cover the whole overlay. We only need to adjust
+ * x/y here */
x = c->pos_x - mc->x;
- }
-
- if (mc->y > c->pos_y) {
- y = 0;
- h -= (mc->y - c->pos_y);
- paddr += (mc->y - c->pos_y) * c->screen_width * bpp / 8;
- } else {
y = c->pos_y - mc->y;
- }
+ } else {
+ if (mc->x > c->pos_x) {
+ x = 0;
+ w -= (mc->x - c->pos_x);
+ paddr += (mc->x - c->pos_x) * bpp / 8;
+ } else {
+ x = c->pos_x - mc->x;
+ }
+
+ if (mc->y > c->pos_y) {
+ y = 0;
+ h -= (mc->y - c->pos_y);
+ paddr += (mc->y - c->pos_y) * c->screen_width *
+ bpp / 8;
+ } else {
+ y = c->pos_y - mc->y;
+ }
- if (mc->w < (x+w))
- w -= (x+w) - (mc->w);
+ if (mc->w < (x+w))
+ w -= (x+w) - (mc->w);
- if (mc->h < (y+h))
- h -= (y+h) - (mc->h);
+ if (mc->h < (y+h))
+ h -= (y+h) - (mc->h);
- if (!dispc_is_overlay_scaled(c)) {
outw = w;
outh = h;
}
--
1.6.3.2
next prev parent reply other threads:[~2009-08-04 11:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-07 12:53 (unknown), Fischer Steven-P27614
2009-07-07 13:04 ` DSS2 Video Overlay Scaling Patch Fischer Steven-P27614
2009-07-07 13:08 ` Fischer Steven-P27614
2009-08-04 11:06 ` Tomi Valkeinen [this message]
2009-08-04 22:22 ` Fischer Steven-P27614
2009-08-05 19:09 ` Fischer Steven-P27614
2009-08-06 13:38 ` Tomi Valkeinen
2009-08-06 14:23 ` Fischer Steven-P27614
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=4A781627.2060405@nokia.com \
--to=tomi.valkeinen@nokia.com \
--cc=Steven.Fischer@motorola.com \
--cc=linux-omap@vger.kernel.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