Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294269
b: refs/heads/master
c: 4811005
h: refs/heads/master
i:
  294267: 3d36aca
v: v3
  • Loading branch information
Laurent Pinchart committed Mar 12, 2012
1 parent df8384d commit 40d0b10
Show file tree
Hide file tree
Showing 5 changed files with 216 additions and 187 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: 974d250be2c70c7bf899275b23b241685d4ed7f8
refs/heads/master: 481100506b34d666243832c3f2aee905c03cb8e7
27 changes: 12 additions & 15 deletions trunk/drivers/video/sh_mobile_lcdcfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
struct sh_mobile_meram_cfg *cfg;
int pixelformat;
void *meram;

ch = &priv->ch[k];
if (!ch->enabled)
Expand All @@ -856,9 +857,9 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
/* we need to de-init configured ICBs before we can
* re-initialize them.
*/
if (ch->meram_enabled) {
mdev->ops->meram_unregister(mdev, cfg);
ch->meram_enabled = 0;
if (ch->meram) {
mdev->ops->meram_unregister(mdev, ch->meram);
ch->meram = NULL;
}

switch (ch->format->fourcc) {
Expand All @@ -880,13 +881,13 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
break;
}

ret = mdev->ops->meram_register(mdev, cfg, ch->pitch,
meram = mdev->ops->meram_register(mdev, cfg, ch->pitch,
ch->yres, pixelformat,
ch->base_addr_y, ch->base_addr_c,
&ch->base_addr_y, &ch->base_addr_c,
&ch->pitch);
if (!ret)
ch->meram_enabled = 1;
if (!IS_ERR(meram))
ch->meram = meram;
}

/* Start the LCDC. */
Expand Down Expand Up @@ -951,13 +952,11 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv)
sh_mobile_lcdc_display_off(ch);

/* disable the meram */
if (ch->meram_enabled) {
struct sh_mobile_meram_cfg *cfg;
if (ch->meram) {
struct sh_mobile_meram_info *mdev;
cfg = ch->cfg.meram_cfg;
mdev = priv->meram_dev;
mdev->ops->meram_unregister(mdev, cfg);
ch->meram_enabled = 0;
mdev->ops->meram_unregister(mdev, ch->meram);
ch->meram = 0;
}

}
Expand Down Expand Up @@ -1070,14 +1069,12 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
base_addr_c += var->xoffset;
}

if (ch->meram_enabled) {
struct sh_mobile_meram_cfg *cfg;
if (ch->meram) {
struct sh_mobile_meram_info *mdev;
int ret;

cfg = ch->cfg.meram_cfg;
mdev = priv->meram_dev;
ret = mdev->ops->meram_update(mdev, cfg,
ret = mdev->ops->meram_update(mdev, ch->meram,
base_addr_y, base_addr_c,
&base_addr_y, &base_addr_c);
if (ret)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/video/sh_mobile_lcdcfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct sh_mobile_lcdc_chan {
unsigned long *reg_offs;
unsigned long ldmt1r_value;
unsigned long enabled; /* ME and SE in LDCNT2R */
int meram_enabled;
void *meram;

struct mutex open_lock; /* protects the use counter */
int use_count;
Expand Down
Loading

0 comments on commit 40d0b10

Please sign in to comment.