Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321063
b: refs/heads/master
c: 783babf
h: refs/heads/master
i:
  321061: 0b48244
  321059: 8066282
  321055: 75fec74
v: v3
  • Loading branch information
Archit Taneja authored and Tomi Valkeinen committed Jun 29, 2012
1 parent 066cc2d commit 2b30171
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 5 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: 0e065c79e6ceb8d267b1a4ff05b547feeb507986
refs/heads/master: 783babf33f47c8d42e73900575dd9beea98fca40
43 changes: 39 additions & 4 deletions trunk/drivers/video/omap2/omapfb/omapfb-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,10 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
var->lower_margin = timings.vfp;
var->hsync_len = timings.hsw;
var->vsync_len = timings.vsw;
var->sync |= timings.hsync_level == OMAPDSS_SIG_ACTIVE_HIGH ?
FB_SYNC_HOR_HIGH_ACT : 0;
var->sync |= timings.vsync_level == OMAPDSS_SIG_ACTIVE_HIGH ?
FB_SYNC_VERT_HIGH_ACT : 0;
} else {
var->pixclock = 0;
var->left_margin = 0;
Expand All @@ -741,11 +745,11 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
var->lower_margin = 0;
var->hsync_len = 0;
var->vsync_len = 0;
var->sync = 0;
}

/* TODO: get these from panel->config */
var->vmode = FB_VMODE_NONINTERLACED;
var->sync = 0;

return 0;
}
Expand Down Expand Up @@ -1993,6 +1997,7 @@ static int omapfb_create_framebuffers(struct omapfb2_device *fbdev)
}

static int omapfb_mode_to_timings(const char *mode_str,
struct omap_dss_device *display,
struct omap_video_timings *timings, u8 *bpp)
{
struct fb_info *fbi;
Expand Down Expand Up @@ -2046,6 +2051,14 @@ static int omapfb_mode_to_timings(const char *mode_str,
goto err;
}

if (display->driver->get_timings) {
display->driver->get_timings(display, timings);
} else {
timings->data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE;
timings->de_level = OMAPDSS_SIG_ACTIVE_HIGH;
timings->sync_pclk_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES;
}

timings->pixel_clock = PICOS2KHZ(var->pixclock);
timings->hbp = var->left_margin;
timings->hfp = var->right_margin;
Expand All @@ -2055,6 +2068,12 @@ static int omapfb_mode_to_timings(const char *mode_str,
timings->vsw = var->vsync_len;
timings->x_res = var->xres;
timings->y_res = var->yres;
timings->hsync_level = var->sync & FB_SYNC_HOR_HIGH_ACT ?
OMAPDSS_SIG_ACTIVE_HIGH :
OMAPDSS_SIG_ACTIVE_LOW;
timings->vsync_level = var->sync & FB_SYNC_VERT_HIGH_ACT ?
OMAPDSS_SIG_ACTIVE_HIGH :
OMAPDSS_SIG_ACTIVE_LOW;

switch (var->bits_per_pixel) {
case 16:
Expand Down Expand Up @@ -2085,7 +2104,7 @@ static int omapfb_set_def_mode(struct omapfb2_device *fbdev,
struct omap_video_timings timings, temp_timings;
struct omapfb_display_data *d;

r = omapfb_mode_to_timings(mode_str, &timings, &bpp);
r = omapfb_mode_to_timings(mode_str, display, &timings, &bpp);
if (r)
return r;

Expand Down Expand Up @@ -2178,8 +2197,17 @@ static int omapfb_parse_def_modes(struct omapfb2_device *fbdev)
}

static void fb_videomode_to_omap_timings(struct fb_videomode *m,
struct omap_dss_device *display,
struct omap_video_timings *t)
{
if (display->driver->get_timings) {
display->driver->get_timings(display, t);
} else {
t->data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE;
t->de_level = OMAPDSS_SIG_ACTIVE_HIGH;
t->sync_pclk_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES;
}

t->x_res = m->xres;
t->y_res = m->yres;
t->pixel_clock = PICOS2KHZ(m->pixclock);
Expand All @@ -2189,6 +2217,12 @@ static void fb_videomode_to_omap_timings(struct fb_videomode *m,
t->vsw = m->vsync_len;
t->vfp = m->lower_margin;
t->vbp = m->upper_margin;
t->hsync_level = m->sync & FB_SYNC_HOR_HIGH_ACT ?
OMAPDSS_SIG_ACTIVE_HIGH :
OMAPDSS_SIG_ACTIVE_LOW;
t->vsync_level = m->sync & FB_SYNC_VERT_HIGH_ACT ?
OMAPDSS_SIG_ACTIVE_HIGH :
OMAPDSS_SIG_ACTIVE_LOW;
}

static int omapfb_find_best_mode(struct omap_dss_device *display,
Expand Down Expand Up @@ -2231,7 +2265,7 @@ static int omapfb_find_best_mode(struct omap_dss_device *display,
if (m->xres == 2880 || m->xres == 1440)
continue;

fb_videomode_to_omap_timings(m, &t);
fb_videomode_to_omap_timings(m, display, &t);

r = display->driver->check_timings(display, &t);
if (r == 0 && best_xres < m->xres) {
Expand All @@ -2245,7 +2279,8 @@ static int omapfb_find_best_mode(struct omap_dss_device *display,
goto err2;
}

fb_videomode_to_omap_timings(&specs->modedb[best_idx], timings);
fb_videomode_to_omap_timings(&specs->modedb[best_idx], display,
timings);

r = 0;

Expand Down

0 comments on commit 2b30171

Please sign in to comment.