OMAP: DSS: Adding two APIs for panel-taal: check_timings and set_timings
PATCH RESEND v2 1/1 OMAP: DSS: Adding two APIs for panel-taal: check_timings and set_timings
check_timings and set_timings APIS are not present for panel-taal.
OMAPFB provides a bootarg omapfb.mode for setting mode parameters which include display, resolution, bits-per-pixel.
OMAPFB expects panel driver to have check_timings and set_timings APIs. These are checked by omapfb in case we wish to set default mode through bootargs. e.g.: omapfb.mode="lcd:864x480-16" (display device:width X height - bits per pixel)
omapfb_set_def_mode function in omapfb-main.c essentially needs these functions otherwise it would return -EINVAL and default mode sent through bootargs would be ignored.
--- drivers/video/omap2/displays/panel-taal.c | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-)
drivers/video/omap2/displays/panel-taal.c +27 -0
@@ -476,6 +476,31 @@ static void taal_get_timings(struct omap_dss_device *dssdev, *timings = dssdev->panel.timings; } +static void taal_set_timings (struct omap_dss_device *dssdev, +struct omap_video_timings *timings) +{ +/* +* TAAL panel's timing struct has only x_res and y_res +* other timing parameters are not set +*/ + dssdev->panel.timings.x_res = timings->x_res; + dssdev->panel.timings.y_res = timings->y_res; +} + +static int taal_check_timings (struct omap_dss_device *dssdev, +struct omap_video_timings *timings) +{ +/* +* TAAL panel's timing struct has only x_res and y_res +* other timing parameters are not set +*/ +if (!timings || timings->x_res != dssdev->panel.timings.x_res || + timings->y_res != dssdev->panel.timings.y_res) +return -EINVAL ; + +return 0 ; +} +static void taal_get_resolution (struct omap_dss_device *dssdev,u16 *xres,u16 *yres) {
@@ -1563,6 +1588,8 @@ static struct omap_dss_driver taal_driver = { .memory_read = taal_memory_read, .get_timings = taal_get_timings, + .set_timings = taal_set_timings, + .check_timings = taal_check_timings, .driver = { .name = "taal",
Signature · 1 line
1.7.1
Hi,
Quoted 5 lines · Mayuresh
check_timingsandset_timingsAPIS are not present for panel-taal.OMAPFB provides a bootarg omapfb.mode for setting mode parameters which include display, resolution, bits-per-pixel.
Quoted 7 lines
OMAPFB expects panel driver to have
check_timingsandset_timingsAPIs. These are checked by omapfb in case we wish to set default mode through bootargs. e.g.: omapfb.mode="lcd:864x480-16" (display device:width X height - bits per pixel)
omapfb_set_def_modefunction inomapfb-main.cessentially needs these functions otherwise it would return-EINVALand default mode sent through bootargs would be ignored.
I don't like this patch. You cannot change the timings for Taal, so those added functions look quite hacky.
The reason for this patch isn't clear from the description (it should). If I guess correctly, the point of the patch is to be able to change the default color format via boot arguments when using taal panel?
If so, I think the change should be in the omapfb driver. Perhaps the omapfb driver should:
1. check if check_timings & set_timings exist
2. if they do exist, do the same thing as the code does now
3. if they don't, use get_timings to verify that the given resolution is correct
That wouldn't be perfect either, but I guess it should do the job. But this is again something where FB framework and OMAP HW do not quite match, and we end up with hacky solution, no matter what we do. But we can try to keep the hacks in the omapfb driver =).
Tomi
Tomi,
Quoted 28 lines
-----Original Message-----
From: Valkeinen, Tomi
Sent: Wednesday, February 16, 2011 7:28 PM
To: Janorkar, Mayuresh
Cc: [email protected]
Subject: Re: [RESEND][PATCH v2] OMAP: DSS: Adding two APIs for panel-taal:check_timingsandset_timingsHi,
Quoted 3 lines · Mayuresh
check_timingsandset_timingsAPIS are not present for panel-taal.OMAPFB provides a bootarg omapfb.mode for setting mode parameters which
include display,
Quoted 4 lines
resolution, bits-per-pixel.
OMAPFB expects panel driver to have
check_timingsandset_timingsAPIs. These are checked by omapfb in case we wish to set default mode throughbootargs.
Quoted 1 line
e.g.: omapfb.mode="lcd:864x480-16" (display device:width X height - bits
per pixel)
Quoted 2 lines
omapfb_set_def_modefunction inomapfb-main.cessentially needs thesefunctions
Quoted 2 lines
otherwise it would return
-EINVALand default mode sent through bootargs would be ignored.
Quoted 6 lines
I don't like this patch. You cannot change the timings for Taal, so those added functions look quite hacky.
The reason for this patch isn't clear from the description (it should). If I guess correctly, the point of the patch is to be able to change the default color format via boot arguments when using taal panel?
The intent of this patch was ability to change bits-per-pixel of framebuffer through bootargs.
Quoted 8 lines
If so, I think the change should be in the omapfb driver. Perhaps the omapfb driver should:
1. check if
check_timings&set_timingsexist
2. if they do exist, do the same thing as the code does now
3. if they don't, useget_timingsto verify that the given resolution is correct
But that would lead to a situation in which you would set the bits-per-pixel without checking if panel supports it.
Quoted 4 lines
That wouldn't be perfect either, but I guess it should do the job. But this is again something where FB framework and OMAP HW do not quite match, and we end up with hacky solution, no matter what we do. But we can try to keep the hacks in the omapfb driver =).
OMAPFB depends a on the attached panel for configuring FB parameters. panel-generic-dpi.c it has an API dpi_check_timings which checks whether timings are supported or not. How about adding a similar API for dsi_check_timings? We would call it from panel-taal. (I do understand that timings required by taal are only xres and yres much less compared to dpi)
Quoted 3 lines
Tomi
Quoted 2 lines · Mayuresh
Tomi,
<snip>
Quoted 9 lines
Quoted 7 lines
If so, I think the change should be in the omapfb driver. Perhaps the omapfb driver should:
1. check if
check_timings&set_timingsexist
2. if they do exist, do the same thing as the code does now
3. if they don't, useget_timingsto verify that the given resolution is correctBut that would lead to a situation in which you would set the bits-per-pixel without checking if panel supports it.
You are mixing up the panel's color depth and the framebuffer's color depth. The panel has a certain color depth, and that is not changed.
The fb parameter sets up the framebuffer color depth. DISPC will convert that input color depth to 24bpp internally, and then again convert it to 16/18/24 bpp when outputting it to the panel. So fb and panel color depths are independent.
Quoted 10 lines
Quoted 4 lines
That wouldn't be perfect either, but I guess it should do the job. But this is again something where FB framework and OMAP HW do not quite match, and we end up with hacky solution, no matter what we do. But we can try to keep the hacks in the omapfb driver =).
OMAPFB depends a on the attached panel for configuring FB parameters.
panel-generic-dpi.cit has an APIdpi_check_timingswhich checks whether timings are supported or not. How about adding a similar API fordsi_check_timings? We would call it from panel-taal. (I do understand that timings required by taal are only xres and yres much less compared to dpi)
For command mode panels the xres and yres are hardcoded, you cannot change them. I don't see a reason to have a set or check function for that. Omapfb should not try to change the values, if they cannot be changed.
I think in this case omapfb should just check if the given xres/yres is correct, and use the given bpp for the framebuffer.
Tomi