Skip to content

Commit

Permalink
OMAP: DSS2: Ensure non-zero FIR values are configured
Browse files Browse the repository at this point in the history
FIR values can never be zero as per TRM, and the current code writes zero
when scaling is not used. It was not causing any problem as scaling was
disabled when zero was written. Its still safer to not write zero to
it in any case.
Now we configure correct FIR values even when scaling is not used (i.e. set FIR
to 1024 when scaling is not used), but the scaling enable bits are still kept
off if the scaling is not needed.

Signed-off-by: Amber Jain <amber@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
  • Loading branch information
Amber Jain authored and Tomi Valkeinen committed May 23, 2011
1 parent f20e422 commit ed14a3c
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions drivers/video/omap2/dss/dispc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,24 +1128,17 @@ static void _dispc_set_scaling(enum omap_plane plane,

_dispc_set_scale_coef(plane, hscaleup, vscaleup, five_taps);

if (!orig_width || orig_width == out_width)
fir_hinc = 0;
else
fir_hinc = 1024 * orig_width / out_width;

if (!orig_height || orig_height == out_height)
fir_vinc = 0;
else
fir_vinc = 1024 * orig_height / out_height;
fir_hinc = 1024 * orig_width / out_width;
fir_vinc = 1024 * orig_height / out_height;

_dispc_set_fir(plane, fir_hinc, fir_vinc);

l = dispc_read_reg(DISPC_OVL_ATTRIBUTES(plane));

/* RESIZEENABLE and VERTICALTAPS */
l &= ~((0x3 << 5) | (0x1 << 21));
l |= fir_hinc ? (1 << 5) : 0;
l |= fir_vinc ? (1 << 6) : 0;
l |= (orig_width != out_width) ? (1 << 5) : 0;
l |= (orig_height != out_height) ? (1 << 6) : 0;
l |= five_taps ? (1 << 21) : 0;

/* VRESIZECONF and HRESIZECONF */
Expand Down

0 comments on commit ed14a3c

Please sign in to comment.