提交 96adcece 编写于 作者: T Tomi Valkeinen

OMAP: DSS2: move get_resolution()

Move get_resolution() from omap_dss_device to omap_dss_driver.

This is part of a larger patch-set, which moves the control from omapdss
driver to the display driver.
Signed-off-by: NTomi Valkeinen <tomi.valkeinen@nokia.com>
上级 a2faee84
...@@ -470,8 +470,6 @@ struct omap_dss_device { ...@@ -470,8 +470,6 @@ struct omap_dss_device {
int (*suspend)(struct omap_dss_device *dssdev); int (*suspend)(struct omap_dss_device *dssdev);
int (*resume)(struct omap_dss_device *dssdev); int (*resume)(struct omap_dss_device *dssdev);
void (*get_resolution)(struct omap_dss_device *dssdev,
u16 *xres, u16 *yres);
int (*get_recommended_bpp)(struct omap_dss_device *dssdev); int (*get_recommended_bpp)(struct omap_dss_device *dssdev);
int (*check_timings)(struct omap_dss_device *dssdev, int (*check_timings)(struct omap_dss_device *dssdev,
...@@ -529,6 +527,9 @@ struct omap_dss_driver { ...@@ -529,6 +527,9 @@ struct omap_dss_driver {
int (*memory_read)(struct omap_dss_device *dssdev, int (*memory_read)(struct omap_dss_device *dssdev,
void *buf, size_t size, void *buf, size_t size,
u16 x, u16 y, u16 w, u16 h); u16 x, u16 y, u16 w, u16 h);
void (*get_resolution)(struct omap_dss_device *dssdev,
u16 *xres, u16 *yres);
}; };
int omap_dss_register_driver(struct omap_dss_driver *); int omap_dss_register_driver(struct omap_dss_driver *);
...@@ -553,6 +554,8 @@ struct omap_overlay_manager *omap_dss_get_overlay_manager(int num); ...@@ -553,6 +554,8 @@ struct omap_overlay_manager *omap_dss_get_overlay_manager(int num);
int omap_dss_get_num_overlays(void); int omap_dss_get_num_overlays(void);
struct omap_overlay *omap_dss_get_overlay(int num); struct omap_overlay *omap_dss_get_overlay(int num);
void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
u16 *xres, u16 *yres);
typedef void (*omap_dispc_isr_t) (void *arg, u32 mask); typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask); int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask); int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
......
...@@ -517,7 +517,6 @@ static int taal_probe(struct omap_dss_device *dssdev) ...@@ -517,7 +517,6 @@ static int taal_probe(struct omap_dss_device *dssdev)
dev_set_drvdata(&dssdev->dev, td); dev_set_drvdata(&dssdev->dev, td);
dssdev->get_timings = taal_get_timings; dssdev->get_timings = taal_get_timings;
dssdev->get_resolution = taal_get_resolution;
/* if no platform set_backlight() defined, presume DSI backlight /* if no platform set_backlight() defined, presume DSI backlight
* control */ * control */
...@@ -990,6 +989,7 @@ static struct omap_dss_driver taal_driver = { ...@@ -990,6 +989,7 @@ static struct omap_dss_driver taal_driver = {
.resume = taal_resume, .resume = taal_resume,
.setup_update = taal_setup_update, .setup_update = taal_setup_update,
.get_resolution = taal_get_resolution,
.enable_te = taal_enable_te, .enable_te = taal_enable_te,
.wait_for_te = taal_wait_te, .wait_for_te = taal_wait_te,
.set_rotate = taal_rotate, .set_rotate = taal_rotate,
......
...@@ -811,6 +811,10 @@ int omap_dss_register_driver(struct omap_dss_driver *dssdriver) ...@@ -811,6 +811,10 @@ int omap_dss_register_driver(struct omap_dss_driver *dssdriver)
dssdriver->driver.bus = &dss_bus_type; dssdriver->driver.bus = &dss_bus_type;
dssdriver->driver.probe = dss_driver_probe; dssdriver->driver.probe = dss_driver_probe;
dssdriver->driver.remove = dss_driver_remove; dssdriver->driver.remove = dss_driver_remove;
if (dssdriver->get_resolution == NULL)
dssdriver->get_resolution = omapdss_default_get_resolution;
return driver_register(&dssdriver->driver); return driver_register(&dssdriver->driver);
} }
EXPORT_SYMBOL(omap_dss_register_driver); EXPORT_SYMBOL(omap_dss_register_driver);
......
...@@ -303,12 +303,13 @@ static struct device_attribute *display_sysfs_attrs[] = { ...@@ -303,12 +303,13 @@ static struct device_attribute *display_sysfs_attrs[] = {
NULL NULL
}; };
static void default_get_resolution(struct omap_dss_device *dssdev, void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
u16 *xres, u16 *yres) u16 *xres, u16 *yres)
{ {
*xres = dssdev->panel.timings.x_res; *xres = dssdev->panel.timings.x_res;
*yres = dssdev->panel.timings.y_res; *yres = dssdev->panel.timings.y_res;
} }
EXPORT_SYMBOL(omapdss_default_get_resolution);
void default_get_overlay_fifo_thresholds(enum omap_plane plane, void default_get_overlay_fifo_thresholds(enum omap_plane plane,
u32 fifo_size, enum omap_burst_size *burst_size, u32 fifo_size, enum omap_burst_size *burst_size,
...@@ -412,7 +413,6 @@ void dss_init_device(struct platform_device *pdev, ...@@ -412,7 +413,6 @@ void dss_init_device(struct platform_device *pdev,
return; return;
} }
dssdev->get_resolution = default_get_resolution;
dssdev->get_recommended_bpp = default_get_recommended_bpp; dssdev->get_recommended_bpp = default_get_recommended_bpp;
switch (dssdev->type) { switch (dssdev->type) {
......
...@@ -2868,7 +2868,7 @@ static int dsi_set_update_mode(struct omap_dss_device *dssdev, ...@@ -2868,7 +2868,7 @@ static int dsi_set_update_mode(struct omap_dss_device *dssdev,
DSSDBG("starting auto update\n"); DSSDBG("starting auto update\n");
dssdev->get_resolution(dssdev, &w, &h); dssdev->driver->get_resolution(dssdev, &w, &h);
dsi_set_update_region(dssdev, 0, 0, w, h); dsi_set_update_region(dssdev, 0, 0, w, h);
...@@ -3422,7 +3422,7 @@ static int dsi_display_update(struct omap_dss_device *dssdev, ...@@ -3422,7 +3422,7 @@ static int dsi_display_update(struct omap_dss_device *dssdev,
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
goto end; goto end;
dssdev->get_resolution(dssdev, &dw, &dh); dssdev->driver->get_resolution(dssdev, &dw, &dh);
if (x > dw || y > dh) if (x > dw || y > dh)
goto end; goto end;
......
...@@ -350,7 +350,7 @@ int dss_check_overlay(struct omap_overlay *ovl, struct omap_dss_device *dssdev) ...@@ -350,7 +350,7 @@ int dss_check_overlay(struct omap_overlay *ovl, struct omap_dss_device *dssdev)
return -EINVAL; return -EINVAL;
} }
dssdev->get_resolution(dssdev, &dw, &dh); dssdev->driver->get_resolution(dssdev, &dw, &dh);
DSSDBG("check_overlay %d: (%d,%d %dx%d -> %dx%d) disp (%dx%d)\n", DSSDBG("check_overlay %d: (%d,%d %dx%d -> %dx%d) disp (%dx%d)\n",
ovl->id, ovl->id,
......
...@@ -459,6 +459,8 @@ static struct omap_dss_driver venc_driver = { ...@@ -459,6 +459,8 @@ static struct omap_dss_driver venc_driver = {
.suspend = venc_panel_suspend, .suspend = venc_panel_suspend,
.resume = venc_panel_resume, .resume = venc_panel_resume,
.get_resolution = omapdss_default_get_resolution,
.driver = { .driver = {
.name = "venc", .name = "venc",
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -167,7 +167,7 @@ static int omapfb_update_window_nolock(struct fb_info *fbi, ...@@ -167,7 +167,7 @@ static int omapfb_update_window_nolock(struct fb_info *fbi,
if (w == 0 || h == 0) if (w == 0 || h == 0)
return 0; return 0;
display->get_resolution(display, &dw, &dh); display->driver->get_resolution(display, &dw, &dh);
if (x + w > dw || y + h > dh) if (x + w > dw || y + h > dh)
return -EINVAL; return -EINVAL;
...@@ -752,7 +752,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) ...@@ -752,7 +752,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
break; break;
} }
display->get_resolution(display, &xres, &yres); display->driver->get_resolution(display, &xres, &yres);
p.display_info.xres = xres; p.display_info.xres = xres;
p.display_info.yres = yres; p.display_info.yres = yres;
......
...@@ -1254,7 +1254,7 @@ static int omapfb_blank(int blank, struct fb_info *fbi) ...@@ -1254,7 +1254,7 @@ static int omapfb_blank(int blank, struct fb_info *fbi)
if (r == 0 && do_update && display->update) { if (r == 0 && do_update && display->update) {
u16 w, h; u16 w, h;
display->get_resolution(display, &w, &h); display->driver->get_resolution(display, &w, &h);
r = display->update(display, 0, 0, w, h); r = display->update(display, 0, 0, w, h);
} }
...@@ -1427,7 +1427,7 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size, ...@@ -1427,7 +1427,7 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
if (!size) { if (!size) {
u16 w, h; u16 w, h;
display->get_resolution(display, &w, &h); display->driver->get_resolution(display, &w, &h);
if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) { if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
size = max(omap_vrfb_min_phys_size(w, h, bytespp), size = max(omap_vrfb_min_phys_size(w, h, bytespp),
...@@ -1745,7 +1745,7 @@ static int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi) ...@@ -1745,7 +1745,7 @@ static int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
u16 w, h; u16 w, h;
int rotation = (var->rotate + ofbi->rotation[0]) % 4; int rotation = (var->rotate + ofbi->rotation[0]) % 4;
display->get_resolution(display, &w, &h); display->driver->get_resolution(display, &w, &h);
if (rotation == FB_ROTATE_CW || if (rotation == FB_ROTATE_CW ||
rotation == FB_ROTATE_CCW) { rotation == FB_ROTATE_CCW) {
...@@ -2197,7 +2197,8 @@ static int omapfb_probe(struct platform_device *pdev) ...@@ -2197,7 +2197,8 @@ static int omapfb_probe(struct platform_device *pdev)
def_display->set_update_mode(def_display, def_display->set_update_mode(def_display,
OMAP_DSS_UPDATE_MANUAL); OMAP_DSS_UPDATE_MANUAL);
def_display->get_resolution(def_display, &w, &h); def_display->driver->get_resolution(def_display,
&w, &h);
def_display->update(def_display, 0, 0, w, h); def_display->update(def_display, 0, 0, w, h);
#endif #endif
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册