* [PATCH 0/3] OMAPDSS: DISPC: Writeback fixes
@ 2012-11-07 6:27 Archit Taneja
2012-11-07 6:27 ` [PATCH 1/3] OMAPDSS: DISPC: Fix calc_scaling_44xx() bugs for writeback pipeline Archit Taneja
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Archit Taneja @ 2012-11-07 6:27 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
Some issues were found in the DISPC driver when performing scaling with
writeback pipeline. This series fixes those issues.
Reference tree:
git://gitorious.org/~boddob/linux-omap-dss2/archit-dss2-clone.git 3.8/writeback_fixes_dispc
Archit Taneja (3):
OMAPDSS: DISPC: Fix calc_scaling_44xx() bugs for writeback pipeline
OMAPDSS: DISPC: Don't allow predecimation for writeback
OMAPDSS: DISPC: Use output width and height to calculate row/pix inc
for writeback
drivers/video/omap2/dss/dispc.c | 39 +++++++++++++++++++++++++++------------
1 file changed, 27 insertions(+), 12 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] OMAPDSS: DISPC: Fix calc_scaling_44xx() bugs for writeback pipeline
2012-11-07 6:27 [PATCH 0/3] OMAPDSS: DISPC: Writeback fixes Archit Taneja
@ 2012-11-07 6:27 ` Archit Taneja
2012-11-07 6:27 ` [PATCH 2/3] OMAPDSS: DISPC: Don't allow predecimation for writeback Archit Taneja
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Archit Taneja @ 2012-11-07 6:27 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
dispc_ovl_calc_scaling_44xx() doesn't work correctly for writeback. There are
two issues with it:
- the function tries to calculate pixel clock for the input plane using
dispc_plane_pclk_rate(), calling this with writeback as input plane results in
a BUG(), this function shouldn't be called for writeback at all. Fix this by
calculating pixel clock only when we are not in mem to mem mode.
- the maximum input_width is the product of the downscale ratio supported and
the and the given output_width. This was calculated incorrectly by dividing
output_width with maxdownscale. Fix this.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/dispc.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 05def42..f19cd37 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -2264,14 +2264,16 @@ static int dispc_ovl_calc_scaling_44xx(enum omap_plane plane,
u16 in_height = DIV_ROUND_UP(height, *decim_y);
const int maxsinglelinewidth dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
- unsigned long pclk = dispc_plane_pclk_rate(plane);
const int maxdownscale = dss_feat_get_param_max(FEAT_PARAM_DOWNSCALE);
- if (mem_to_mem)
- in_width_max = DIV_ROUND_UP(out_width, maxdownscale);
- else
+ if (mem_to_mem) {
+ in_width_max = out_width * maxdownscale;
+ } else {
+ unsigned long pclk = dispc_plane_pclk_rate(plane);
+
in_width_max = dispc_core_clk_rate() /
DIV_ROUND_UP(pclk, out_width);
+ }
*decim_x = DIV_ROUND_UP(width, in_width_max);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] OMAPDSS: DISPC: Don't allow predecimation for writeback
2012-11-07 6:27 [PATCH 0/3] OMAPDSS: DISPC: Writeback fixes Archit Taneja
2012-11-07 6:27 ` [PATCH 1/3] OMAPDSS: DISPC: Fix calc_scaling_44xx() bugs for writeback pipeline Archit Taneja
@ 2012-11-07 6:27 ` Archit Taneja
2012-11-07 6:27 ` [PATCH 3/3] OMAPDSS: DISPC: Use output width and height to calculate row/pix inc " Archit Taneja
2012-11-12 12:00 ` [PATCH 0/3] OMAPDSS: DISPC: Writeback fixes Tomi Valkeinen
3 siblings, 0 replies; 5+ messages in thread
From: Archit Taneja @ 2012-11-07 6:27 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
Since writeback writes to a buffer instead of reading from one, predecimation
doesn't make sense for it. Configure the width and height predecimation limits
to 1 if the plane is writeback.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/dispc.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index f19cd37..664ac6f 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -2315,9 +2315,14 @@ static int dispc_ovl_calc_scaling(enum omap_plane plane,
if ((caps & OMAP_DSS_OVL_CAP_SCALE) = 0)
return -EINVAL;
- *x_predecim = max_decim_limit;
- *y_predecim = (rotation_type = OMAP_DSS_ROT_TILER &&
- dss_has_feature(FEAT_BURST_2D)) ? 2 : max_decim_limit;
+ if (plane = OMAP_DSS_WB) {
+ *x_predecim = *y_predecim = 1;
+ } else {
+ *x_predecim = max_decim_limit;
+ *y_predecim = (rotation_type = OMAP_DSS_ROT_TILER &&
+ dss_has_feature(FEAT_BURST_2D)) ?
+ 2 : max_decim_limit;
+ }
if (color_mode = OMAP_DSS_COLOR_CLUT1 ||
color_mode = OMAP_DSS_COLOR_CLUT2 ||
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] OMAPDSS: DISPC: Use output width and height to calculate row/pix inc for writeback
2012-11-07 6:27 [PATCH 0/3] OMAPDSS: DISPC: Writeback fixes Archit Taneja
2012-11-07 6:27 ` [PATCH 1/3] OMAPDSS: DISPC: Fix calc_scaling_44xx() bugs for writeback pipeline Archit Taneja
2012-11-07 6:27 ` [PATCH 2/3] OMAPDSS: DISPC: Don't allow predecimation for writeback Archit Taneja
@ 2012-11-07 6:27 ` Archit Taneja
2012-11-12 12:00 ` [PATCH 0/3] OMAPDSS: DISPC: Writeback fixes Tomi Valkeinen
3 siblings, 0 replies; 5+ messages in thread
From: Archit Taneja @ 2012-11-07 6:27 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
When calculating row and pixel increments for graphics and video pipes, we need
to consider the dimensions of the input frame to know how to read from the
buffer. Hence, we need to calculate these parameters from the input to the
pipeline.
For writeback, the row and pixel increments need to be calculated based on the
output of the writeback pipeline, i.e, the dimensions of the frame after
scaling. Ensure that dispc driver uses values of out_width and out_height when
calling calc_dma/calc_tiler_rotation_offset.
For graphics and video pipes, the original code passed the original height as
frame_height to calc_dma_rotation_offset, and not the predecimated height. This
is left as it is for now. We need to figure out why pre decimated height isn't
needed.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/dispc.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 664ac6f..db14f20 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -2381,7 +2381,7 @@ static int dispc_ovl_setup_common(enum omap_plane plane,
unsigned offset0, offset1;
s32 row_inc;
s32 pix_inc;
- u16 frame_height = height;
+ u16 frame_width, frame_height;
unsigned int field_offset = 0;
u16 in_height = height;
u16 in_width = width;
@@ -2449,20 +2449,28 @@ static int dispc_ovl_setup_common(enum omap_plane plane,
row_inc = 0;
pix_inc = 0;
+ if (plane = OMAP_DSS_WB) {
+ frame_width = out_width;
+ frame_height = out_height;
+ } else {
+ frame_width = in_width;
+ frame_height = height;
+ }
+
if (rotation_type = OMAP_DSS_ROT_TILER)
- calc_tiler_rotation_offset(screen_width, in_width,
+ calc_tiler_rotation_offset(screen_width, frame_width,
color_mode, fieldmode, field_offset,
&offset0, &offset1, &row_inc, &pix_inc,
x_predecim, y_predecim);
else if (rotation_type = OMAP_DSS_ROT_DMA)
- calc_dma_rotation_offset(rotation, mirror,
- screen_width, in_width, frame_height,
+ calc_dma_rotation_offset(rotation, mirror, screen_width,
+ frame_width, frame_height,
color_mode, fieldmode, field_offset,
&offset0, &offset1, &row_inc, &pix_inc,
x_predecim, y_predecim);
else
calc_vrfb_rotation_offset(rotation, mirror,
- screen_width, in_width, frame_height,
+ screen_width, frame_width, frame_height,
color_mode, fieldmode, field_offset,
&offset0, &offset1, &row_inc, &pix_inc,
x_predecim, y_predecim);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] OMAPDSS: DISPC: Writeback fixes
2012-11-07 6:27 [PATCH 0/3] OMAPDSS: DISPC: Writeback fixes Archit Taneja
` (2 preceding siblings ...)
2012-11-07 6:27 ` [PATCH 3/3] OMAPDSS: DISPC: Use output width and height to calculate row/pix inc " Archit Taneja
@ 2012-11-12 12:00 ` Tomi Valkeinen
3 siblings, 0 replies; 5+ messages in thread
From: Tomi Valkeinen @ 2012-11-12 12:00 UTC (permalink / raw)
To: Archit Taneja; +Cc: linux-fbdev, linux-omap
[-- Attachment #1: Type: text/plain, Size: 753 bytes --]
On 2012-11-07 08:15, Archit Taneja wrote:
> Some issues were found in the DISPC driver when performing scaling with
> writeback pipeline. This series fixes those issues.
>
> Reference tree:
> git://gitorious.org/~boddob/linux-omap-dss2/archit-dss2-clone.git 3.8/writeback_fixes_dispc
>
> Archit Taneja (3):
> OMAPDSS: DISPC: Fix calc_scaling_44xx() bugs for writeback pipeline
> OMAPDSS: DISPC: Don't allow predecimation for writeback
> OMAPDSS: DISPC: Use output width and height to calculate row/pix inc
> for writeback
>
> drivers/video/omap2/dss/dispc.c | 39 +++++++++++++++++++++++++++------------
> 1 file changed, 27 insertions(+), 12 deletions(-)
>
Thanks, looks ok. I'll apply to omapdss tree.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 897 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-11-12 12:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-07 6:27 [PATCH 0/3] OMAPDSS: DISPC: Writeback fixes Archit Taneja
2012-11-07 6:27 ` [PATCH 1/3] OMAPDSS: DISPC: Fix calc_scaling_44xx() bugs for writeback pipeline Archit Taneja
2012-11-07 6:27 ` [PATCH 2/3] OMAPDSS: DISPC: Don't allow predecimation for writeback Archit Taneja
2012-11-07 6:27 ` [PATCH 3/3] OMAPDSS: DISPC: Use output width and height to calculate row/pix inc " Archit Taneja
2012-11-12 12:00 ` [PATCH 0/3] OMAPDSS: DISPC: Writeback fixes Tomi Valkeinen
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).