Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271439
b: refs/heads/master
c: c3dc6a7
h: refs/heads/master
i:
  271437: b562fb8
  271435: e866174
  271431: 7c35b93
  271423: dc34bc4
v: v3
  • Loading branch information
Archit Taneja authored and Tomi Valkeinen committed Sep 30, 2011
1 parent 303dce8 commit c689bd3
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 12 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: dac57a05fcf4808bbc91a96a034cae84716f0077
refs/heads/master: c3dc6a7afb47735b82a4c0061e814454a649dbfc
37 changes: 29 additions & 8 deletions trunk/drivers/video/omap2/dss/dispc.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,14 @@ static inline bool dispc_mgr_is_lcd(enum omap_channel channel)
return false;
}

static struct omap_dss_device *dispc_mgr_get_device(enum omap_channel channel)
{
struct omap_overlay_manager *mgr =
omap_dss_get_overlay_manager(channel);

return mgr ? mgr->device : NULL;
}

bool dispc_mgr_go_busy(enum omap_channel channel)
{
int bit;
Expand Down Expand Up @@ -1619,7 +1627,6 @@ static unsigned long calc_fclk_five_taps(enum omap_channel channel, u16 width,
enum omap_color_mode color_mode)
{
u32 fclk = 0;
/* FIXME venc pclk? */
u64 tmp, pclk = dispc_mgr_pclk_rate(channel);

if (height > out_height) {
Expand Down Expand Up @@ -1676,7 +1683,6 @@ static unsigned long calc_fclk(enum omap_channel channel, u16 width,
else
vf = 1;

/* FIXME venc pclk? */
return dispc_mgr_pclk_rate(channel) * vf * hf;
}

Expand Down Expand Up @@ -2415,17 +2421,32 @@ unsigned long dispc_mgr_lclk_rate(enum omap_channel channel)

unsigned long dispc_mgr_pclk_rate(enum omap_channel channel)
{
int pcd;
unsigned long r;
u32 l;

l = dispc_read_reg(DISPC_DIVISORo(channel));
if (dispc_mgr_is_lcd(channel)) {
int pcd;
u32 l;

pcd = FLD_GET(l, 7, 0);
l = dispc_read_reg(DISPC_DIVISORo(channel));

r = dispc_mgr_lclk_rate(channel);
pcd = FLD_GET(l, 7, 0);

return r / pcd;
r = dispc_mgr_lclk_rate(channel);

return r / pcd;
} else {
struct omap_dss_device *dssdev =
dispc_mgr_get_device(channel);

switch (dssdev->type) {
case OMAP_DISPLAY_TYPE_VENC:
return venc_get_pixel_clock();
case OMAP_DISPLAY_TYPE_HDMI:
return hdmi_get_pixel_clock();
default:
BUG();
}
}
}

void dispc_dump_clocks(struct seq_file *s)
Expand Down
12 changes: 12 additions & 0 deletions trunk/drivers/video/omap2/dss/dss.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ int venc_init_platform_driver(void);
void venc_uninit_platform_driver(void);
void venc_dump_regs(struct seq_file *s);
int venc_init_display(struct omap_dss_device *display);
unsigned long venc_get_pixel_clock(void);
#else
static inline int venc_init_platform_driver(void)
{
Expand All @@ -458,13 +459,19 @@ static inline int venc_init_platform_driver(void)
static inline void venc_uninit_platform_driver(void)
{
}
static inline unsigned long venc_get_pixel_clock(void)
{
WARN("%s: VENC not compiled in, returning pclk as 0\n", __func__);
return 0;
}
#endif

/* HDMI */
#ifdef CONFIG_OMAP4_DSS_HDMI
int hdmi_init_platform_driver(void);
void hdmi_uninit_platform_driver(void);
int hdmi_init_display(struct omap_dss_device *dssdev);
unsigned long hdmi_get_pixel_clock(void);
#else
static inline int hdmi_init_display(struct omap_dss_device *dssdev)
{
Expand All @@ -477,6 +484,11 @@ static inline int hdmi_init_platform_driver(void)
static inline void hdmi_uninit_platform_driver(void)
{
}
static inline unsigned long hdmi_get_pixel_clock(void)
{
WARN("%s: HDMI not compiled in, returning pclk as 0\n", __func__);
return 0;
}
#endif
int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev);
void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev);
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/video/omap2/dss/hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ static void update_hdmi_timings(struct hdmi_config *cfg,
cfg->timings.hsync_pol = cea_vesa_timings[code].hsync_pol;
}

unsigned long hdmi_get_pixel_clock(void)
{
/* HDMI Pixel Clock in Mhz */
return hdmi.ip_data.cfg.timings.timings.pixel_clock * 10000;
}

static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy,
struct hdmi_pll_info *pi)
{
Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/video/omap2/dss/venc.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,11 @@ static void venc_power_off(struct omap_dss_device *dssdev)
regulator_disable(venc.vdda_dac_reg);
}




unsigned long venc_get_pixel_clock(void)
{
/* VENC Pixel Clock in Mhz */
return 13500000;
}

/* driver */
static int venc_panel_probe(struct omap_dss_device *dssdev)
Expand Down

0 comments on commit c689bd3

Please sign in to comment.