提交 b917fa39 编写于 作者: A Archit Taneja 提交者: Tomi Valkeinen

OMAPDSS: MANAGER: Create a function to check manager timings

Create a function dss_mgr_check_timings() which wraps around the function
dispc_mgr_timings_ok(). This is mainly a clean up to hide dispc functions
from interface drivers.

dss_mgr_check_timings() is added in the function dss_mgr_check(), it currently
takes the timings maintained in the omap_dss_device struct. This would be later
replaced by the timings stored in the manager's private data.

Make dss_mgr_check_timings() and dispc_mgr_timings_ok() take a const
omap_video_timings pointer since these functions just check the timings.
Signed-off-by: NArchit Taneja <archit@ti.com>
上级 41721163
...@@ -2479,7 +2479,7 @@ static bool _dispc_lcd_timings_ok(int hsw, int hfp, int hbp, ...@@ -2479,7 +2479,7 @@ static bool _dispc_lcd_timings_ok(int hsw, int hfp, int hbp,
} }
bool dispc_mgr_timings_ok(enum omap_channel channel, bool dispc_mgr_timings_ok(enum omap_channel channel,
struct omap_video_timings *timings) const struct omap_video_timings *timings)
{ {
bool timings_ok; bool timings_ok;
......
...@@ -311,7 +311,7 @@ int dpi_check_timings(struct omap_dss_device *dssdev, ...@@ -311,7 +311,7 @@ int dpi_check_timings(struct omap_dss_device *dssdev,
unsigned long pck; unsigned long pck;
struct dispc_clock_info dispc_cinfo; struct dispc_clock_info dispc_cinfo;
if (!dispc_mgr_timings_ok(dssdev->manager->id, timings)) if (dss_mgr_check_timings(dssdev->manager, timings))
return -EINVAL; return -EINVAL;
if (timings->pixel_clock == 0) if (timings->pixel_clock == 0)
......
...@@ -208,6 +208,8 @@ int dss_init_overlay_managers(struct platform_device *pdev); ...@@ -208,6 +208,8 @@ int dss_init_overlay_managers(struct platform_device *pdev);
void dss_uninit_overlay_managers(struct platform_device *pdev); void dss_uninit_overlay_managers(struct platform_device *pdev);
int dss_mgr_simple_check(struct omap_overlay_manager *mgr, int dss_mgr_simple_check(struct omap_overlay_manager *mgr,
const struct omap_overlay_manager_info *info); const struct omap_overlay_manager_info *info);
int dss_mgr_check_timings(struct omap_overlay_manager *mgr,
const struct omap_video_timings *timings);
int dss_mgr_check(struct omap_overlay_manager *mgr, int dss_mgr_check(struct omap_overlay_manager *mgr,
struct omap_dss_device *dssdev, struct omap_dss_device *dssdev,
struct omap_overlay_manager_info *info, struct omap_overlay_manager_info *info,
...@@ -413,7 +415,7 @@ void dispc_enable_gamma_table(bool enable); ...@@ -413,7 +415,7 @@ void dispc_enable_gamma_table(bool enable);
void dispc_set_loadmode(enum omap_dss_load_mode mode); void dispc_set_loadmode(enum omap_dss_load_mode mode);
bool dispc_mgr_timings_ok(enum omap_channel channel, bool dispc_mgr_timings_ok(enum omap_channel channel,
struct omap_video_timings *timings); const struct omap_video_timings *timings);
unsigned long dispc_fclk_rate(void); unsigned long dispc_fclk_rate(void);
void dispc_find_clk_divs(bool is_tft, unsigned long req_pck, unsigned long fck, void dispc_find_clk_divs(bool is_tft, unsigned long req_pck, unsigned long fck,
struct dispc_clock_info *cinfo); struct dispc_clock_info *cinfo);
......
...@@ -654,6 +654,17 @@ static int dss_mgr_check_zorder(struct omap_overlay_manager *mgr, ...@@ -654,6 +654,17 @@ static int dss_mgr_check_zorder(struct omap_overlay_manager *mgr,
return 0; return 0;
} }
int dss_mgr_check_timings(struct omap_overlay_manager *mgr,
const struct omap_video_timings *timings)
{
if (!dispc_mgr_timings_ok(mgr->id, timings)) {
DSSERR("check_manager: invalid timings\n");
return -EINVAL;
}
return 0;
}
int dss_mgr_check(struct omap_overlay_manager *mgr, int dss_mgr_check(struct omap_overlay_manager *mgr,
struct omap_dss_device *dssdev, struct omap_dss_device *dssdev,
struct omap_overlay_manager_info *info, struct omap_overlay_manager_info *info,
...@@ -668,6 +679,10 @@ int dss_mgr_check(struct omap_overlay_manager *mgr, ...@@ -668,6 +679,10 @@ int dss_mgr_check(struct omap_overlay_manager *mgr,
return r; return r;
} }
r = dss_mgr_check_timings(mgr, &dssdev->panel.timings);
if (r)
return r;
list_for_each_entry(ovl, &mgr->overlays, list) { list_for_each_entry(ovl, &mgr->overlays, list) {
struct omap_overlay_info *oi; struct omap_overlay_info *oi;
int r; int r;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册