OMAPDSS: add videomode conversion support
Add helper functions to convert between omapdss specific video timings and the common videomode. Eventually omapdss will be changed to use only the common video timings, and these helper functions will make the transition easier. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
parent
7e436bb2e3
commit
6fcd485b04
@ -1,5 +1,6 @@
|
||||
menuconfig OMAP2_DSS
|
||||
tristate "OMAP2+ Display Subsystem support"
|
||||
select VIDEOMODE_HELPERS
|
||||
help
|
||||
OMAP2+ Display Subsystem support.
|
||||
|
||||
|
@ -219,3 +219,72 @@ void omap_dss_stop_device(struct omap_dss_device *dssdev)
|
||||
}
|
||||
EXPORT_SYMBOL(omap_dss_stop_device);
|
||||
|
||||
void videomode_to_omap_video_timings(const struct videomode *vm,
|
||||
struct omap_video_timings *ovt)
|
||||
{
|
||||
memset(ovt, 0, sizeof(*ovt));
|
||||
|
||||
ovt->pixel_clock = vm->pixelclock / 1000;
|
||||
ovt->x_res = vm->hactive;
|
||||
ovt->hbp = vm->hback_porch;
|
||||
ovt->hfp = vm->hfront_porch;
|
||||
ovt->hsw = vm->hsync_len;
|
||||
ovt->y_res = vm->vactive;
|
||||
ovt->vbp = vm->vback_porch;
|
||||
ovt->vfp = vm->vfront_porch;
|
||||
ovt->vsw = vm->vsync_len;
|
||||
|
||||
ovt->vsync_level = vm->flags & DISPLAY_FLAGS_VSYNC_HIGH ?
|
||||
OMAPDSS_SIG_ACTIVE_HIGH :
|
||||
OMAPDSS_SIG_ACTIVE_LOW;
|
||||
ovt->hsync_level = vm->flags & DISPLAY_FLAGS_HSYNC_HIGH ?
|
||||
OMAPDSS_SIG_ACTIVE_HIGH :
|
||||
OMAPDSS_SIG_ACTIVE_LOW;
|
||||
ovt->de_level = vm->flags & DISPLAY_FLAGS_DE_HIGH ?
|
||||
OMAPDSS_SIG_ACTIVE_HIGH :
|
||||
OMAPDSS_SIG_ACTIVE_HIGH;
|
||||
ovt->data_pclk_edge = vm->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE ?
|
||||
OMAPDSS_DRIVE_SIG_RISING_EDGE :
|
||||
OMAPDSS_DRIVE_SIG_FALLING_EDGE;
|
||||
|
||||
ovt->sync_pclk_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES;
|
||||
}
|
||||
EXPORT_SYMBOL(videomode_to_omap_video_timings);
|
||||
|
||||
void omap_video_timings_to_videomode(const struct omap_video_timings *ovt,
|
||||
struct videomode *vm)
|
||||
{
|
||||
memset(vm, 0, sizeof(*vm));
|
||||
|
||||
vm->pixelclock = ovt->pixel_clock * 1000;
|
||||
|
||||
vm->hactive = ovt->x_res;
|
||||
vm->hback_porch = ovt->hbp;
|
||||
vm->hfront_porch = ovt->hfp;
|
||||
vm->hsync_len = ovt->hsw;
|
||||
vm->vactive = ovt->y_res;
|
||||
vm->vback_porch = ovt->vbp;
|
||||
vm->vfront_porch = ovt->vfp;
|
||||
vm->vsync_len = ovt->vsw;
|
||||
|
||||
if (ovt->hsync_level == OMAPDSS_SIG_ACTIVE_HIGH)
|
||||
vm->flags |= DISPLAY_FLAGS_HSYNC_HIGH;
|
||||
else
|
||||
vm->flags |= DISPLAY_FLAGS_HSYNC_LOW;
|
||||
|
||||
if (ovt->vsync_level == OMAPDSS_SIG_ACTIVE_HIGH)
|
||||
vm->flags |= DISPLAY_FLAGS_VSYNC_HIGH;
|
||||
else
|
||||
vm->flags |= DISPLAY_FLAGS_VSYNC_LOW;
|
||||
|
||||
if (ovt->de_level == OMAPDSS_SIG_ACTIVE_HIGH)
|
||||
vm->flags |= DISPLAY_FLAGS_DE_HIGH;
|
||||
else
|
||||
vm->flags |= DISPLAY_FLAGS_DE_LOW;
|
||||
|
||||
if (ovt->data_pclk_edge == OMAPDSS_DRIVE_SIG_RISING_EDGE)
|
||||
vm->flags |= DISPLAY_FLAGS_PIXDATA_POSEDGE;
|
||||
else
|
||||
vm->flags |= DISPLAY_FLAGS_PIXDATA_NEGEDGE;
|
||||
}
|
||||
EXPORT_SYMBOL(omap_video_timings_to_videomode);
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include <linux/device.h>
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
#include <video/videomode.h>
|
||||
|
||||
#define DISPC_IRQ_FRAMEDONE (1 << 0)
|
||||
#define DISPC_IRQ_VSYNC (1 << 1)
|
||||
#define DISPC_IRQ_EVSYNC_EVEN (1 << 2)
|
||||
@ -768,6 +770,11 @@ const char *omapdss_get_default_display_name(void);
|
||||
int omap_dss_start_device(struct omap_dss_device *dssdev);
|
||||
void omap_dss_stop_device(struct omap_dss_device *dssdev);
|
||||
|
||||
void videomode_to_omap_video_timings(const struct videomode *vm,
|
||||
struct omap_video_timings *ovt);
|
||||
void omap_video_timings_to_videomode(const struct omap_video_timings *ovt,
|
||||
struct videomode *vm);
|
||||
|
||||
int dss_feat_get_num_mgrs(void);
|
||||
int dss_feat_get_num_ovls(void);
|
||||
enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel);
|
||||
|
Loading…
Reference in New Issue
Block a user