Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333544
b: refs/heads/master
c: 42a6961
h: refs/heads/master
v: v3
  • Loading branch information
Tomi Valkeinen committed Sep 7, 2012
1 parent 75d88df commit 96e54fb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 85099f11bd0360a0327edb1f61aeea89764677bf
refs/heads/master: 42a6961cf6d23632b8b5c64bd8711aef33e89518
39 changes: 31 additions & 8 deletions trunk/drivers/video/omap2/dss/dispc.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@ struct dispc_features {
u16 pos_x, unsigned long *core_clk);
unsigned long (*calc_core_clk) (enum omap_channel channel,
u16 width, u16 height, u16 out_width, u16 out_height);
u8 num_fifos;
};

#define DISPC_MAX_NR_FIFOS 5

static struct {
struct platform_device *pdev;
void __iomem *base;
Expand All @@ -105,7 +108,9 @@ static struct {
int irq;
struct clk *dss_clk;

u32 fifo_size[MAX_DSS_OVERLAYS];
u32 fifo_size[DISPC_MAX_NR_FIFOS];
/* maps which plane is using a fifo. fifo-id -> plane-id */
int fifo_assignment[DISPC_MAX_NR_FIFOS];

spinlock_t irq_lock;
u32 irq_error_mask;
Expand Down Expand Up @@ -1061,27 +1066,41 @@ static void dispc_mgr_set_size(enum omap_channel channel, u16 width,
dispc_write_reg(DISPC_SIZE_MGR(channel), val);
}

static void dispc_read_plane_fifo_sizes(void)
static void dispc_init_fifos(void)
{
u32 size;
int plane;
int fifo;
u8 start, end;
u32 unit;

unit = dss_feat_get_buffer_size_unit();

dss_feat_get_reg_field(FEAT_REG_FIFOSIZE, &start, &end);

for (plane = 0; plane < dss_feat_get_num_ovls(); ++plane) {
size = REG_GET(DISPC_OVL_FIFO_SIZE_STATUS(plane), start, end);
for (fifo = 0; fifo < dispc.feat->num_fifos; ++fifo) {
size = REG_GET(DISPC_OVL_FIFO_SIZE_STATUS(fifo), start, end);
size *= unit;
dispc.fifo_size[plane] = size;
dispc.fifo_size[fifo] = size;

/*
* By default fifos are mapped directly to overlays, fifo 0 to
* ovl 0, fifo 1 to ovl 1, etc.
*/
dispc.fifo_assignment[fifo] = fifo;
}
}

static u32 dispc_ovl_get_fifo_size(enum omap_plane plane)
{
return dispc.fifo_size[plane];
int fifo;
u32 size = 0;

for (fifo = 0; fifo < dispc.feat->num_fifos; ++fifo) {
if (dispc.fifo_assignment[fifo] == plane)
size += dispc.fifo_size[fifo];
}

return size;
}

void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high)
Expand Down Expand Up @@ -3708,7 +3727,7 @@ static void _omap_dispc_initial_config(void)

dispc_set_loadmode(OMAP_DSS_LOAD_FRAME_ONLY);

dispc_read_plane_fifo_sizes();
dispc_init_fifos();

dispc_configure_burst_sizes();

Expand All @@ -3724,6 +3743,7 @@ static const struct dispc_features omap24xx_dispc_feats __initconst = {
.hp_max = 256,
.calc_scaling = dispc_ovl_calc_scaling_24xx,
.calc_core_clk = calc_core_clk_24xx,
.num_fifos = 3,
};

static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
Expand All @@ -3735,6 +3755,7 @@ static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
.hp_max = 256,
.calc_scaling = dispc_ovl_calc_scaling_34xx,
.calc_core_clk = calc_core_clk_34xx,
.num_fifos = 3,
};

static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
Expand All @@ -3746,6 +3767,7 @@ static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
.hp_max = 4096,
.calc_scaling = dispc_ovl_calc_scaling_34xx,
.calc_core_clk = calc_core_clk_34xx,
.num_fifos = 3,
};

static const struct dispc_features omap44xx_dispc_feats __initconst = {
Expand All @@ -3757,6 +3779,7 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
.hp_max = 4096,
.calc_scaling = dispc_ovl_calc_scaling_44xx,
.calc_core_clk = calc_core_clk_44xx,
.num_fifos = 5,
};

static int __init dispc_init_features(struct device *dev)
Expand Down

0 comments on commit 96e54fb

Please sign in to comment.