Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284946
b: refs/heads/master
c: c1a9feb
h: refs/heads/master
v: v3
  • Loading branch information
Tomi Valkeinen committed Dec 2, 2011
1 parent 44017ad commit 2c311c6
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 39 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: 388c4c6cbb335e69fe23c8d18bd4b0e8dd66901b
refs/heads/master: c1a9febfafa2a9a9ac09b2de4c80aa96b41a03d1
51 changes: 44 additions & 7 deletions trunk/drivers/video/omap2/dss/apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
*/

struct ovl_priv_data {

bool user_info_dirty;
struct omap_overlay_info user_info;

/* If true, cache changed, but not written to shadow registers. Set
* in apply(), cleared when registers written. */
bool dirty;
Expand Down Expand Up @@ -129,7 +133,38 @@ static struct mgr_priv_data *get_mgr_priv(struct omap_overlay_manager *mgr)

void dss_apply_init(void)
{
const int num_ovls = dss_feat_get_num_ovls();
int i;

spin_lock_init(&data_lock);

for (i = 0; i < num_ovls; ++i) {
struct ovl_priv_data *op;

op = &dss_data.ovl_priv_data_array[i];

op->info.global_alpha = 255;

switch (i) {
case 0:
op->info.zorder = 0;
break;
case 1:
op->info.zorder =
dss_has_feature(FEAT_ALPHA_FREE_ZORDER) ? 3 : 0;
break;
case 2:
op->info.zorder =
dss_has_feature(FEAT_ALPHA_FREE_ZORDER) ? 2 : 0;
break;
case 3:
op->info.zorder =
dss_has_feature(FEAT_ALPHA_FREE_ZORDER) ? 1 : 0;
break;
}

op->user_info = op->info;
}
}

static bool ovl_manual_update(struct omap_overlay *ovl)
Expand Down Expand Up @@ -575,15 +610,15 @@ static void omap_dss_mgr_apply_ovl(struct omap_overlay *ovl)

if (ovl->manager_changed) {
ovl->manager_changed = false;
ovl->info_dirty = true;
op->user_info_dirty = true;
}

if (!ovl->info_dirty)
if (!op->user_info_dirty)
return;

ovl->info_dirty = false;
op->user_info_dirty = false;
op->dirty = true;
op->info = ovl->info;
op->info = op->user_info;

op->channel = ovl->manager->id;
}
Expand Down Expand Up @@ -821,12 +856,13 @@ int dss_mgr_unset_device(struct omap_overlay_manager *mgr)
int dss_ovl_set_info(struct omap_overlay *ovl,
struct omap_overlay_info *info)
{
struct ovl_priv_data *op = get_ovl_priv(ovl);
unsigned long flags;

spin_lock_irqsave(&data_lock, flags);

ovl->info = *info;
ovl->info_dirty = true;
op->user_info = *info;
op->user_info_dirty = true;

spin_unlock_irqrestore(&data_lock, flags);

Expand All @@ -836,11 +872,12 @@ int dss_ovl_set_info(struct omap_overlay *ovl,
void dss_ovl_get_info(struct omap_overlay *ovl,
struct omap_overlay_info *info)
{
struct ovl_priv_data *op = get_ovl_priv(ovl);
unsigned long flags;

spin_lock_irqsave(&data_lock, flags);

*info = ovl->info;
*info = op->user_info;

spin_unlock_irqrestore(&data_lock, flags);
}
Expand Down
53 changes: 35 additions & 18 deletions trunk/drivers/video/omap2/dss/overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,31 @@ static ssize_t overlay_manager_store(struct omap_overlay *ovl, const char *buf,

static ssize_t overlay_input_size_show(struct omap_overlay *ovl, char *buf)
{
struct omap_overlay_info info;

ovl->get_overlay_info(ovl, &info);

return snprintf(buf, PAGE_SIZE, "%d,%d\n",
ovl->info.width, ovl->info.height);
info.width, info.height);
}

static ssize_t overlay_screen_width_show(struct omap_overlay *ovl, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%d\n", ovl->info.screen_width);
struct omap_overlay_info info;

ovl->get_overlay_info(ovl, &info);

return snprintf(buf, PAGE_SIZE, "%d\n", info.screen_width);
}

static ssize_t overlay_position_show(struct omap_overlay *ovl, char *buf)
{
struct omap_overlay_info info;

ovl->get_overlay_info(ovl, &info);

return snprintf(buf, PAGE_SIZE, "%d,%d\n",
ovl->info.pos_x, ovl->info.pos_y);
info.pos_x, info.pos_y);
}

static ssize_t overlay_position_store(struct omap_overlay *ovl,
Expand Down Expand Up @@ -170,8 +182,12 @@ static ssize_t overlay_position_store(struct omap_overlay *ovl,

static ssize_t overlay_output_size_show(struct omap_overlay *ovl, char *buf)
{
struct omap_overlay_info info;

ovl->get_overlay_info(ovl, &info);

return snprintf(buf, PAGE_SIZE, "%d,%d\n",
ovl->info.out_width, ovl->info.out_height);
info.out_width, info.out_height);
}

static ssize_t overlay_output_size_store(struct omap_overlay *ovl,
Expand Down Expand Up @@ -231,8 +247,12 @@ static ssize_t overlay_enabled_store(struct omap_overlay *ovl, const char *buf,

static ssize_t overlay_global_alpha_show(struct omap_overlay *ovl, char *buf)
{
struct omap_overlay_info info;

ovl->get_overlay_info(ovl, &info);

return snprintf(buf, PAGE_SIZE, "%d\n",
ovl->info.global_alpha);
info.global_alpha);
}

static ssize_t overlay_global_alpha_store(struct omap_overlay *ovl,
Expand Down Expand Up @@ -269,8 +289,12 @@ static ssize_t overlay_global_alpha_store(struct omap_overlay *ovl,
static ssize_t overlay_pre_mult_alpha_show(struct omap_overlay *ovl,
char *buf)
{
struct omap_overlay_info info;

ovl->get_overlay_info(ovl, &info);

return snprintf(buf, PAGE_SIZE, "%d\n",
ovl->info.pre_mult_alpha);
info.pre_mult_alpha);
}

static ssize_t overlay_pre_mult_alpha_store(struct omap_overlay *ovl,
Expand Down Expand Up @@ -306,7 +330,11 @@ static ssize_t overlay_pre_mult_alpha_store(struct omap_overlay *ovl,

static ssize_t overlay_zorder_show(struct omap_overlay *ovl, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%d\n", ovl->info.zorder);
struct omap_overlay_info info;

ovl->get_overlay_info(ovl, &info);

return snprintf(buf, PAGE_SIZE, "%d\n", info.zorder);
}

static ssize_t overlay_zorder_store(struct omap_overlay *ovl,
Expand Down Expand Up @@ -456,29 +484,18 @@ void dss_init_overlays(struct platform_device *pdev)
case 0:
ovl->name = "gfx";
ovl->id = OMAP_DSS_GFX;
ovl->info.global_alpha = 255;
ovl->info.zorder = 0;
break;
case 1:
ovl->name = "vid1";
ovl->id = OMAP_DSS_VIDEO1;
ovl->info.global_alpha = 255;
ovl->info.zorder =
dss_has_feature(FEAT_ALPHA_FREE_ZORDER) ? 3 : 0;
break;
case 2:
ovl->name = "vid2";
ovl->id = OMAP_DSS_VIDEO2;
ovl->info.global_alpha = 255;
ovl->info.zorder =
dss_has_feature(FEAT_ALPHA_FREE_ZORDER) ? 2 : 0;
break;
case 3:
ovl->name = "vid3";
ovl->id = OMAP_DSS_VIDEO3;
ovl->info.global_alpha = 255;
ovl->info.zorder =
dss_has_feature(FEAT_ALPHA_FREE_ZORDER) ? 1 : 0;
break;
}

Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/video/omap2/omapfb/omapfb-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,19 +189,19 @@ static int omapfb_query_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
memset(pi, 0, sizeof(*pi));
} else {
struct omap_overlay *ovl;
struct omap_overlay_info *ovli;
struct omap_overlay_info ovli;

ovl = ofbi->overlays[0];
ovli = &ovl->info;
ovl->get_overlay_info(ovl, &ovli);

pi->pos_x = ovli->pos_x;
pi->pos_y = ovli->pos_y;
pi->pos_x = ovli.pos_x;
pi->pos_y = ovli.pos_y;
pi->enabled = ovl->is_enabled(ovl);
pi->channel_out = 0; /* xxx */
pi->mirror = 0;
pi->mem_idx = get_mem_idx(ofbi);
pi->out_width = ovli->out_width;
pi->out_height = ovli->out_height;
pi->out_width = ovli.out_width;
pi->out_height = ovli.out_height;
}

return 0;
Expand Down
12 changes: 8 additions & 4 deletions trunk/drivers/video/omap2/omapfb/omapfb-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,16 +970,20 @@ int omapfb_apply_changes(struct fb_info *fbi, int init)
outh = var->yres;
}
} else {
outw = ovl->info.out_width;
outh = ovl->info.out_height;
struct omap_overlay_info info;
ovl->get_overlay_info(ovl, &info);
outw = info.out_width;
outh = info.out_height;
}

if (init) {
posx = 0;
posy = 0;
} else {
posx = ovl->info.pos_x;
posy = ovl->info.pos_y;
struct omap_overlay_info info;
ovl->get_overlay_info(ovl, &info);
posx = info.pos_x;
posy = info.pos_y;
}

r = omapfb_setup_overlay(fbi, ovl, posx, posy, outw, outh);
Expand Down
3 changes: 0 additions & 3 deletions trunk/include/video/omapdss.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,8 @@ struct omap_overlay {

/* dynamic fields */
struct omap_overlay_manager *manager;
struct omap_overlay_info info;

bool manager_changed;
/* if true, info has been changed, but not applied() yet */
bool info_dirty;

int (*enable)(struct omap_overlay *ovl);
int (*disable)(struct omap_overlay *ovl);
Expand Down

0 comments on commit 2c311c6

Please sign in to comment.