Skip to content

Commit fb01197

Browse files
committed
OMAPDSS: APPLY: add fifo merge support funcs
Add mechanism to set/unset the DISPC fifo-merge: Add new fields to dss_data, fifo_merge and fifo_merge_dirty. These are similar to the other info/dirty flags in ovl_priv_data and ovl_mgr_data, but fifo merge is a common attribute to all managers and thus outside the ovl_mgr_data. The fifo-merge field is used in the dss_write_regs_common, which handles writing the register. dss_apply_fifo_merge() can be used to set/unset the fifo merge field in the dss_data. Signed-off-by: Tomi Valkeinen <[email protected]>
1 parent e6b0f88 commit fb01197

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

drivers/video/omap2/dss/apply.c

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ static struct {
105105
struct ovl_priv_data ovl_priv_data_array[MAX_DSS_OVERLAYS];
106106
struct mgr_priv_data mgr_priv_data_array[MAX_DSS_MANAGERS];
107107

108+
bool fifo_merge_dirty;
109+
bool fifo_merge;
110+
108111
bool irq_enabled;
109112
} dss_data;
110113

@@ -585,11 +588,40 @@ static void dss_mgr_write_regs(struct omap_overlay_manager *mgr)
585588
}
586589
}
587590

591+
static void dss_write_regs_common(void)
592+
{
593+
const int num_mgrs = omap_dss_get_num_overlay_managers();
594+
int i;
595+
596+
if (!dss_data.fifo_merge_dirty)
597+
return;
598+
599+
for (i = 0; i < num_mgrs; ++i) {
600+
struct omap_overlay_manager *mgr;
601+
struct mgr_priv_data *mp;
602+
603+
mgr = omap_dss_get_overlay_manager(i);
604+
mp = get_mgr_priv(mgr);
605+
606+
if (mp->enabled) {
607+
if (dss_data.fifo_merge_dirty) {
608+
dispc_enable_fifomerge(dss_data.fifo_merge);
609+
dss_data.fifo_merge_dirty = false;
610+
}
611+
612+
if (mp->updating)
613+
mp->shadow_info_dirty = true;
614+
}
615+
}
616+
}
617+
588618
static void dss_write_regs(void)
589619
{
590620
const int num_mgrs = omap_dss_get_num_overlay_managers();
591621
int i;
592622

623+
dss_write_regs_common();
624+
593625
for (i = 0; i < num_mgrs; ++i) {
594626
struct omap_overlay_manager *mgr;
595627
struct mgr_priv_data *mp;
@@ -659,6 +691,8 @@ void dss_mgr_start_update(struct omap_overlay_manager *mgr)
659691

660692
dss_mgr_write_regs(mgr);
661693

694+
dss_write_regs_common();
695+
662696
mp->updating = true;
663697

664698
if (!dss_data.irq_enabled && need_isr())
@@ -859,6 +893,15 @@ static void dss_apply_ovl_fifo_thresholds(struct omap_overlay *ovl,
859893
op->extra_info_dirty = true;
860894
}
861895

896+
static void dss_apply_fifo_merge(bool use_fifo_merge)
897+
{
898+
if (dss_data.fifo_merge == use_fifo_merge)
899+
return;
900+
901+
dss_data.fifo_merge = use_fifo_merge;
902+
dss_data.fifo_merge_dirty = true;
903+
}
904+
862905
static void dss_ovl_setup_fifo(struct omap_overlay *ovl)
863906
{
864907
struct ovl_priv_data *op = get_ovl_priv(ovl);

0 commit comments

Comments
 (0)