* (unknown),
@ 2009-07-07 12:53 Fischer Steven-P27614
2009-07-07 13:04 ` DSS2 Video Overlay Scaling Patch Fischer Steven-P27614
0 siblings, 1 reply; 8+ messages in thread
From: Fischer Steven-P27614 @ 2009-07-07 12:53 UTC (permalink / raw)
To: linux-omap
[-- Attachment #1: Type: text/plain, Size: 943 bytes --]
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.
Steve.
[-- Attachment #2: 0001-Proper-Scaling-Fix.patch --]
[-- Type: application/octet-stream, Size: 1321 bytes --]
From 4319270881e8e9a0915aec140c1d8b5f6c27c876 Mon Sep 17 00:00:00 2001
From: Steve Fischer <steven.fischer@motorola.com>
Date: Thu, 2 Jul 2009 09:29:12 -0500
Subject: [PATCH] Proper Scaling Fix
---
drivers/video/omap2/dss/manager.c | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 0be370e..3ed9f3f 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -701,6 +701,8 @@ static int configure_overlay(enum omap_plane plane)
struct manager_cache_data *mc;
u16 outw, outh;
u16 x, y, w, h;
+ u32 dw = 0;
+ u32 dh = 0;
u32 paddr;
int r;
@@ -772,15 +774,25 @@ static int configure_overlay(enum omap_plane plane)
y = c->pos_y - mc->y;
}
- if (mc->w < (x+w))
- w = (x+w) - (mc->w);
+ if (mc->w < (x+outw)) {
+ dw = (x+outw) - (mc->w);
+ outw -= dw;
+ }
- if (mc->h < (y+h))
- h = (y+h) - (mc->h);
+ if (mc->h < (y+outh)) {
+ dh = (y+outh) - (mc->h);
+ outh -= dh;
+ }
if (!dispc_is_overlay_scaled(c)) {
- outw = w;
- outh = h;
+ w = outw;
+ h = outh;
+ } else {
+ if (dw)
+ w -= (u16) ((((dw << 16) / w) * outw) >> 16);
+
+ if (dh)
+ h -= (u16) ((((dh << 16) / h) * outh) >> 16);
}
}
--
1.5.4.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* RE: DSS2 Video Overlay Scaling Patch
2009-07-07 12:53 (unknown), Fischer Steven-P27614
@ 2009-07-07 13:04 ` Fischer Steven-P27614
2009-07-07 13:08 ` Fischer Steven-P27614
0 siblings, 1 reply; 8+ messages in thread
From: Fischer Steven-P27614 @ 2009-07-07 13:04 UTC (permalink / raw)
To: linux-omap
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.
Steve.
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: DSS2 Video Overlay Scaling Patch
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
0 siblings, 1 reply; 8+ messages in thread
From: Fischer Steven-P27614 @ 2009-07-07 13:08 UTC (permalink / raw)
To: linux-omap
[-- Attachment #1: Type: text/plain, Size: 1727 bytes --]
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.
Steve.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org More majordomo info
at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: 0001-Proper-Scaling-Fix.patch --]
[-- Type: application/octet-stream, Size: 1321 bytes --]
From 4319270881e8e9a0915aec140c1d8b5f6c27c876 Mon Sep 17 00:00:00 2001
From: Steve Fischer <steven.fischer@motorola.com>
Date: Thu, 2 Jul 2009 09:29:12 -0500
Subject: [PATCH] Proper Scaling Fix
---
drivers/video/omap2/dss/manager.c | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 0be370e..3ed9f3f 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -701,6 +701,8 @@ static int configure_overlay(enum omap_plane plane)
struct manager_cache_data *mc;
u16 outw, outh;
u16 x, y, w, h;
+ u32 dw = 0;
+ u32 dh = 0;
u32 paddr;
int r;
@@ -772,15 +774,25 @@ static int configure_overlay(enum omap_plane plane)
y = c->pos_y - mc->y;
}
- if (mc->w < (x+w))
- w = (x+w) - (mc->w);
+ if (mc->w < (x+outw)) {
+ dw = (x+outw) - (mc->w);
+ outw -= dw;
+ }
- if (mc->h < (y+h))
- h = (y+h) - (mc->h);
+ if (mc->h < (y+outh)) {
+ dh = (y+outh) - (mc->h);
+ outh -= dh;
+ }
if (!dispc_is_overlay_scaled(c)) {
- outw = w;
- outh = h;
+ w = outw;
+ h = outh;
+ } else {
+ if (dw)
+ w -= (u16) ((((dw << 16) / w) * outw) >> 16);
+
+ if (dh)
+ h -= (u16) ((((dh << 16) / h) * outh) >> 16);
}
}
--
1.5.4.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: DSS2 Video Overlay Scaling Patch
2009-07-07 13:08 ` Fischer Steven-P27614
@ 2009-08-04 11:06 ` Tomi Valkeinen
2009-08-04 22:22 ` Fischer Steven-P27614
2009-08-05 19:09 ` Fischer Steven-P27614
0 siblings, 2 replies; 8+ messages in thread
From: Tomi Valkeinen @ 2009-08-04 11:06 UTC (permalink / raw)
To: ext Fischer Steven-P27614; +Cc: linux-omap@vger.kernel.org
[-- 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
^ permalink raw reply related [flat|nested] 8+ messages in thread
* RE: DSS2 Video Overlay Scaling Patch
2009-08-04 11:06 ` Tomi Valkeinen
@ 2009-08-04 22:22 ` Fischer Steven-P27614
2009-08-05 19:09 ` Fischer Steven-P27614
1 sibling, 0 replies; 8+ messages in thread
From: Fischer Steven-P27614 @ 2009-08-04 22:22 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: linux-omap
I'll try out your patch, hopefully tomorrow, and let you know.
Thanks,
Steve.
-----Original Message-----
From: Tomi Valkeinen [mailto:tomi.valkeinen@nokia.com]
Sent: Tuesday, August 04, 2009 6:06 AM
To: Fischer Steven-P27614
Cc: linux-omap@vger.kernel.org
Subject: Re: DSS2 Video Overlay Scaling Patch
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: DSS2 Video Overlay Scaling Patch
2009-08-04 11:06 ` Tomi Valkeinen
2009-08-04 22:22 ` Fischer Steven-P27614
@ 2009-08-05 19:09 ` Fischer Steven-P27614
2009-08-06 13:38 ` Tomi Valkeinen
1 sibling, 1 reply; 8+ messages in thread
From: Fischer Steven-P27614 @ 2009-08-05 19:09 UTC (permalink / raw)
To: Fischer Steven-P27614, Tomi Valkeinen; +Cc: linux-omap
Tomi,
I tried the patch you sent and after just a little testing I'm fairly
confident the change works just fine. Thanks.
I couple of comments on the configure_overlay() function. Unless I'm
mis-understanding the code the overlay output rectangle is defined by
the local variable "x/y/outw/outh". I find it quite confusing that
there are separate "w" & "h" locals, since it makes it appear as if "x"
& "y" should be paired with "w" & "h" to make a rectangle. Further
more, I see "x" & "w" added together, which similarly makes them appear
to be part of the same rectangle. I would lightly suggest changing the
"x" & "y" locals to "outx" and "outy", just for clarity sake.
Also, I wonder about the code that adds "x" & "w" or even "y" & "h".
Shouldn't that code be adding "x" & "outw" or "y" & "outh"? Again,
maybe I'm mis-understanding the code.
Steve.
-----Original Message-----
From: Fischer Steven-P27614
Sent: Tuesday, August 04, 2009 5:22 PM
To: 'Tomi Valkeinen'
Cc: linux-omap@vger.kernel.org
Subject: RE: DSS2 Video Overlay Scaling Patch
I'll try out your patch, hopefully tomorrow, and let you know.
Thanks,
Steve.
-----Original Message-----
From: Tomi Valkeinen [mailto:tomi.valkeinen@nokia.com]
Sent: Tuesday, August 04, 2009 6:06 AM
To: Fischer Steven-P27614
Cc: linux-omap@vger.kernel.org
Subject: Re: DSS2 Video Overlay Scaling Patch
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: DSS2 Video Overlay Scaling Patch
2009-08-05 19:09 ` Fischer Steven-P27614
@ 2009-08-06 13:38 ` Tomi Valkeinen
2009-08-06 14:23 ` Fischer Steven-P27614
0 siblings, 1 reply; 8+ messages in thread
From: Tomi Valkeinen @ 2009-08-06 13:38 UTC (permalink / raw)
To: ext Fischer Steven-P27614; +Cc: linux-omap@vger.kernel.org
Hi,
ext Fischer Steven-P27614 wrote:
> Tomi,
>
> I tried the patch you sent and after just a little testing I'm fairly
> confident the change works just fine. Thanks.
>
> I couple of comments on the configure_overlay() function. Unless I'm
> mis-understanding the code the overlay output rectangle is defined by
> the local variable "x/y/outw/outh". I find it quite confusing that
> there are separate "w" & "h" locals, since it makes it appear as if "x"
> & "y" should be paired with "w" & "h" to make a rectangle. Further
> more, I see "x" & "w" added together, which similarly makes them appear
> to be part of the same rectangle. I would lightly suggest changing the
> "x" & "y" locals to "outx" and "outy", just for clarity sake.
I agree that it's confusing. Better naming making it clear what is used
for input data and for output data would make it a bit clearer. Perhaps
also use "inw" and "inh" to make it absolutely clear.
>
> Also, I wonder about the code that adds "x" & "w" or even "y" & "h".
> Shouldn't that code be adding "x" & "outw" or "y" & "outh"? Again,
> maybe I'm mis-understanding the code.
>
They are added only when w == outw, so it doesn't change the
functionality. But you are again right, it's a bit confusing.
I remember I was at some point trying to clean up this input/output
confusion, but I think it wasn't too simple at some points. I'll have to
look at it again at some point.
Tomi
> Steve.
>
> -----Original Message-----
> From: Fischer Steven-P27614
> Sent: Tuesday, August 04, 2009 5:22 PM
> To: 'Tomi Valkeinen'
> Cc: linux-omap@vger.kernel.org
> Subject: RE: DSS2 Video Overlay Scaling Patch
>
> I'll try out your patch, hopefully tomorrow, and let you know.
>
> Thanks,
>
> Steve.
>
> -----Original Message-----
> From: Tomi Valkeinen [mailto:tomi.valkeinen@nokia.com]
> Sent: Tuesday, August 04, 2009 6:06 AM
> To: Fischer Steven-P27614
> Cc: linux-omap@vger.kernel.org
> Subject: Re: DSS2 Video Overlay Scaling Patch
>
> 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
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: DSS2 Video Overlay Scaling Patch
2009-08-06 13:38 ` Tomi Valkeinen
@ 2009-08-06 14:23 ` Fischer Steven-P27614
0 siblings, 0 replies; 8+ messages in thread
From: Fischer Steven-P27614 @ 2009-08-06 14:23 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: linux-omap
Tomi,
> -----Original Message-----
> From: Tomi Valkeinen [mailto:tomi.valkeinen@nokia.com]
> Sent: Thursday, August 06, 2009 8:38 AM
> To: Fischer Steven-P27614
> Cc: linux-omap@vger.kernel.org
> Subject: Re: DSS2 Video Overlay Scaling Patch
>
> Hi,
>
> ext Fischer Steven-P27614 wrote:
> > Tomi,
> >
> > I tried the patch you sent and after just a little testing
> I'm fairly
> > confident the change works just fine. Thanks.
> >
> > I couple of comments on the configure_overlay() function.
> Unless I'm
> > mis-understanding the code the overlay output rectangle is
> defined by
> > the local variable "x/y/outw/outh". I find it quite confusing that
> > there are separate "w" & "h" locals, since it makes it
> appear as if "x"
> > & "y" should be paired with "w" & "h" to make a rectangle. Further
> > more, I see "x" & "w" added together, which similarly makes them
> > appear to be part of the same rectangle. I would lightly suggest
> > changing the "x" & "y" locals to "outx" and "outy", just
> for clarity sake.
>
> I agree that it's confusing. Better naming making it clear
> what is used for input data and for output data would make it
> a bit clearer. Perhaps also use "inw" and "inh" to make it
> absolutely clear.
>
Yes, I would agree with that approach.
For now, I will use your patch as given and then wait for further
updates as they show up in your repo.
Thanks again,
Steve.
> >
> > Also, I wonder about the code that adds "x" & "w" or even "y" & "h".
> > Shouldn't that code be adding "x" & "outw" or "y" & "outh"? Again,
> > maybe I'm mis-understanding the code.
> >
>
> They are added only when w == outw, so it doesn't change the
> functionality. But you are again right, it's a bit confusing.
>
> I remember I was at some point trying to clean up this
> input/output confusion, but I think it wasn't too simple at
> some points. I'll have to look at it again at some point.
>
> Tomi
>
>
> > Steve.
> >
> > -----Original Message-----
> > From: Fischer Steven-P27614
> > Sent: Tuesday, August 04, 2009 5:22 PM
> > To: 'Tomi Valkeinen'
> > Cc: linux-omap@vger.kernel.org
> > Subject: RE: DSS2 Video Overlay Scaling Patch
> >
> > I'll try out your patch, hopefully tomorrow, and let you know.
> >
> > Thanks,
> >
> > Steve.
> >
> > -----Original Message-----
> > From: Tomi Valkeinen [mailto:tomi.valkeinen@nokia.com]
> > Sent: Tuesday, August 04, 2009 6:06 AM
> > To: Fischer Steven-P27614
> > Cc: linux-omap@vger.kernel.org
> > Subject: Re: DSS2 Video Overlay Scaling Patch
> >
> > 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
> >
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-08-06 14:24 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox