Skip to content

Commit

Permalink
OMAPDSS: DISPC: move fifo threhold calc to dispc.c
Browse files Browse the repository at this point in the history
Move fifo threshold calculation into dispc.c, as the thresholds are
really dispc internal thing.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
  • Loading branch information
Tomi Valkeinen committed Jan 25, 2012
1 parent 3cb5d96 commit 83fa2f2
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 60 deletions.
34 changes: 2 additions & 32 deletions drivers/video/omap2/dss/apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,45 +907,15 @@ static void dss_ovl_setup_fifo(struct omap_overlay *ovl,
{
struct ovl_priv_data *op = get_ovl_priv(ovl);
struct omap_dss_device *dssdev;
u32 size, burst_size;
u32 fifo_low, fifo_high;

if (!op->enabled && !op->enabling)
return;

dssdev = ovl->manager->device;

if (use_fifo_merge) {
int i;

size = 0;

for (i = 0; i < omap_dss_get_num_overlays(); ++i)
size += dispc_ovl_get_fifo_size(i);
} else {
size = dispc_ovl_get_fifo_size(ovl->id);
}

burst_size = dispc_ovl_get_burst_size(ovl->id);

switch (dssdev->type) {
case OMAP_DISPLAY_TYPE_DPI:
case OMAP_DISPLAY_TYPE_DBI:
case OMAP_DISPLAY_TYPE_SDI:
case OMAP_DISPLAY_TYPE_VENC:
case OMAP_DISPLAY_TYPE_HDMI:
default_get_overlay_fifo_thresholds(ovl->id, size,
burst_size, &fifo_low, &fifo_high);
break;
#ifdef CONFIG_OMAP2_DSS_DSI
case OMAP_DISPLAY_TYPE_DSI:
dsi_get_overlay_fifo_thresholds(ovl->id, size,
burst_size, &fifo_low, &fifo_high);
break;
#endif
default:
BUG();
}
dispc_ovl_compute_fifo_thresholds(ovl->id, &fifo_low, &fifo_high,
use_fifo_merge);

dss_apply_ovl_fifo_thresholds(ovl, fifo_low, fifo_high);
}
Expand Down
22 changes: 20 additions & 2 deletions drivers/video/omap2/dss/dispc.c
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ static void dispc_configure_burst_sizes(void)
dispc_ovl_set_burst_size(i, burst_size);
}

u32 dispc_ovl_get_burst_size(enum omap_plane plane)
static u32 dispc_ovl_get_burst_size(enum omap_plane plane)
{
unsigned unit = dss_feat_get_burst_size_unit();
/* burst multiplier is always x8 (see dispc_configure_burst_sizes()) */
Expand Down Expand Up @@ -1018,7 +1018,7 @@ static void dispc_read_plane_fifo_sizes(void)
}
}

u32 dispc_ovl_get_fifo_size(enum omap_plane plane)
static u32 dispc_ovl_get_fifo_size(enum omap_plane plane)
{
return dispc.fifo_size[plane];
}
Expand Down Expand Up @@ -1063,6 +1063,24 @@ void dispc_enable_fifomerge(bool enable)
REG_FLD_MOD(DISPC_CONFIG, enable ? 1 : 0, 14, 14);
}

void dispc_ovl_compute_fifo_thresholds(enum omap_plane plane,
u32 *fifo_low, u32 *fifo_high, bool use_fifomerge)
{
/*
* All sizes are in bytes. Both the buffer and burst are made of
* buffer_units, and the fifo thresholds must be buffer_unit aligned.
*/

unsigned buf_unit = dss_feat_get_buffer_size_unit();
unsigned fifo_size, burst_size;

burst_size = dispc_ovl_get_burst_size(plane);
fifo_size = dispc_ovl_get_fifo_size(plane);

*fifo_low = fifo_size - burst_size;
*fifo_high = fifo_size - buf_unit;
}

static void dispc_ovl_set_fir(enum omap_plane plane,
int hinc, int vinc,
enum omap_color_component color_comp)
Expand Down
10 changes: 0 additions & 10 deletions drivers/video/omap2/dss/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,16 +279,6 @@ void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
}
EXPORT_SYMBOL(omapdss_default_get_resolution);

void default_get_overlay_fifo_thresholds(enum omap_plane plane,
u32 fifo_size, u32 burst_size,
u32 *fifo_low, u32 *fifo_high)
{
unsigned buf_unit = dss_feat_get_buffer_size_unit();

*fifo_high = fifo_size - buf_unit;
*fifo_low = fifo_size - burst_size;
}

int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev)
{
switch (dssdev->type) {
Expand Down
8 changes: 0 additions & 8 deletions drivers/video/omap2/dss/dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -4524,14 +4524,6 @@ int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable)
}
EXPORT_SYMBOL(omapdss_dsi_enable_te);

void dsi_get_overlay_fifo_thresholds(enum omap_plane plane,
u32 fifo_size, u32 burst_size,
u32 *fifo_low, u32 *fifo_high)
{
*fifo_high = fifo_size - burst_size;
*fifo_low = fifo_size - burst_size * 2;
}

int dsi_init_display(struct omap_dss_device *dssdev)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
Expand Down
10 changes: 2 additions & 8 deletions drivers/video/omap2/dss/dss.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@ void dss_uninit_device(struct platform_device *pdev,
struct omap_dss_device *dssdev);
bool dss_use_replication(struct omap_dss_device *dssdev,
enum omap_color_mode mode);
void default_get_overlay_fifo_thresholds(enum omap_plane plane,
u32 fifo_size, u32 burst_size,
u32 *fifo_low, u32 *fifo_high);

/* manager */
int dss_init_overlay_managers(struct platform_device *pdev);
Expand Down Expand Up @@ -313,9 +310,6 @@ int dsi_pll_calc_clock_div_pck(struct platform_device *dsidev, bool is_tft,
int dsi_pll_init(struct platform_device *dsidev, bool enable_hsclk,
bool enable_hsdiv);
void dsi_pll_uninit(struct platform_device *dsidev, bool disconnect_lanes);
void dsi_get_overlay_fifo_thresholds(enum omap_plane plane,
u32 fifo_size, u32 burst_size,
u32 *fifo_low, u32 *fifo_high);
void dsi_wait_pll_hsdiv_dispc_active(struct platform_device *dsidev);
void dsi_wait_pll_hsdiv_dsi_active(struct platform_device *dsidev);
struct platform_device *dsi_get_dsidev_from_id(int module);
Expand Down Expand Up @@ -429,8 +423,8 @@ int dispc_calc_clock_rates(unsigned long dispc_fclk_rate,


void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high);
u32 dispc_ovl_get_fifo_size(enum omap_plane plane);
u32 dispc_ovl_get_burst_size(enum omap_plane plane);
void dispc_ovl_compute_fifo_thresholds(enum omap_plane plane,
u32 *fifo_low, u32 *fifo_high, bool use_fifomerge);
int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi,
bool ilace, bool replication);
int dispc_ovl_enable(enum omap_plane plane, bool enable);
Expand Down

0 comments on commit 83fa2f2

Please sign in to comment.