diff options
author | Archit Taneja <archit@ti.com> | 2011-05-16 05:47:09 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-05-16 06:31:10 -0400 |
commit | 0c65622b1f92eb437d00ede920fc43b2ff2d44b7 (patch) | |
tree | 3e591a1bed30bc94d25561e75ceac4554bc31fcf /drivers/video/omap2 | |
parent | 75d7247c07d27d046323504e2dbca5b3e94fbece (diff) |
OMAP: DSS2: DSI: Get line buffer size from DSI_GNQ register
The line buffer sizes vary across DSI modules, create a function
dsi_get_line_buf_size() using DSI_GNQ register to get the size of
line buffer used for the DISPC video port data.
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r-- | drivers/video/omap2/dss/dsi.c | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 784677d088f3..345757cfcbee 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -2036,6 +2036,37 @@ static inline int dsi_get_num_data_lanes_dssdev(struct omap_dss_device *dssdev) | |||
2036 | return num_data_lanes; | 2036 | return num_data_lanes; |
2037 | } | 2037 | } |
2038 | 2038 | ||
2039 | static unsigned dsi_get_line_buf_size(struct platform_device *dsidev) | ||
2040 | { | ||
2041 | int val; | ||
2042 | |||
2043 | /* line buffer on OMAP3 is 1024 x 24bits */ | ||
2044 | /* XXX: for some reason using full buffer size causes | ||
2045 | * considerable TX slowdown with update sizes that fill the | ||
2046 | * whole buffer */ | ||
2047 | if (!dss_has_feature(FEAT_DSI_GNQ)) | ||
2048 | return 1023 * 3; | ||
2049 | |||
2050 | val = REG_GET(dsidev, DSI_GNQ, 14, 12); /* VP1_LINE_BUFFER_SIZE */ | ||
2051 | |||
2052 | switch (val) { | ||
2053 | case 1: | ||
2054 | return 512 * 3; /* 512x24 bits */ | ||
2055 | case 2: | ||
2056 | return 682 * 3; /* 682x24 bits */ | ||
2057 | case 3: | ||
2058 | return 853 * 3; /* 853x24 bits */ | ||
2059 | case 4: | ||
2060 | return 1024 * 3; /* 1024x24 bits */ | ||
2061 | case 5: | ||
2062 | return 1194 * 3; /* 1194x24 bits */ | ||
2063 | case 6: | ||
2064 | return 1365 * 3; /* 1365x24 bits */ | ||
2065 | default: | ||
2066 | BUG(); | ||
2067 | } | ||
2068 | } | ||
2069 | |||
2039 | static void dsi_set_lane_config(struct omap_dss_device *dssdev) | 2070 | static void dsi_set_lane_config(struct omap_dss_device *dssdev) |
2040 | { | 2071 | { |
2041 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 2072 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
@@ -3771,10 +3802,7 @@ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev, | |||
3771 | u32 l; | 3802 | u32 l; |
3772 | int r; | 3803 | int r; |
3773 | const unsigned channel = dsi->update_channel; | 3804 | const unsigned channel = dsi->update_channel; |
3774 | /* line buffer is 1024 x 24bits */ | 3805 | const unsigned line_buf_size = dsi_get_line_buf_size(dsidev); |
3775 | /* XXX: for some reason using full buffer size causes considerable TX | ||
3776 | * slowdown with update sizes that fill the whole buffer */ | ||
3777 | const unsigned line_buf_size = 1023 * 3; | ||
3778 | 3806 | ||
3779 | DSSDBG("dsi_update_screen_dispc(%d,%d %dx%d)\n", | 3807 | DSSDBG("dsi_update_screen_dispc(%d,%d %dx%d)\n", |
3780 | x, y, w, h); | 3808 | x, y, w, h); |