Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8d78941 authored by Tomi Valkeinen's avatar Tomi Valkeinen
Browse files

OMAPDSS: convert pixel clock to common videomode style



omapdss has its own video-timings struct, but we want to move the common
videomode.

The first step is to change the omapdss's pixelclock unit from kHz to
Hz. Also, omapdss uses "pixel_clock" field name, whereas the common
videomode uses "pixelclock" field name. This patch changes the field
name also, as that makes it easy to spot any non-converted pixel_clock
uses.

Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent eba35843
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -37,7 +37,7 @@ struct omap_connector {
void copy_timings_omap_to_drm(struct drm_display_mode *mode,
void copy_timings_omap_to_drm(struct drm_display_mode *mode,
		struct omap_video_timings *timings)
		struct omap_video_timings *timings)
{
{
	mode->clock = timings->pixel_clock;
	mode->clock = timings->pixelclock / 1000;


	mode->hdisplay = timings->x_res;
	mode->hdisplay = timings->x_res;
	mode->hsync_start = mode->hdisplay + timings->hfp;
	mode->hsync_start = mode->hdisplay + timings->hfp;
@@ -68,7 +68,7 @@ void copy_timings_omap_to_drm(struct drm_display_mode *mode,
void copy_timings_drm_to_omap(struct omap_video_timings *timings,
void copy_timings_drm_to_omap(struct omap_video_timings *timings,
		struct drm_display_mode *mode)
		struct drm_display_mode *mode)
{
{
	timings->pixel_clock = mode->clock;
	timings->pixelclock = mode->clock * 1000;


	timings->x_res = mode->hdisplay;
	timings->x_res = mode->hdisplay;
	timings->hfp = mode->hsync_start - mode->hdisplay;
	timings->hfp = mode->hsync_start - mode->hdisplay;
@@ -220,7 +220,7 @@ static int omap_connector_mode_valid(struct drm_connector *connector,
	if (!r) {
	if (!r) {
		/* check if vrefresh is still valid */
		/* check if vrefresh is still valid */
		new_mode = drm_mode_duplicate(dev, mode);
		new_mode = drm_mode_duplicate(dev, mode);
		new_mode->clock = timings.pixel_clock;
		new_mode->clock = timings.pixelclock / 1000;
		new_mode->vrefresh = 0;
		new_mode->vrefresh = 0;
		if (mode->vrefresh == drm_mode_vrefresh(new_mode))
		if (mode->vrefresh == drm_mode_vrefresh(new_mode))
			ret = MODE_OK;
			ret = MODE_OK;
+1 −1
Original line number Original line Diff line number Diff line
@@ -31,7 +31,7 @@ struct panel_drv_data {
static const struct omap_video_timings tvc_pal_timings = {
static const struct omap_video_timings tvc_pal_timings = {
	.x_res		= 720,
	.x_res		= 720,
	.y_res		= 574,
	.y_res		= 574,
	.pixel_clock	= 13500,
	.pixelclock	= 13500000,
	.hsw		= 64,
	.hsw		= 64,
	.hfp		= 12,
	.hfp		= 12,
	.hbp		= 68,
	.hbp		= 68,
+1 −1
Original line number Original line Diff line number Diff line
@@ -23,7 +23,7 @@ static const struct omap_video_timings dvic_default_timings = {
	.x_res		= 640,
	.x_res		= 640,
	.y_res		= 480,
	.y_res		= 480,


	.pixel_clock	= 23500,
	.pixelclock	= 23500000,


	.hfp		= 48,
	.hfp		= 48,
	.hsw		= 32,
	.hsw		= 32,
+1 −1
Original line number Original line Diff line number Diff line
@@ -21,7 +21,7 @@
static const struct omap_video_timings hdmic_default_timings = {
static const struct omap_video_timings hdmic_default_timings = {
	.x_res		= 640,
	.x_res		= 640,
	.y_res		= 480,
	.y_res		= 480,
	.pixel_clock	= 25175,
	.pixelclock	= 25175000,
	.hsw		= 96,
	.hsw		= 96,
	.hfp		= 16,
	.hfp		= 16,
	.hbp		= 48,
	.hbp		= 48,
+1 −1
Original line number Original line Diff line number Diff line
@@ -1184,7 +1184,7 @@ static int dsicm_probe(struct platform_device *pdev)


	ddata->timings.x_res = 864;
	ddata->timings.x_res = 864;
	ddata->timings.y_res = 480;
	ddata->timings.y_res = 480;
	ddata->timings.pixel_clock = DIV_ROUND_UP(864 * 480 * 60, 1000);
	ddata->timings.pixelclock = 864 * 480 * 60;


	dssdev = &ddata->dssdev;
	dssdev = &ddata->dssdev;
	dssdev->dev = dev;
	dssdev->dev = dev;
Loading