Commit c10c6f04 authored by Tomi Valkeinen's avatar Tomi Valkeinen

OMAPDSS: APPLY: rename overlay_cache_data

overlay_cache_data is not a suitable name for the struct. It is more of
a private data for the overlay.

Rename the struct to ovl_priv_data, and add a function,
get_ovl_priv(ovl), to get a pointer to the data.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent f6a5e087
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
* +--------------------+ * +--------------------+
*/ */
struct overlay_cache_data { struct ovl_priv_data {
/* If true, cache changed, but not written to shadow registers. Set /* If true, cache changed, but not written to shadow registers. Set
* in apply(), cleared when registers written. */ * in apply(), cleared when registers written. */
bool dirty; bool dirty;
...@@ -90,12 +90,17 @@ struct manager_cache_data { ...@@ -90,12 +90,17 @@ struct manager_cache_data {
static struct { static struct {
spinlock_t lock; spinlock_t lock;
struct overlay_cache_data overlay_cache[MAX_DSS_OVERLAYS]; struct ovl_priv_data ovl_priv_data_array[MAX_DSS_OVERLAYS];
struct manager_cache_data manager_cache[MAX_DSS_MANAGERS]; struct manager_cache_data manager_cache[MAX_DSS_MANAGERS];
bool irq_enabled; bool irq_enabled;
} dss_cache; } dss_cache;
static struct ovl_priv_data *get_ovl_priv(struct omap_overlay *ovl)
{
return &dss_cache.ovl_priv_data_array[ovl->id];
}
void dss_apply_init(void) void dss_apply_init(void)
{ {
spin_lock_init(&dss_cache.lock); spin_lock_init(&dss_cache.lock);
...@@ -177,7 +182,7 @@ int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr) ...@@ -177,7 +182,7 @@ int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl) int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl)
{ {
unsigned long timeout = msecs_to_jiffies(500); unsigned long timeout = msecs_to_jiffies(500);
struct overlay_cache_data *oc; struct ovl_priv_data *op;
struct omap_dss_device *dssdev; struct omap_dss_device *dssdev;
u32 irq; u32 irq;
int r; int r;
...@@ -196,15 +201,15 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl) ...@@ -196,15 +201,15 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl)
irq = dispc_mgr_get_vsync_irq(ovl->manager->id); irq = dispc_mgr_get_vsync_irq(ovl->manager->id);
oc = &dss_cache.overlay_cache[ovl->id]; op = get_ovl_priv(ovl);
i = 0; i = 0;
while (1) { while (1) {
unsigned long flags; unsigned long flags;
bool shadow_dirty, dirty; bool shadow_dirty, dirty;
spin_lock_irqsave(&dss_cache.lock, flags); spin_lock_irqsave(&dss_cache.lock, flags);
dirty = oc->dirty; dirty = op->dirty;
shadow_dirty = oc->shadow_dirty; shadow_dirty = op->shadow_dirty;
spin_unlock_irqrestore(&dss_cache.lock, flags); spin_unlock_irqrestore(&dss_cache.lock, flags);
if (!dirty && !shadow_dirty) { if (!dirty && !shadow_dirty) {
...@@ -239,17 +244,17 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl) ...@@ -239,17 +244,17 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl)
static int dss_ovl_write_regs(struct omap_overlay *ovl) static int dss_ovl_write_regs(struct omap_overlay *ovl)
{ {
struct overlay_cache_data *c; struct ovl_priv_data *op;
struct omap_overlay_info *oi; struct omap_overlay_info *oi;
bool ilace, replication; bool ilace, replication;
int r; int r;
DSSDBGF("%d", ovl->id); DSSDBGF("%d", ovl->id);
c = &dss_cache.overlay_cache[ovl->id]; op = get_ovl_priv(ovl);
oi = &c->info; oi = &op->info;
if (!c->enabled) { if (!op->enabled) {
dispc_ovl_enable(ovl->id, 0); dispc_ovl_enable(ovl->id, 0);
return 0; return 0;
} }
...@@ -258,7 +263,7 @@ static int dss_ovl_write_regs(struct omap_overlay *ovl) ...@@ -258,7 +263,7 @@ static int dss_ovl_write_regs(struct omap_overlay *ovl)
ilace = ovl->manager->device->type == OMAP_DISPLAY_TYPE_VENC; ilace = ovl->manager->device->type == OMAP_DISPLAY_TYPE_VENC;
dispc_ovl_set_channel_out(ovl->id, c->channel); dispc_ovl_set_channel_out(ovl->id, op->channel);
r = dispc_ovl_setup(ovl->id, oi, ilace, replication); r = dispc_ovl_setup(ovl->id, oi, ilace, replication);
if (r) { if (r) {
...@@ -268,7 +273,7 @@ static int dss_ovl_write_regs(struct omap_overlay *ovl) ...@@ -268,7 +273,7 @@ static int dss_ovl_write_regs(struct omap_overlay *ovl)
return r; return r;
} }
dispc_ovl_set_fifo_threshold(ovl->id, c->fifo_low, c->fifo_high); dispc_ovl_set_fifo_threshold(ovl->id, op->fifo_low, op->fifo_high);
dispc_ovl_enable(ovl->id, 1); dispc_ovl_enable(ovl->id, 1);
...@@ -294,7 +299,7 @@ static int dss_write_regs(void) ...@@ -294,7 +299,7 @@ static int dss_write_regs(void)
{ {
struct omap_overlay *ovl; struct omap_overlay *ovl;
struct omap_overlay_manager *mgr; struct omap_overlay_manager *mgr;
struct overlay_cache_data *oc; struct ovl_priv_data *op;
struct manager_cache_data *mc; struct manager_cache_data *mc;
const int num_ovls = dss_feat_get_num_ovls(); const int num_ovls = dss_feat_get_num_ovls();
const int num_mgrs = dss_feat_get_num_mgrs(); const int num_mgrs = dss_feat_get_num_mgrs();
...@@ -315,16 +320,16 @@ static int dss_write_regs(void) ...@@ -315,16 +320,16 @@ static int dss_write_regs(void)
/* Commit overlay settings */ /* Commit overlay settings */
for (i = 0; i < num_ovls; ++i) { for (i = 0; i < num_ovls; ++i) {
ovl = omap_dss_get_overlay(i); ovl = omap_dss_get_overlay(i);
oc = &dss_cache.overlay_cache[i]; op = get_ovl_priv(ovl);
mc = &dss_cache.manager_cache[oc->channel]; mc = &dss_cache.manager_cache[op->channel];
if (!oc->dirty) if (!op->dirty)
continue; continue;
if (mc->manual_update && !mc->do_manual_update) if (mc->manual_update && !mc->do_manual_update)
continue; continue;
if (mgr_busy[oc->channel]) { if (mgr_busy[op->channel]) {
busy = true; busy = true;
continue; continue;
} }
...@@ -333,9 +338,9 @@ static int dss_write_regs(void) ...@@ -333,9 +338,9 @@ static int dss_write_regs(void)
if (r) if (r)
DSSERR("dss_ovl_write_regs %d failed\n", i); DSSERR("dss_ovl_write_regs %d failed\n", i);
oc->dirty = false; op->dirty = false;
oc->shadow_dirty = true; op->shadow_dirty = true;
mgr_go[oc->channel] = true; mgr_go[op->channel] = true;
} }
/* Commit manager settings */ /* Commit manager settings */
...@@ -385,7 +390,7 @@ static int dss_write_regs(void) ...@@ -385,7 +390,7 @@ static int dss_write_regs(void)
void dss_mgr_start_update(struct omap_overlay_manager *mgr) void dss_mgr_start_update(struct omap_overlay_manager *mgr)
{ {
struct manager_cache_data *mc; struct manager_cache_data *mc;
struct overlay_cache_data *oc; struct ovl_priv_data *op;
struct omap_overlay *ovl; struct omap_overlay *ovl;
mc = &dss_cache.manager_cache[mgr->id]; mc = &dss_cache.manager_cache[mgr->id];
...@@ -395,8 +400,8 @@ void dss_mgr_start_update(struct omap_overlay_manager *mgr) ...@@ -395,8 +400,8 @@ void dss_mgr_start_update(struct omap_overlay_manager *mgr)
mc->do_manual_update = false; mc->do_manual_update = false;
list_for_each_entry(ovl, &mgr->overlays, list) { list_for_each_entry(ovl, &mgr->overlays, list) {
oc = &dss_cache.overlay_cache[ovl->id]; op = get_ovl_priv(ovl);
oc->shadow_dirty = false; op->shadow_dirty = false;
} }
mc = &dss_cache.manager_cache[mgr->id]; mc = &dss_cache.manager_cache[mgr->id];
...@@ -441,8 +446,9 @@ static void dss_unregister_vsync_isr(void) ...@@ -441,8 +446,9 @@ static void dss_unregister_vsync_isr(void)
static void dss_apply_irq_handler(void *data, u32 mask) static void dss_apply_irq_handler(void *data, u32 mask)
{ {
struct omap_overlay *ovl;
struct manager_cache_data *mc; struct manager_cache_data *mc;
struct overlay_cache_data *oc; struct ovl_priv_data *op;
const int num_ovls = dss_feat_get_num_ovls(); const int num_ovls = dss_feat_get_num_ovls();
const int num_mgrs = dss_feat_get_num_mgrs(); const int num_mgrs = dss_feat_get_num_mgrs();
int i, r; int i, r;
...@@ -454,9 +460,10 @@ static void dss_apply_irq_handler(void *data, u32 mask) ...@@ -454,9 +460,10 @@ static void dss_apply_irq_handler(void *data, u32 mask)
spin_lock(&dss_cache.lock); spin_lock(&dss_cache.lock);
for (i = 0; i < num_ovls; ++i) { for (i = 0; i < num_ovls; ++i) {
oc = &dss_cache.overlay_cache[i]; ovl = omap_dss_get_overlay(i);
if (!mgr_busy[oc->channel]) op = get_ovl_priv(ovl);
oc->shadow_dirty = false; if (!mgr_busy[op->channel])
op->shadow_dirty = false;
} }
for (i = 0; i < num_mgrs; ++i) { for (i = 0; i < num_mgrs; ++i) {
...@@ -488,10 +495,10 @@ static void dss_apply_irq_handler(void *data, u32 mask) ...@@ -488,10 +495,10 @@ static void dss_apply_irq_handler(void *data, u32 mask)
static int omap_dss_mgr_apply_ovl(struct omap_overlay *ovl) static int omap_dss_mgr_apply_ovl(struct omap_overlay *ovl)
{ {
struct overlay_cache_data *oc; struct ovl_priv_data *op;
struct omap_dss_device *dssdev; struct omap_dss_device *dssdev;
oc = &dss_cache.overlay_cache[ovl->id]; op = get_ovl_priv(ovl);
if (ovl->manager_changed) { if (ovl->manager_changed) {
ovl->manager_changed = false; ovl->manager_changed = false;
...@@ -499,9 +506,9 @@ static int omap_dss_mgr_apply_ovl(struct omap_overlay *ovl) ...@@ -499,9 +506,9 @@ static int omap_dss_mgr_apply_ovl(struct omap_overlay *ovl)
} }
if (!overlay_enabled(ovl)) { if (!overlay_enabled(ovl)) {
if (oc->enabled) { if (op->enabled) {
oc->enabled = false; op->enabled = false;
oc->dirty = true; op->dirty = true;
} }
return 0; return 0;
} }
...@@ -512,20 +519,20 @@ static int omap_dss_mgr_apply_ovl(struct omap_overlay *ovl) ...@@ -512,20 +519,20 @@ static int omap_dss_mgr_apply_ovl(struct omap_overlay *ovl)
dssdev = ovl->manager->device; dssdev = ovl->manager->device;
if (dss_check_overlay(ovl, dssdev)) { if (dss_check_overlay(ovl, dssdev)) {
if (oc->enabled) { if (op->enabled) {
oc->enabled = false; op->enabled = false;
oc->dirty = true; op->dirty = true;
} }
return -EINVAL; return -EINVAL;
} }
ovl->info_dirty = false; ovl->info_dirty = false;
oc->dirty = true; op->dirty = true;
oc->info = ovl->info; op->info = ovl->info;
oc->channel = ovl->manager->id; op->channel = ovl->manager->id;
oc->enabled = true; op->enabled = true;
return 0; return 0;
} }
...@@ -556,13 +563,13 @@ static void omap_dss_mgr_apply_mgr(struct omap_overlay_manager *mgr) ...@@ -556,13 +563,13 @@ static void omap_dss_mgr_apply_mgr(struct omap_overlay_manager *mgr)
static void omap_dss_mgr_apply_ovl_fifos(struct omap_overlay *ovl) static void omap_dss_mgr_apply_ovl_fifos(struct omap_overlay *ovl)
{ {
struct overlay_cache_data *oc; struct ovl_priv_data *op;
struct omap_dss_device *dssdev; struct omap_dss_device *dssdev;
u32 size, burst_size; u32 size, burst_size;
oc = &dss_cache.overlay_cache[ovl->id]; op = get_ovl_priv(ovl);
if (!oc->enabled) if (!op->enabled)
return; return;
dssdev = ovl->manager->device; dssdev = ovl->manager->device;
...@@ -578,14 +585,14 @@ static void omap_dss_mgr_apply_ovl_fifos(struct omap_overlay *ovl) ...@@ -578,14 +585,14 @@ static void omap_dss_mgr_apply_ovl_fifos(struct omap_overlay *ovl)
case OMAP_DISPLAY_TYPE_VENC: case OMAP_DISPLAY_TYPE_VENC:
case OMAP_DISPLAY_TYPE_HDMI: case OMAP_DISPLAY_TYPE_HDMI:
default_get_overlay_fifo_thresholds(ovl->id, size, default_get_overlay_fifo_thresholds(ovl->id, size,
burst_size, &oc->fifo_low, burst_size, &op->fifo_low,
&oc->fifo_high); &op->fifo_high);
break; break;
#ifdef CONFIG_OMAP2_DSS_DSI #ifdef CONFIG_OMAP2_DSS_DSI
case OMAP_DISPLAY_TYPE_DSI: case OMAP_DISPLAY_TYPE_DSI:
dsi_get_overlay_fifo_thresholds(ovl->id, size, dsi_get_overlay_fifo_thresholds(ovl->id, size,
burst_size, &oc->fifo_low, burst_size, &op->fifo_low,
&oc->fifo_high); &op->fifo_high);
break; break;
#endif #endif
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment