omapdrm changes for v4.10 The main change here is the big refactoring to remove omapdrm's own 'omap_video_timings', and use the standard display timings. Besides that, a few minor fixes and cleanups.
Unified · Split
| @@ -32,6 +32,14 @@ optional properties: · 31 unmodified lines | ||
| 32 | 32 | - active low = drive pixel data on falling edge/ |
| 33 | 33 | sample data on rising edge |
| 34 | 34 | - ignored = ignored |
| 35 | + - syncclk-active: with | |
| 36 | + - active high = drive sync on rising edge/ | |
| 37 | + sample sync on falling edge of pixel | |
| 38 | + clock | |
| 39 | + - active low = drive sync on falling edge/ | |
| 40 | + sample sync on rising edge of pixel | |
| 41 | + clock | |
| 42 | + - omitted = same configuration as pixelclk-active | |
| 35 | 43 | - interlaced (bool): boolean to enable interlaced mode |
| 36 | 44 | - doublescan (bool): boolean to enable doublescan mode |
| 37 | 45 | - doubleclk (bool): boolean to enable doubleclock mode |
| @@ -24,23 +24,24 @@ struct panel_drv_data { · 23 unmodified lines | ||
| 24 | 24 | |
| 25 | 25 | struct device *dev; |
| 26 | 26 | |
| 27 | − struct omap_video_timings timings; | |
| 27 | + struct videomode vm; | |
| 28 | 28 | |
| 29 | 29 | bool invert_polarity; |
| 30 | 30 | }; |
| 31 | 31 | |
| 32 | −static const struct omap_video_timings tvc_pal_timings = { | |
| 33 | − .x_res = 720, | |
| 34 | − .y_res = 574, | |
| 32 | +static const struct videomode tvc_pal_vm = { | |
| 33 | + .hactive = 720, | |
| 34 | + .vactive = 574, | |
| 35 | 35 | .pixelclock = 13500000, |
| 36 | − .hsw = 64, | |
| 37 | − .hfp = 12, | |
| 38 | − .hbp = 68, | |
| 39 | − .vsw = 5, | |
| 40 | − .vfp = 5, | |
| 41 | − .vbp = 41, | |
| 42 | − | |
| 43 | − .interlace = true, | |
| 36 | + .hsync_len = 64, | |
| 37 | + .hfront_porch = 12, | |
| 38 | + .hback_porch = 68, | |
| 39 | + .vsync_len = 5, | |
| 40 | + .vfront_porch = 5, | |
| 41 | + .vback_porch = 41, | |
| 42 | + | |
| 43 | + .flags = DISPLAY_FLAGS_INTERLACED | DISPLAY_FLAGS_HSYNC_LOW | | |
| 44 | + DISPLAY_FLAGS_VSYNC_LOW, | |
| 44 | 45 | }; |
| 45 | 46 | |
| 46 | 47 | static const struct of_device_id tvc_of_match[]; |
| @@ -92,7 +93,7 @@ static int tvc_enable(struct omap_dss_device *dssdev) · 45 unmodified lines | ||
| 92 | 93 | if (omapdss_device_is_enabled(dssdev)) |
| 93 | 94 | return 0; |
| 94 | 95 | |
| 95 | − in->ops.atv->set_timings(in, &ddata->timings); | |
| 96 | + in->ops.atv->set_timings(in, &ddata->vm); | |
| 96 | 97 | |
| 97 | 98 | if (!ddata->dev->of_node) { |
| 98 | 99 | in->ops.atv->set_type(in, OMAP_DSS_VENC_TYPE_COMPOSITE); |
| @@ -126,32 +127,32 @@ static void tvc_disable(struct omap_dss_device *dssdev) · 27 unmodified lines | ||
| 126 | 127 | } |
| 127 | 128 | |
| 128 | 129 | static void tvc_set_timings(struct omap_dss_device *dssdev, |
| 129 | − struct omap_video_timings *timings) | |
| 130 | + struct videomode *vm) | |
| 130 | 131 | { |
| 131 | 132 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 132 | 133 | struct omap_dss_device *in = ddata->in; |
| 133 | 134 | |
| 134 | − ddata->timings = *timings; | |
| 135 | − dssdev->panel.timings = *timings; | |
| 135 | + ddata->vm = *vm; | |
| 136 | + dssdev->panel.vm = *vm; | |
| 136 | 137 | |
| 137 | − in->ops.atv->set_timings(in, timings); | |
| 138 | + in->ops.atv->set_timings(in, vm); | |
| 138 | 139 | } |
| 139 | 140 | |
| 140 | 141 | static void tvc_get_timings(struct omap_dss_device *dssdev, |
| 141 | − struct omap_video_timings *timings) | |
| 142 | + struct videomode *vm) | |
| 142 | 143 | { |
| 143 | 144 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 144 | 145 | |
| 145 | − *timings = ddata->timings; | |
| 146 | + *vm = ddata->vm; | |
| 146 | 147 | } |
| 147 | 148 | |
| 148 | 149 | static int tvc_check_timings(struct omap_dss_device *dssdev, |
| 149 | − struct omap_video_timings *timings) | |
| 150 | + struct videomode *vm) | |
| 150 | 151 | { |
| 151 | 152 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 152 | 153 | struct omap_dss_device *in = ddata->in; |
| 153 | 154 | |
| 154 | − return in->ops.atv->check_timings(in, timings); | |
| 155 | + return in->ops.atv->check_timings(in, vm); | |
| 155 | 156 | } |
| 156 | 157 | |
| 157 | 158 | static u32 tvc_get_wss(struct omap_dss_device *dssdev) |
| @@ -253,14 +254,14 @@ static int tvc_probe(struct platform_device *pdev) · 95 unmodified lines | ||
| 253 | 254 | return -ENODEV; |
| 254 | 255 | } |
| 255 | 256 | |
| 256 | − ddata->timings = tvc_pal_timings; | |
| 257 | + ddata->vm = tvc_pal_vm; | |
| 257 | 258 | |
| 258 | 259 | dssdev = &ddata->dssdev; |
| 259 | 260 | dssdev->driver = &tvc_driver; |
| 260 | 261 | dssdev->dev = &pdev->dev; |
| 261 | 262 | dssdev->type = OMAP_DISPLAY_TYPE_VENC; |
| 262 | 263 | dssdev->owner = THIS_MODULE; |
| 263 | − dssdev->panel.timings = tvc_pal_timings; | |
| 264 | + dssdev->panel.vm = tvc_pal_vm; | |
| 264 | 265 | |
| 265 | 266 | r = omapdss_register_display(dssdev); |
| 266 | 267 | if (r) { |
| @@ -19,32 +19,30 @@ · 18 unmodified lines | ||
| 19 | 19 | |
| 20 | 20 | #include "../dss/omapdss.h" |
| 21 | 21 | |
| 22 | −static const struct omap_video_timings dvic_default_timings = { | |
| 23 | − .x_res = 640, | |
| 24 | − .y_res = 480, | |
| 22 | +static const struct videomode dvic_default_vm = { | |
| 23 | + .hactive = 640, | |
| 24 | + .vactive = 480, | |
| 25 | 25 | |
| 26 | 26 | .pixelclock = 23500000, |
| 27 | 27 | |
| 28 | − .hfp = 48, | |
| 29 | − .hsw = 32, | |
| 30 | − .hbp = 80, | |
| 28 | + .hfront_porch = 48, | |
| 29 | + .hsync_len = 32, | |
| 30 | + .hback_porch = 80, | |
| 31 | 31 | |
| 32 | − .vfp = 3, | |
| 33 | − .vsw = 4, | |
| 34 | − .vbp = 7, | |
| 32 | + .vfront_porch = 3, | |
| 33 | + .vsync_len = 4, | |
| 34 | + .vback_porch = 7, | |
| 35 | 35 | |
| 36 | − .vsync_level = OMAPDSS_SIG_ACTIVE_HIGH, | |
| 37 | − .hsync_level = OMAPDSS_SIG_ACTIVE_HIGH, | |
| 38 | − .data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, | |
| 39 | − .de_level = OMAPDSS_SIG_ACTIVE_HIGH, | |
| 40 | − .sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE, | |
| 36 | + .flags = DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_HIGH | | |
| 37 | + DISPLAY_FLAGS_SYNC_NEGEDGE | DISPLAY_FLAGS_DE_HIGH | | |
| 38 | + DISPLAY_FLAGS_PIXDATA_POSEDGE, | |
| 41 | 39 | }; |
| 42 | 40 | |
| 43 | 41 | struct panel_drv_data { |
| 44 | 42 | struct omap_dss_device dssdev; |
| 45 | 43 | struct omap_dss_device *in; |
| 46 | 44 | |
| 47 | − struct omap_video_timings timings; | |
| 45 | + struct videomode vm; | |
| 48 | 46 | |
| 49 | 47 | struct i2c_adapter *i2c_adapter; |
| 50 | 48 | }; |
| @@ -90,7 +88,7 @@ static int dvic_enable(struct omap_dss_device *dssdev) · 39 unmodified lines | ||
| 90 | 88 | if (omapdss_device_is_enabled(dssdev)) |
| 91 | 89 | return 0; |
| 92 | 90 | |
| 93 | − in->ops.dvi->set_timings(in, &ddata->timings); | |
| 91 | + in->ops.dvi->set_timings(in, &ddata->vm); | |
| 94 | 92 | |
| 95 | 93 | r = in->ops.dvi->enable(in); |
| 96 | 94 | if (r) |
| @@ -115,32 +113,32 @@ static void dvic_disable(struct omap_dss_device *dssdev) · 18 unmodified lines | ||
| 115 | 113 | } |
| 116 | 114 | |
| 117 | 115 | static void dvic_set_timings(struct omap_dss_device *dssdev, |
| 118 | − struct omap_video_timings *timings) | |
| 116 | + struct videomode *vm) | |
| 119 | 117 | { |
| 120 | 118 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 121 | 119 | struct omap_dss_device *in = ddata->in; |
| 122 | 120 | |
| 123 | − ddata->timings = *timings; | |
| 124 | − dssdev->panel.timings = *timings; | |
| 121 | + ddata->vm = *vm; | |
| 122 | + dssdev->panel.vm = *vm; | |
| 125 | 123 | |
| 126 | − in->ops.dvi->set_timings(in, timings); | |
| 124 | + in->ops.dvi->set_timings(in, vm); | |
| 127 | 125 | } |
| 128 | 126 | |
| 129 | 127 | static void dvic_get_timings(struct omap_dss_device *dssdev, |
| 130 | − struct omap_video_timings *timings) | |
| 128 | + struct videomode *vm) | |
| 131 | 129 | { |
| 132 | 130 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 133 | 131 | |
| 134 | − *timings = ddata->timings; | |
| 132 | + *vm = ddata->vm; | |
| 135 | 133 | } |
| 136 | 134 | |
| 137 | 135 | static int dvic_check_timings(struct omap_dss_device *dssdev, |
| 138 | − struct omap_video_timings *timings) | |
| 136 | + struct videomode *vm) | |
| 139 | 137 | { |
| 140 | 138 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 141 | 139 | struct omap_dss_device *in = ddata->in; |
| 142 | 140 | |
| 143 | − return in->ops.dvi->check_timings(in, timings); | |
| 141 | + return in->ops.dvi->check_timings(in, vm); | |
| 144 | 142 | } |
| 145 | 143 | |
| 146 | 144 | static int dvic_ddc_read(struct i2c_adapter *adapter, |
| @@ -287,14 +285,14 @@ static int dvic_probe(struct platform_device *pdev) · 140 unmodified lines | ||
| 287 | 285 | if (r) |
| 288 | 286 | return r; |
| 289 | 287 | |
| 290 | − ddata->timings = dvic_default_timings; | |
| 288 | + ddata->vm = dvic_default_vm; | |
| 291 | 289 | |
| 292 | 290 | dssdev = &ddata->dssdev; |
| 293 | 291 | dssdev->driver = &dvic_driver; |
| 294 | 292 | dssdev->dev = &pdev->dev; |
| 295 | 293 | dssdev->type = OMAP_DISPLAY_TYPE_DVI; |
| 296 | 294 | dssdev->owner = THIS_MODULE; |
| 297 | − dssdev->panel.timings = dvic_default_timings; | |
| 295 | + dssdev->panel.vm = dvic_default_vm; | |
| 298 | 296 | |
| 299 | 297 | r = omapdss_register_display(dssdev); |
| 300 | 298 | if (r) { |
| @@ -21,21 +21,18 @@ · 20 unmodified lines | ||
| 21 | 21 | |
| 22 | 22 | #include "../dss/omapdss.h" |
| 23 | 23 | |
| 24 | −static const struct omap_video_timings hdmic_default_timings = { | |
| 25 | − .x_res = 640, | |
| 26 | − .y_res = 480, | |
| 24 | +static const struct videomode hdmic_default_vm = { | |
| 25 | + .hactive = 640, | |
| 26 | + .vactive = 480, | |
| 27 | 27 | .pixelclock = 25175000, |
| 28 | − .hsw = 96, | |
| 29 | − .hfp = 16, | |
| 30 | − .hbp = 48, | |
| 31 | − .vsw = 2, | |
| 32 | − .vfp = 11, | |
| 33 | − .vbp = 31, | |
| 34 | − | |
| 35 | − .vsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 36 | − .hsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 37 | − | |
| 38 | − .interlace = false, | |
| 28 | + .hsync_len = 96, | |
| 29 | + .hfront_porch = 16, | |
| 30 | + .hback_porch = 48, | |
| 31 | + .vsync_len = 2, | |
| 32 | + .vfront_porch = 11, | |
| 33 | + .vback_porch = 31, | |
| 34 | + | |
| 35 | + .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW, | |
| 39 | 36 | }; |
| 40 | 37 | |
| 41 | 38 | struct panel_drv_data { |
| @@ -44,7 +41,7 @@ struct panel_drv_data { · 2 unmodified lines | ||
| 44 | 41 | |
| 45 | 42 | struct device *dev; |
| 46 | 43 | |
| 47 | − struct omap_video_timings timings; | |
| 44 | + struct videomode vm; | |
| 48 | 45 | |
| 49 | 46 | int hpd_gpio; |
| 50 | 47 | }; |
| @@ -96,7 +93,7 @@ static int hdmic_enable(struct omap_dss_device *dssdev) · 45 unmodified lines | ||
| 96 | 93 | if (omapdss_device_is_enabled(dssdev)) |
| 97 | 94 | return 0; |
| 98 | 95 | |
| 99 | − in->ops.hdmi->set_timings(in, &ddata->timings); | |
| 96 | + in->ops.hdmi->set_timings(in, &ddata->vm); | |
| 100 | 97 | |
| 101 | 98 | r = in->ops.hdmi->enable(in); |
| 102 | 99 | if (r) |
| @@ -123,32 +120,32 @@ static void hdmic_disable(struct omap_dss_device *dssdev) · 20 unmodified lines | ||
| 123 | 120 | } |
| 124 | 121 | |
| 125 | 122 | static void hdmic_set_timings(struct omap_dss_device *dssdev, |
| 126 | − struct omap_video_timings *timings) | |
| 123 | + struct videomode *vm) | |
| 127 | 124 | { |
| 128 | 125 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 129 | 126 | struct omap_dss_device *in = ddata->in; |
| 130 | 127 | |
| 131 | − ddata->timings = *timings; | |
| 132 | − dssdev->panel.timings = *timings; | |
| 128 | + ddata->vm = *vm; | |
| 129 | + dssdev->panel.vm = *vm; | |
| 133 | 130 | |
| 134 | − in->ops.hdmi->set_timings(in, timings); | |
| 131 | + in->ops.hdmi->set_timings(in, vm); | |
| 135 | 132 | } |
| 136 | 133 | |
| 137 | 134 | static void hdmic_get_timings(struct omap_dss_device *dssdev, |
| 138 | − struct omap_video_timings *timings) | |
| 135 | + struct videomode *vm) | |
| 139 | 136 | { |
| 140 | 137 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 141 | 138 | |
| 142 | − *timings = ddata->timings; | |
| 139 | + *vm = ddata->vm; | |
| 143 | 140 | } |
| 144 | 141 | |
| 145 | 142 | static int hdmic_check_timings(struct omap_dss_device *dssdev, |
| 146 | − struct omap_video_timings *timings) | |
| 143 | + struct videomode *vm) | |
| 147 | 144 | { |
| 148 | 145 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 149 | 146 | struct omap_dss_device *in = ddata->in; |
| 150 | 147 | |
| 151 | − return in->ops.hdmi->check_timings(in, timings); | |
| 148 | + return in->ops.hdmi->check_timings(in, vm); | |
| 152 | 149 | } |
| 153 | 150 | |
| 154 | 151 | static int hdmic_read_edid(struct omap_dss_device *dssdev, |
| @@ -259,14 +256,14 @@ static int hdmic_probe(struct platform_device *pdev) · 104 unmodified lines | ||
| 259 | 256 | goto err_reg; |
| 260 | 257 | } |
| 261 | 258 | |
| 262 | − ddata->timings = hdmic_default_timings; | |
| 259 | + ddata->vm = hdmic_default_vm; | |
| 263 | 260 | |
| 264 | 261 | dssdev = &ddata->dssdev; |
| 265 | 262 | dssdev->driver = &hdmic_driver; |
| 266 | 263 | dssdev->dev = &pdev->dev; |
| 267 | 264 | dssdev->type = OMAP_DISPLAY_TYPE_HDMI; |
| 268 | 265 | dssdev->owner = THIS_MODULE; |
| 269 | − dssdev->panel.timings = hdmic_default_timings; | |
| 266 | + dssdev->panel.vm = hdmic_default_vm; | |
| 270 | 267 | |
| 271 | 268 | r = omapdss_register_display(dssdev); |
| 272 | 269 | if (r) { |
| @@ -27,7 +27,7 @@ struct panel_drv_data { · 26 unmodified lines | ||
| 27 | 27 | |
| 28 | 28 | struct gpio_desc *enable_gpio; |
| 29 | 29 | |
| 30 | − struct omap_video_timings timings; | |
| 30 | + struct videomode vm; | |
| 31 | 31 | }; |
| 32 | 32 | |
| 33 | 33 | #define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev) |
| @@ -90,7 +90,7 @@ static int opa362_enable(struct omap_dss_device *dssdev) · 56 unmodified lines | ||
| 90 | 90 | if (omapdss_device_is_enabled(dssdev)) |
| 91 | 91 | return 0; |
| 92 | 92 | |
| 93 | − in->ops.atv->set_timings(in, &ddata->timings); | |
| 93 | + in->ops.atv->set_timings(in, &ddata->vm); | |
| 94 | 94 | |
| 95 | 95 | r = in->ops.atv->enable(in); |
| 96 | 96 | if (r) |
| @@ -123,38 +123,38 @@ static void opa362_disable(struct omap_dss_device *dssdev) · 26 unmodified lines | ||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | static void opa362_set_timings(struct omap_dss_device *dssdev, |
| 126 | − struct omap_video_timings *timings) | |
| 126 | + struct videomode *vm) | |
| 127 | 127 | { |
| 128 | 128 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 129 | 129 | struct omap_dss_device *in = ddata->in; |
| 130 | 130 | |
| 131 | 131 | dev_dbg(dssdev->dev, "set_timings\n"); |
| 132 | 132 | |
| 133 | − ddata->timings = *timings; | |
| 134 | − dssdev->panel.timings = *timings; | |
| 133 | + ddata->vm = *vm; | |
| 134 | + dssdev->panel.vm = *vm; | |
| 135 | 135 | |
| 136 | − in->ops.atv->set_timings(in, timings); | |
| 136 | + in->ops.atv->set_timings(in, vm); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | static void opa362_get_timings(struct omap_dss_device *dssdev, |
| 140 | − struct omap_video_timings *timings) | |
| 140 | + struct videomode *vm) | |
| 141 | 141 | { |
| 142 | 142 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 143 | 143 | |
| 144 | 144 | dev_dbg(dssdev->dev, "get_timings\n"); |
| 145 | 145 | |
| 146 | − *timings = ddata->timings; | |
| 146 | + *vm = ddata->vm; | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | static int opa362_check_timings(struct omap_dss_device *dssdev, |
| 150 | − struct omap_video_timings *timings) | |
| 150 | + struct videomode *vm) | |
| 151 | 151 | { |
| 152 | 152 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 153 | 153 | struct omap_dss_device *in = ddata->in; |
| 154 | 154 | |
| 155 | 155 | dev_dbg(dssdev->dev, "check_timings\n"); |
| 156 | 156 | |
| 157 | − return in->ops.atv->check_timings(in, timings); | |
| 157 | + return in->ops.atv->check_timings(in, vm); | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | static void opa362_set_type(struct omap_dss_device *dssdev, |
| @@ -24,7 +24,7 @@ struct panel_drv_data { · 23 unmodified lines | ||
| 24 | 24 | int pd_gpio; |
| 25 | 25 | int data_lines; |
| 26 | 26 | |
| 27 | − struct omap_video_timings timings; | |
| 27 | + struct videomode vm; | |
| 28 | 28 | }; |
| 29 | 29 | |
| 30 | 30 | #define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev) |
| @@ -81,7 +81,7 @@ static int tfp410_enable(struct omap_dss_device *dssdev) · 50 unmodified lines | ||
| 81 | 81 | if (omapdss_device_is_enabled(dssdev)) |
| 82 | 82 | return 0; |
| 83 | 83 | |
| 84 | − in->ops.dpi->set_timings(in, &ddata->timings); | |
| 84 | + in->ops.dpi->set_timings(in, &ddata->vm); | |
| 85 | 85 | if (ddata->data_lines) |
| 86 | 86 | in->ops.dpi->set_data_lines(in, ddata->data_lines); |
| 87 | 87 | |
| @@ -113,44 +113,43 @@ static void tfp410_disable(struct omap_dss_device *dssdev) · 25 unmodified lines | ||
| 113 | 113 | dssdev->state = OMAP_DSS_DISPLAY_DISABLED; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | −static void tfp410_fix_timings(struct omap_video_timings *timings) | |
| 116 | +static void tfp410_fix_timings(struct videomode *vm) | |
| 117 | 117 | { |
| 118 | − timings->data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; | |
| 119 | − timings->sync_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; | |
| 120 | − timings->de_level = OMAPDSS_SIG_ACTIVE_HIGH; | |
| 118 | + vm->flags |= DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE | | |
| 119 | + DISPLAY_FLAGS_SYNC_POSEDGE; | |
| 121 | 120 | } |
| 122 | 121 | |
| 123 | 122 | static void tfp410_set_timings(struct omap_dss_device *dssdev, |
| 124 | − struct omap_video_timings *timings) | |
| 123 | + struct videomode *vm) | |
| 125 | 124 | { |
| 126 | 125 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 127 | 126 | struct omap_dss_device *in = ddata->in; |
| 128 | 127 | |
| 129 | − tfp410_fix_timings(timings); | |
| 128 | + tfp410_fix_timings(vm); | |
| 130 | 129 | |
| 131 | − ddata->timings = *timings; | |
| 132 | − dssdev->panel.timings = *timings; | |
| 130 | + ddata->vm = *vm; | |
| 131 | + dssdev->panel.vm = *vm; | |
| 133 | 132 | |
| 134 | − in->ops.dpi->set_timings(in, timings); | |
| 133 | + in->ops.dpi->set_timings(in, vm); | |
| 135 | 134 | } |
| 136 | 135 | |
| 137 | 136 | static void tfp410_get_timings(struct omap_dss_device *dssdev, |
| 138 | − struct omap_video_timings *timings) | |
| 137 | + struct videomode *vm) | |
| 139 | 138 | { |
| 140 | 139 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 141 | 140 | |
| 142 | − *timings = ddata->timings; | |
| 141 | + *vm = ddata->vm; | |
| 143 | 142 | } |
| 144 | 143 | |
| 145 | 144 | static int tfp410_check_timings(struct omap_dss_device *dssdev, |
| 146 | − struct omap_video_timings *timings) | |
| 145 | + struct videomode *vm) | |
| 147 | 146 | { |
| 148 | 147 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 149 | 148 | struct omap_dss_device *in = ddata->in; |
| 150 | 149 | |
| 151 | − tfp410_fix_timings(timings); | |
| 150 | + tfp410_fix_timings(vm); | |
| 152 | 151 | |
| 153 | − return in->ops.dpi->check_timings(in, timings); | |
| 152 | + return in->ops.dpi->check_timings(in, vm); | |
| 154 | 153 | } |
| 155 | 154 | |
| 156 | 155 | static const struct omapdss_dvi_ops tfp410_dvi_ops = { |
| @@ -26,7 +26,7 @@ struct panel_drv_data { · 25 unmodified lines | ||
| 26 | 26 | struct gpio_desc *ls_oe_gpio; |
| 27 | 27 | struct gpio_desc *hpd_gpio; |
| 28 | 28 | |
| 29 | − struct omap_video_timings timings; | |
| 29 | + struct videomode vm; | |
| 30 | 30 | }; |
| 31 | 31 | |
| 32 | 32 | #define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev) |
| @@ -80,7 +80,7 @@ static int tpd_enable(struct omap_dss_device *dssdev) · 47 unmodified lines | ||
| 80 | 80 | if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) |
| 81 | 81 | return 0; |
| 82 | 82 | |
| 83 | − in->ops.hdmi->set_timings(in, &ddata->timings); | |
| 83 | + in->ops.hdmi->set_timings(in, &ddata->vm); | |
| 84 | 84 | |
| 85 | 85 | r = in->ops.hdmi->enable(in); |
| 86 | 86 | if (r) |
| @@ -105,33 +105,33 @@ static void tpd_disable(struct omap_dss_device *dssdev) · 18 unmodified lines | ||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | static void tpd_set_timings(struct omap_dss_device *dssdev, |
| 108 | − struct omap_video_timings *timings) | |
| 108 | + struct videomode *vm) | |
| 109 | 109 | { |
| 110 | 110 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 111 | 111 | struct omap_dss_device *in = ddata->in; |
| 112 | 112 | |
| 113 | − ddata->timings = *timings; | |
| 114 | − dssdev->panel.timings = *timings; | |
| 113 | + ddata->vm = *vm; | |
| 114 | + dssdev->panel.vm = *vm; | |
| 115 | 115 | |
| 116 | − in->ops.hdmi->set_timings(in, timings); | |
| 116 | + in->ops.hdmi->set_timings(in, vm); | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | static void tpd_get_timings(struct omap_dss_device *dssdev, |
| 120 | − struct omap_video_timings *timings) | |
| 120 | + struct videomode *vm) | |
| 121 | 121 | { |
| 122 | 122 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 123 | 123 | |
| 124 | − *timings = ddata->timings; | |
| 124 | + *vm = ddata->vm; | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | static int tpd_check_timings(struct omap_dss_device *dssdev, |
| 128 | − struct omap_video_timings *timings) | |
| 128 | + struct videomode *vm) | |
| 129 | 129 | { |
| 130 | 130 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 131 | 131 | struct omap_dss_device *in = ddata->in; |
| 132 | 132 | int r; |
| 133 | 133 | |
| 134 | − r = in->ops.hdmi->check_timings(in, timings); | |
| 134 | + r = in->ops.hdmi->check_timings(in, vm); | |
| 135 | 135 | |
| 136 | 136 | return r; |
| 137 | 137 | } |
| @@ -28,7 +28,7 @@ struct panel_drv_data { · 27 unmodified lines | ||
| 28 | 28 | |
| 29 | 29 | int data_lines; |
| 30 | 30 | |
| 31 | − struct omap_video_timings videomode; | |
| 31 | + struct videomode vm; | |
| 32 | 32 | |
| 33 | 33 | /* used for non-DT boot, to be removed */ |
| 34 | 34 | int backlight_gpio; |
| @@ -80,7 +80,7 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev) · 45 unmodified lines | ||
| 80 | 80 | |
| 81 | 81 | if (ddata->data_lines) |
| 82 | 82 | in->ops.dpi->set_data_lines(in, ddata->data_lines); |
| 83 | − in->ops.dpi->set_timings(in, &ddata->videomode); | |
| 83 | + in->ops.dpi->set_timings(in, &ddata->vm); | |
| 84 | 84 | |
| 85 | 85 | r = in->ops.dpi->enable(in); |
| 86 | 86 | if (r) |
| @@ -122,32 +122,32 @@ static void panel_dpi_disable(struct omap_dss_device *dssdev) · 35 unmodified lines | ||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | static void panel_dpi_set_timings(struct omap_dss_device *dssdev, |
| 125 | − struct omap_video_timings *timings) | |
| 125 | + struct videomode *vm) | |
| 126 | 126 | { |
| 127 | 127 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 128 | 128 | struct omap_dss_device *in = ddata->in; |
| 129 | 129 | |
| 130 | − ddata->videomode = *timings; | |
| 131 | − dssdev->panel.timings = *timings; | |
| 130 | + ddata->vm = *vm; | |
| 131 | + dssdev->panel.vm = *vm; | |
| 132 | 132 | |
| 133 | − in->ops.dpi->set_timings(in, timings); | |
| 133 | + in->ops.dpi->set_timings(in, vm); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | static void panel_dpi_get_timings(struct omap_dss_device *dssdev, |
| 137 | − struct omap_video_timings *timings) | |
| 137 | + struct videomode *vm) | |
| 138 | 138 | { |
| 139 | 139 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 140 | 140 | |
| 141 | − *timings = ddata->videomode; | |
| 141 | + *vm = ddata->vm; | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | static int panel_dpi_check_timings(struct omap_dss_device *dssdev, |
| 145 | − struct omap_video_timings *timings) | |
| 145 | + struct videomode *vm) | |
| 146 | 146 | { |
| 147 | 147 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 148 | 148 | struct omap_dss_device *in = ddata->in; |
| 149 | 149 | |
| 150 | − return in->ops.dpi->check_timings(in, timings); | |
| 150 | + return in->ops.dpi->check_timings(in, vm); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | static struct omap_dss_driver panel_dpi_ops = { |
| @@ -169,7 +169,6 @@ static int panel_dpi_probe_pdata(struct platform_device *pdev) · 15 unmodified lines | ||
| 169 | 169 | const struct panel_dpi_platform_data *pdata; |
| 170 | 170 | struct panel_drv_data *ddata = platform_get_drvdata(pdev); |
| 171 | 171 | struct omap_dss_device *dssdev, *in; |
| 172 | − struct videomode vm; | |
| 173 | 172 | int r; |
| 174 | 173 | |
| 175 | 174 | pdata = dev_get_platdata(&pdev->dev); |
| @@ -185,8 +184,7 @@ static int panel_dpi_probe_pdata(struct platform_device *pdev) · 9 unmodified lines | ||
| 185 | 184 | |
| 186 | 185 | ddata->data_lines = pdata->data_lines; |
| 187 | 186 | |
| 188 | − videomode_from_timing(pdata->display_timing, &vm); | |
| 189 | − videomode_to_omap_video_timings(&vm, &ddata->videomode); | |
| 187 | + videomode_from_timing(pdata->display_timing, &ddata->vm); | |
| 190 | 188 | |
| 191 | 189 | dssdev = &ddata->dssdev; |
| 192 | 190 | dssdev->name = pdata->name; |
| @@ -214,7 +212,6 @@ static int panel_dpi_probe_of(struct platform_device *pdev) · 21 unmodified lines | ||
| 214 | 212 | struct omap_dss_device *in; |
| 215 | 213 | int r; |
| 216 | 214 | struct display_timing timing; |
| 217 | − struct videomode vm; | |
| 218 | 215 | struct gpio_desc *gpio; |
| 219 | 216 | |
| 220 | 217 | gpio = devm_gpiod_get_optional(&pdev->dev, "enable", GPIOD_OUT_LOW); |
| @@ -245,8 +242,7 @@ static int panel_dpi_probe_of(struct platform_device *pdev) · 24 unmodified lines | ||
| 245 | 242 | return r; |
| 246 | 243 | } |
| 247 | 244 | |
| 248 | − videomode_from_timing(&timing, &vm); | |
| 249 | − videomode_to_omap_video_timings(&vm, &ddata->videomode); | |
| 245 | + videomode_from_timing(&timing, &ddata->vm); | |
| 250 | 246 | |
| 251 | 247 | in = omapdss_of_find_source_for_first_ep(node); |
| 252 | 248 | if (IS_ERR(in)) { |
| @@ -295,7 +291,7 @@ static int panel_dpi_probe(struct platform_device *pdev) · 42 unmodified lines | ||
| 295 | 291 | dssdev->driver = &panel_dpi_ops; |
| 296 | 292 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; |
| 297 | 293 | dssdev->owner = THIS_MODULE; |
| 298 | − dssdev->panel.timings = ddata->videomode; | |
| 294 | + dssdev->panel.vm = ddata->vm; | |
| 299 | 295 | dssdev->phy.dpi.data_lines = ddata->data_lines; |
| 300 | 296 | |
| 301 | 297 | r = omapdss_register_display(dssdev); |
| @@ -42,7 +42,7 @@ struct panel_drv_data { · 41 unmodified lines | ||
| 42 | 42 | struct omap_dss_device dssdev; |
| 43 | 43 | struct omap_dss_device *in; |
| 44 | 44 | |
| 45 | − struct omap_video_timings timings; | |
| 45 | + struct videomode vm; | |
| 46 | 46 | |
| 47 | 47 | struct platform_device *pdev; |
| 48 | 48 | |
| @@ -382,8 +382,8 @@ static const struct backlight_ops dsicm_bl_ops = { · 333 unmodified lines | ||
| 382 | 382 | static void dsicm_get_resolution(struct omap_dss_device *dssdev, |
| 383 | 383 | u16 *xres, u16 *yres) |
| 384 | 384 | { |
| 385 | − *xres = dssdev->panel.timings.x_res; | |
| 386 | − *yres = dssdev->panel.timings.y_res; | |
| 385 | + *xres = dssdev->panel.vm.hactive; | |
| 386 | + *yres = dssdev->panel.vm.vactive; | |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | static ssize_t dsicm_num_errors_show(struct device *dev, |
| @@ -589,7 +589,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) · 199 unmodified lines | ||
| 589 | 589 | struct omap_dss_dsi_config dsi_config = { |
| 590 | 590 | .mode = OMAP_DSS_DSI_CMD_MODE, |
| 591 | 591 | .pixel_format = OMAP_DSS_DSI_FMT_RGB888, |
| 592 | − .timings = &ddata->timings, | |
| 592 | + .vm = &ddata->vm, | |
| 593 | 593 | .hs_clk_min = 150000000, |
| 594 | 594 | .hs_clk_max = 300000000, |
| 595 | 595 | .lp_clk_min = 7000000, |
| @@ -892,8 +892,8 @@ static int dsicm_update(struct omap_dss_device *dssdev, · 296 unmodified lines | ||
| 892 | 892 | |
| 893 | 893 | /* XXX no need to send this every frame, but dsi break if not done */ |
| 894 | 894 | r = dsicm_set_update_window(ddata, 0, 0, |
| 895 | − dssdev->panel.timings.x_res, | |
| 896 | − dssdev->panel.timings.y_res); | |
| 895 | + dssdev->panel.vm.hactive, | |
| 896 | + dssdev->panel.vm.vactive); | |
| 897 | 897 | if (r) |
| 898 | 898 | goto err; |
| 899 | 899 | |
| @@ -1023,9 +1023,8 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, · 123 unmodified lines | ||
| 1023 | 1023 | goto err1; |
| 1024 | 1024 | } |
| 1025 | 1025 | |
| 1026 | − size = min(w * h * 3, | |
| 1027 | − dssdev->panel.timings.x_res * | |
| 1028 | − dssdev->panel.timings.y_res * 3); | |
| 1026 | + size = min((u32)w * h * 3, | |
| 1027 | + dssdev->panel.vm.hactive * dssdev->panel.vm.vactive * 3); | |
| 1029 | 1028 | |
| 1030 | 1029 | in->ops.dsi->bus_lock(in); |
| 1031 | 1030 | |
| @@ -1186,14 +1185,14 @@ static int dsicm_probe(struct platform_device *pdev) · 154 unmodified lines | ||
| 1186 | 1185 | if (r) |
| 1187 | 1186 | return r; |
| 1188 | 1187 | |
| 1189 | − ddata->timings.x_res = 864; | |
| 1190 | − ddata->timings.y_res = 480; | |
| 1191 | − ddata->timings.pixelclock = 864 * 480 * 60; | |
| 1188 | + ddata->vm.hactive = 864; | |
| 1189 | + ddata->vm.vactive = 480; | |
| 1190 | + ddata->vm.pixelclock = 864 * 480 * 60; | |
| 1192 | 1191 | |
| 1193 | 1192 | dssdev = &ddata->dssdev; |
| 1194 | 1193 | dssdev->dev = dev; |
| 1195 | 1194 | dssdev->driver = &dsicm_ops; |
| 1196 | − dssdev->panel.timings = ddata->timings; | |
| 1195 | + dssdev->panel.vm = ddata->vm; | |
| 1197 | 1196 | dssdev->type = OMAP_DISPLAY_TYPE_DSI; |
| 1198 | 1197 | dssdev->owner = THIS_MODULE; |
| 1199 | 1198 | |
| @@ -19,25 +19,28 @@ · 18 unmodified lines | ||
| 19 | 19 | |
| 20 | 20 | #include "../dss/omapdss.h" |
| 21 | 21 | |
| 22 | −static struct omap_video_timings lb035q02_timings = { | |
| 23 | − .x_res = 320, | |
| 24 | − .y_res = 240, | |
| 22 | +static struct videomode lb035q02_vm = { | |
| 23 | + .hactive = 320, | |
| 24 | + .vactive = 240, | |
| 25 | 25 | |
| 26 | 26 | .pixelclock = 6500000, |
| 27 | 27 | |
| 28 | − .hsw = 2, | |
| 29 | − .hfp = 20, | |
| 30 | − .hbp = 68, | |
| 31 | − | |
| 32 | − .vsw = 2, | |
| 33 | − .vfp = 4, | |
| 34 | − .vbp = 18, | |
| 35 | − | |
| 36 | − .vsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 37 | − .hsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 38 | − .data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, | |
| 39 | − .de_level = OMAPDSS_SIG_ACTIVE_HIGH, | |
| 40 | − .sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE, | |
| 28 | + .hsync_len = 2, | |
| 29 | + .hfront_porch = 20, | |
| 30 | + .hback_porch = 68, | |
| 31 | + | |
| 32 | + .vsync_len = 2, | |
| 33 | + .vfront_porch = 4, | |
| 34 | + .vback_porch = 18, | |
| 35 | + | |
| 36 | + .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW | | |
| 37 | + DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_SYNC_NEGEDGE | | |
| 38 | + DISPLAY_FLAGS_PIXDATA_POSEDGE, | |
| 39 | + /* | |
| 40 | + * Note: According to the panel documentation: | |
| 41 | + * DE is active LOW | |
| 42 | + * DATA needs to be driven on the FALLING edge | |
| 43 | + */ | |
| 41 | 44 | }; |
| 42 | 45 | |
| 43 | 46 | struct panel_drv_data { |
| @@ -48,7 +51,7 @@ struct panel_drv_data { · 4 unmodified lines | ||
| 48 | 51 | |
| 49 | 52 | int data_lines; |
| 50 | 53 | |
| 51 | − struct omap_video_timings videomode; | |
| 54 | + struct videomode vm; | |
| 52 | 55 | |
| 53 | 56 | struct gpio_desc *enable_gpio; |
| 54 | 57 | }; |
| @@ -158,7 +161,7 @@ static int lb035q02_enable(struct omap_dss_device *dssdev) · 103 unmodified lines | ||
| 158 | 161 | |
| 159 | 162 | if (ddata->data_lines) |
| 160 | 163 | in->ops.dpi->set_data_lines(in, ddata->data_lines); |
| 161 | − in->ops.dpi->set_timings(in, &ddata->videomode); | |
| 164 | + in->ops.dpi->set_timings(in, &ddata->vm); | |
| 162 | 165 | |
| 163 | 166 | r = in->ops.dpi->enable(in); |
| 164 | 167 | if (r) |
| @@ -189,32 +192,32 @@ static void lb035q02_disable(struct omap_dss_device *dssdev) · 24 unmodified lines | ||
| 189 | 192 | } |
| 190 | 193 | |
| 191 | 194 | static void lb035q02_set_timings(struct omap_dss_device *dssdev, |
| 192 | − struct omap_video_timings *timings) | |
| 195 | + struct videomode *vm) | |
| 193 | 196 | { |
| 194 | 197 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 195 | 198 | struct omap_dss_device *in = ddata->in; |
| 196 | 199 | |
| 197 | − ddata->videomode = *timings; | |
| 198 | − dssdev->panel.timings = *timings; | |
| 200 | + ddata->vm = *vm; | |
| 201 | + dssdev->panel.vm = *vm; | |
| 199 | 202 | |
| 200 | − in->ops.dpi->set_timings(in, timings); | |
| 203 | + in->ops.dpi->set_timings(in, vm); | |
| 201 | 204 | } |
| 202 | 205 | |
| 203 | 206 | static void lb035q02_get_timings(struct omap_dss_device *dssdev, |
| 204 | − struct omap_video_timings *timings) | |
| 207 | + struct videomode *vm) | |
| 205 | 208 | { |
| 206 | 209 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 207 | 210 | |
| 208 | − *timings = ddata->videomode; | |
| 211 | + *vm = ddata->vm; | |
| 209 | 212 | } |
| 210 | 213 | |
| 211 | 214 | static int lb035q02_check_timings(struct omap_dss_device *dssdev, |
| 212 | − struct omap_video_timings *timings) | |
| 215 | + struct videomode *vm) | |
| 213 | 216 | { |
| 214 | 217 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 215 | 218 | struct omap_dss_device *in = ddata->in; |
| 216 | 219 | |
| 217 | − return in->ops.dpi->check_timings(in, timings); | |
| 220 | + return in->ops.dpi->check_timings(in, vm); | |
| 218 | 221 | } |
| 219 | 222 | |
| 220 | 223 | static struct omap_dss_driver lb035q02_ops = { |
| @@ -278,14 +281,14 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi) · 57 unmodified lines | ||
| 278 | 281 | if (r) |
| 279 | 282 | return r; |
| 280 | 283 | |
| 281 | − ddata->videomode = lb035q02_timings; | |
| 284 | + ddata->vm = lb035q02_vm; | |
| 282 | 285 | |
| 283 | 286 | dssdev = &ddata->dssdev; |
| 284 | 287 | dssdev->dev = &spi->dev; |
| 285 | 288 | dssdev->driver = &lb035q02_ops; |
| 286 | 289 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; |
| 287 | 290 | dssdev->owner = THIS_MODULE; |
| 288 | − dssdev->panel.timings = ddata->videomode; | |
| 291 | + dssdev->panel.vm = ddata->vm; | |
| 289 | 292 | dssdev->phy.dpi.data_lines = ddata->data_lines; |
| 290 | 293 | |
| 291 | 294 | r = omapdss_register_display(dssdev); |
| @@ -23,7 +23,7 @@ struct panel_drv_data { · 22 unmodified lines | ||
| 23 | 23 | struct omap_dss_device dssdev; |
| 24 | 24 | struct omap_dss_device *in; |
| 25 | 25 | |
| 26 | − struct omap_video_timings videomode; | |
| 26 | + struct videomode vm; | |
| 27 | 27 | |
| 28 | 28 | int data_lines; |
| 29 | 29 | |
| @@ -65,22 +65,20 @@ static const struct { · 35 unmodified lines | ||
| 65 | 65 | { 156, 0x00 }, { 157, 0x00 }, { 2, 0x00 }, |
| 66 | 66 | }; |
| 67 | 67 | |
| 68 | −static const struct omap_video_timings nec_8048_panel_timings = { | |
| 69 | − .x_res = LCD_XRES, | |
| 70 | − .y_res = LCD_YRES, | |
| 68 | +static const struct videomode nec_8048_panel_vm = { | |
| 69 | + .hactive = LCD_XRES, | |
| 70 | + .vactive = LCD_YRES, | |
| 71 | 71 | .pixelclock = LCD_PIXEL_CLOCK, |
| 72 | − .hfp = 6, | |
| 73 | − .hsw = 1, | |
| 74 | − .hbp = 4, | |
| 75 | − .vfp = 3, | |
| 76 | − .vsw = 1, | |
| 77 | − .vbp = 4, | |
| 78 | − | |
| 79 | − .vsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 80 | − .hsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 81 | − .data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, | |
| 82 | − .de_level = OMAPDSS_SIG_ACTIVE_HIGH, | |
| 83 | − .sync_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, | |
| 72 | + .hfront_porch = 6, | |
| 73 | + .hsync_len = 1, | |
| 74 | + .hback_porch = 4, | |
| 75 | + .vfront_porch = 3, | |
| 76 | + .vsync_len = 1, | |
| 77 | + .vback_porch = 4, | |
| 78 | + | |
| 79 | + .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW | | |
| 80 | + DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_SYNC_POSEDGE | | |
| 81 | + DISPLAY_FLAGS_PIXDATA_POSEDGE, | |
| 84 | 82 | }; |
| 85 | 83 | |
| 86 | 84 | #define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev) |
| @@ -157,7 +155,7 @@ static int nec_8048_enable(struct omap_dss_device *dssdev) · 70 unmodified lines | ||
| 157 | 155 | |
| 158 | 156 | if (ddata->data_lines) |
| 159 | 157 | in->ops.dpi->set_data_lines(in, ddata->data_lines); |
| 160 | − in->ops.dpi->set_timings(in, &ddata->videomode); | |
| 158 | + in->ops.dpi->set_timings(in, &ddata->vm); | |
| 161 | 159 | |
| 162 | 160 | r = in->ops.dpi->enable(in); |
| 163 | 161 | if (r) |
| @@ -188,32 +186,32 @@ static void nec_8048_disable(struct omap_dss_device *dssdev) · 24 unmodified lines | ||
| 188 | 186 | } |
| 189 | 187 | |
| 190 | 188 | static void nec_8048_set_timings(struct omap_dss_device *dssdev, |
| 191 | − struct omap_video_timings *timings) | |
| 189 | + struct videomode *vm) | |
| 192 | 190 | { |
| 193 | 191 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 194 | 192 | struct omap_dss_device *in = ddata->in; |
| 195 | 193 | |
| 196 | − ddata->videomode = *timings; | |
| 197 | − dssdev->panel.timings = *timings; | |
| 194 | + ddata->vm = *vm; | |
| 195 | + dssdev->panel.vm = *vm; | |
| 198 | 196 | |
| 199 | − in->ops.dpi->set_timings(in, timings); | |
| 197 | + in->ops.dpi->set_timings(in, vm); | |
| 200 | 198 | } |
| 201 | 199 | |
| 202 | 200 | static void nec_8048_get_timings(struct omap_dss_device *dssdev, |
| 203 | − struct omap_video_timings *timings) | |
| 201 | + struct videomode *vm) | |
| 204 | 202 | { |
| 205 | 203 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 206 | 204 | |
| 207 | − *timings = ddata->videomode; | |
| 205 | + *vm = ddata->vm; | |
| 208 | 206 | } |
| 209 | 207 | |
| 210 | 208 | static int nec_8048_check_timings(struct omap_dss_device *dssdev, |
| 211 | − struct omap_video_timings *timings) | |
| 209 | + struct videomode *vm) | |
| 212 | 210 | { |
| 213 | 211 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 214 | 212 | struct omap_dss_device *in = ddata->in; |
| 215 | 213 | |
| 216 | − return in->ops.dpi->check_timings(in, timings); | |
| 214 | + return in->ops.dpi->check_timings(in, vm); | |
| 217 | 215 | } |
| 218 | 216 | |
| 219 | 217 | static struct omap_dss_driver nec_8048_ops = { |
| @@ -306,14 +304,14 @@ static int nec_8048_probe(struct spi_device *spi) · 86 unmodified lines | ||
| 306 | 304 | goto err_gpio; |
| 307 | 305 | } |
| 308 | 306 | |
| 309 | − ddata->videomode = nec_8048_panel_timings; | |
| 307 | + ddata->vm = nec_8048_panel_vm; | |
| 310 | 308 | |
| 311 | 309 | dssdev = &ddata->dssdev; |
| 312 | 310 | dssdev->dev = &spi->dev; |
| 313 | 311 | dssdev->driver = &nec_8048_ops; |
| 314 | 312 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; |
| 315 | 313 | dssdev->owner = THIS_MODULE; |
| 316 | − dssdev->panel.timings = ddata->videomode; | |
| 314 | + dssdev->panel.vm = ddata->vm; | |
| 317 | 315 | |
| 318 | 316 | r = omapdss_register_display(dssdev); |
| 319 | 317 | if (r) { |
| @@ -26,7 +26,7 @@ struct panel_drv_data { · 25 unmodified lines | ||
| 26 | 26 | |
| 27 | 27 | int data_lines; |
| 28 | 28 | |
| 29 | − struct omap_video_timings videomode; | |
| 29 | + struct videomode vm; | |
| 30 | 30 | |
| 31 | 31 | struct gpio_desc *resb_gpio; /* low = reset active min 20 us */ |
| 32 | 32 | struct gpio_desc *ini_gpio; /* high = power on */ |
| @@ -35,25 +35,27 @@ struct panel_drv_data { · 2 unmodified lines | ||
| 35 | 35 | struct gpio_desc *ud_gpio; /* high = conventional vertical scanning */ |
| 36 | 36 | }; |
| 37 | 37 | |
| 38 | −static const struct omap_video_timings sharp_ls_timings = { | |
| 39 | − .x_res = 480, | |
| 40 | − .y_res = 640, | |
| 38 | +static const struct videomode sharp_ls_vm = { | |
| 39 | + .hactive = 480, | |
| 40 | + .vactive = 640, | |
| 41 | 41 | |
| 42 | 42 | .pixelclock = 19200000, |
| 43 | 43 | |
| 44 | − .hsw = 2, | |
| 45 | − .hfp = 1, | |
| 46 | − .hbp = 28, | |
| 47 | − | |
| 48 | − .vsw = 1, | |
| 49 | − .vfp = 1, | |
| 50 | − .vbp = 1, | |
| 51 | − | |
| 52 | − .vsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 53 | − .hsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 54 | − .data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, | |
| 55 | − .de_level = OMAPDSS_SIG_ACTIVE_HIGH, | |
| 56 | − .sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE, | |
| 44 | + .hsync_len = 2, | |
| 45 | + .hfront_porch = 1, | |
| 46 | + .hback_porch = 28, | |
| 47 | + | |
| 48 | + .vsync_len = 1, | |
| 49 | + .vfront_porch = 1, | |
| 50 | + .vback_porch = 1, | |
| 51 | + | |
| 52 | + .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW | | |
| 53 | + DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_SYNC_NEGEDGE | | |
| 54 | + DISPLAY_FLAGS_PIXDATA_POSEDGE, | |
| 55 | + /* | |
| 56 | + * Note: According to the panel documentation: | |
| 57 | + * DATA needs to be driven on the FALLING edge | |
| 58 | + */ | |
| 57 | 59 | }; |
| 58 | 60 | |
| 59 | 61 | #define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev) |
| @@ -99,7 +101,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev) · 39 unmodified lines | ||
| 99 | 101 | |
| 100 | 102 | if (ddata->data_lines) |
| 101 | 103 | in->ops.dpi->set_data_lines(in, ddata->data_lines); |
| 102 | − in->ops.dpi->set_timings(in, &ddata->videomode); | |
| 104 | + in->ops.dpi->set_timings(in, &ddata->vm); | |
| 103 | 105 | |
| 104 | 106 | if (ddata->vcc) { |
| 105 | 107 | r = regulator_enable(ddata->vcc); |
| @@ -154,32 +156,32 @@ static void sharp_ls_disable(struct omap_dss_device *dssdev) · 48 unmodified lines | ||
| 154 | 156 | } |
| 155 | 157 | |
| 156 | 158 | static void sharp_ls_set_timings(struct omap_dss_device *dssdev, |
| 157 | − struct omap_video_timings *timings) | |
| 159 | + struct videomode *vm) | |
| 158 | 160 | { |
| 159 | 161 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 160 | 162 | struct omap_dss_device *in = ddata->in; |
| 161 | 163 | |
| 162 | − ddata->videomode = *timings; | |
| 163 | − dssdev->panel.timings = *timings; | |
| 164 | + ddata->vm = *vm; | |
| 165 | + dssdev->panel.vm = *vm; | |
| 164 | 166 | |
| 165 | − in->ops.dpi->set_timings(in, timings); | |
| 167 | + in->ops.dpi->set_timings(in, vm); | |
| 166 | 168 | } |
| 167 | 169 | |
| 168 | 170 | static void sharp_ls_get_timings(struct omap_dss_device *dssdev, |
| 169 | − struct omap_video_timings *timings) | |
| 171 | + struct videomode *vm) | |
| 170 | 172 | { |
| 171 | 173 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 172 | 174 | |
| 173 | − *timings = ddata->videomode; | |
| 175 | + *vm = ddata->vm; | |
| 174 | 176 | } |
| 175 | 177 | |
| 176 | 178 | static int sharp_ls_check_timings(struct omap_dss_device *dssdev, |
| 177 | − struct omap_video_timings *timings) | |
| 179 | + struct videomode *vm) | |
| 178 | 180 | { |
| 179 | 181 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 180 | 182 | struct omap_dss_device *in = ddata->in; |
| 181 | 183 | |
| 182 | − return in->ops.dpi->check_timings(in, timings); | |
| 184 | + return in->ops.dpi->check_timings(in, vm); | |
| 183 | 185 | } |
| 184 | 186 | |
| 185 | 187 | static struct omap_dss_driver sharp_ls_ops = { |
| @@ -279,14 +281,14 @@ static int sharp_ls_probe(struct platform_device *pdev) · 93 unmodified lines | ||
| 279 | 281 | if (r) |
| 280 | 282 | return r; |
| 281 | 283 | |
| 282 | − ddata->videomode = sharp_ls_timings; | |
| 284 | + ddata->vm = sharp_ls_vm; | |
| 283 | 285 | |
| 284 | 286 | dssdev = &ddata->dssdev; |
| 285 | 287 | dssdev->dev = &pdev->dev; |
| 286 | 288 | dssdev->driver = &sharp_ls_ops; |
| 287 | 289 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; |
| 288 | 290 | dssdev->owner = THIS_MODULE; |
| 289 | − dssdev->panel.timings = ddata->videomode; | |
| 291 | + dssdev->panel.vm = ddata->vm; | |
| 290 | 292 | dssdev->phy.dpi.data_lines = ddata->data_lines; |
| 291 | 293 | |
| 292 | 294 | r = omapdss_register_display(dssdev); |
| @@ -71,7 +71,7 @@ struct panel_drv_data { · 70 unmodified lines | ||
| 71 | 71 | int reset_gpio; |
| 72 | 72 | int datapairs; |
| 73 | 73 | |
| 74 | − struct omap_video_timings videomode; | |
| 74 | + struct videomode vm; | |
| 75 | 75 | |
| 76 | 76 | char *name; |
| 77 | 77 | int enabled; |
| @@ -92,23 +92,20 @@ struct panel_drv_data { · 14 unmodified lines | ||
| 92 | 92 | struct backlight_device *bl_dev; |
| 93 | 93 | }; |
| 94 | 94 | |
| 95 | −static const struct omap_video_timings acx565akm_panel_timings = { | |
| 96 | − .x_res = 800, | |
| 97 | − .y_res = 480, | |
| 95 | +static const struct videomode acx565akm_panel_vm = { | |
| 96 | + .hactive = 800, | |
| 97 | + .vactive = 480, | |
| 98 | 98 | .pixelclock = 24000000, |
| 99 | − .hfp = 28, | |
| 100 | − .hsw = 4, | |
| 101 | − .hbp = 24, | |
| 102 | − .vfp = 3, | |
| 103 | − .vsw = 3, | |
| 104 | − .vbp = 4, | |
| 105 | − | |
| 106 | − .vsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 107 | − .hsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 108 | − | |
| 109 | − .data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, | |
| 110 | − .de_level = OMAPDSS_SIG_ACTIVE_HIGH, | |
| 111 | − .sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE, | |
| 99 | + .hfront_porch = 28, | |
| 100 | + .hsync_len = 4, | |
| 101 | + .hback_porch = 24, | |
| 102 | + .vfront_porch = 3, | |
| 103 | + .vsync_len = 3, | |
| 104 | + .vback_porch = 4, | |
| 105 | + | |
| 106 | + .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW | | |
| 107 | + DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_SYNC_NEGEDGE | | |
| 108 | + DISPLAY_FLAGS_PIXDATA_POSEDGE, | |
| 112 | 109 | }; |
| 113 | 110 | |
| 114 | 111 | #define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev) |
| @@ -548,7 +545,7 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev) · 433 unmodified lines | ||
| 548 | 545 | |
| 549 | 546 | dev_dbg(&ddata->spi->dev, "%s\n", __func__); |
| 550 | 547 | |
| 551 | − in->ops.sdi->set_timings(in, &ddata->videomode); | |
| 548 | + in->ops.sdi->set_timings(in, &ddata->vm); | |
| 552 | 549 | |
| 553 | 550 | if (ddata->datapairs > 0) |
| 554 | 551 | in->ops.sdi->set_datapairs(in, ddata->datapairs); |
| @@ -662,32 +659,32 @@ static void acx565akm_disable(struct omap_dss_device *dssdev) · 107 unmodified lines | ||
| 662 | 659 | } |
| 663 | 660 | |
| 664 | 661 | static void acx565akm_set_timings(struct omap_dss_device *dssdev, |
| 665 | − struct omap_video_timings *timings) | |
| 662 | + struct videomode *vm) | |
| 666 | 663 | { |
| 667 | 664 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 668 | 665 | struct omap_dss_device *in = ddata->in; |
| 669 | 666 | |
| 670 | − ddata->videomode = *timings; | |
| 671 | − dssdev->panel.timings = *timings; | |
| 667 | + ddata->vm = *vm; | |
| 668 | + dssdev->panel.vm = *vm; | |
| 672 | 669 | |
| 673 | − in->ops.sdi->set_timings(in, timings); | |
| 670 | + in->ops.sdi->set_timings(in, vm); | |
| 674 | 671 | } |
| 675 | 672 | |
| 676 | 673 | static void acx565akm_get_timings(struct omap_dss_device *dssdev, |
| 677 | − struct omap_video_timings *timings) | |
| 674 | + struct videomode *vm) | |
| 678 | 675 | { |
| 679 | 676 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 680 | 677 | |
| 681 | − *timings = ddata->videomode; | |
| 678 | + *vm = ddata->vm; | |
| 682 | 679 | } |
| 683 | 680 | |
| 684 | 681 | static int acx565akm_check_timings(struct omap_dss_device *dssdev, |
| 685 | − struct omap_video_timings *timings) | |
| 682 | + struct videomode *vm) | |
| 686 | 683 | { |
| 687 | 684 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 688 | 685 | struct omap_dss_device *in = ddata->in; |
| 689 | 686 | |
| 690 | − return in->ops.sdi->check_timings(in, timings); | |
| 687 | + return in->ops.sdi->check_timings(in, vm); | |
| 691 | 688 | } |
| 692 | 689 | |
| 693 | 690 | static struct omap_dss_driver acx565akm_ops = { |
| @@ -845,14 +842,14 @@ static int acx565akm_probe(struct spi_device *spi) · 151 unmodified lines | ||
| 845 | 842 | acx565akm_bl_update_status(bldev); |
| 846 | 843 | |
| 847 | 844 | |
| 848 | − ddata->videomode = acx565akm_panel_timings; | |
| 845 | + ddata->vm = acx565akm_panel_vm; | |
| 849 | 846 | |
| 850 | 847 | dssdev = &ddata->dssdev; |
| 851 | 848 | dssdev->dev = &spi->dev; |
| 852 | 849 | dssdev->driver = &acx565akm_ops; |
| 853 | 850 | dssdev->type = OMAP_DISPLAY_TYPE_SDI; |
| 854 | 851 | dssdev->owner = THIS_MODULE; |
| 855 | − dssdev->panel.timings = ddata->videomode; | |
| 852 | + dssdev->panel.vm = ddata->vm; | |
| 856 | 853 | |
| 857 | 854 | r = omapdss_register_display(dssdev); |
| 858 | 855 | if (r) { |
| @@ -37,28 +37,29 @@ struct panel_drv_data { · 36 unmodified lines | ||
| 37 | 37 | |
| 38 | 38 | int data_lines; |
| 39 | 39 | |
| 40 | − struct omap_video_timings videomode; | |
| 40 | + struct videomode vm; | |
| 41 | 41 | |
| 42 | 42 | struct spi_device *spi_dev; |
| 43 | 43 | }; |
| 44 | 44 | |
| 45 | −static struct omap_video_timings td028ttec1_panel_timings = { | |
| 46 | − .x_res = 480, | |
| 47 | − .y_res = 640, | |
| 45 | +static struct videomode td028ttec1_panel_vm = { | |
| 46 | + .hactive = 480, | |
| 47 | + .vactive = 640, | |
| 48 | 48 | .pixelclock = 22153000, |
| 49 | − .hfp = 24, | |
| 50 | − .hsw = 8, | |
| 51 | − .hbp = 8, | |
| 52 | − .vfp = 4, | |
| 53 | − .vsw = 2, | |
| 54 | − .vbp = 2, | |
| 55 | − | |
| 56 | − .vsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 57 | − .hsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 58 | − | |
| 59 | − .data_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE, | |
| 60 | − .de_level = OMAPDSS_SIG_ACTIVE_HIGH, | |
| 61 | − .sync_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, | |
| 49 | + .hfront_porch = 24, | |
| 50 | + .hsync_len = 8, | |
| 51 | + .hback_porch = 8, | |
| 52 | + .vfront_porch = 4, | |
| 53 | + .vsync_len = 2, | |
| 54 | + .vback_porch = 2, | |
| 55 | + | |
| 56 | + .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW | | |
| 57 | + DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_SYNC_POSEDGE | | |
| 58 | + DISPLAY_FLAGS_PIXDATA_NEGEDGE, | |
| 59 | + /* | |
| 60 | + * Note: According to the panel documentation: | |
| 61 | + * SYNC needs to be driven on the FALLING edge | |
| 62 | + */ | |
| 62 | 63 | }; |
| 63 | 64 | |
| 64 | 65 | #define JBT_COMMAND 0x000 |
| @@ -208,7 +209,7 @@ static int td028ttec1_panel_enable(struct omap_dss_device *dssdev) · 143 unmodified lines | ||
| 208 | 209 | |
| 209 | 210 | if (ddata->data_lines) |
| 210 | 211 | in->ops.dpi->set_data_lines(in, ddata->data_lines); |
| 211 | − in->ops.dpi->set_timings(in, &ddata->videomode); | |
| 212 | + in->ops.dpi->set_timings(in, &ddata->vm); | |
| 212 | 213 | |
| 213 | 214 | r = in->ops.dpi->enable(in); |
| 214 | 215 | if (r) |
| @@ -325,32 +326,32 @@ static void td028ttec1_panel_disable(struct omap_dss_device *dssdev) · 110 unmodified lines | ||
| 325 | 326 | } |
| 326 | 327 | |
| 327 | 328 | static void td028ttec1_panel_set_timings(struct omap_dss_device *dssdev, |
| 328 | − struct omap_video_timings *timings) | |
| 329 | + struct videomode *vm) | |
| 329 | 330 | { |
| 330 | 331 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 331 | 332 | struct omap_dss_device *in = ddata->in; |
| 332 | 333 | |
| 333 | − ddata->videomode = *timings; | |
| 334 | − dssdev->panel.timings = *timings; | |
| 334 | + ddata->vm = *vm; | |
| 335 | + dssdev->panel.vm = *vm; | |
| 335 | 336 | |
| 336 | − in->ops.dpi->set_timings(in, timings); | |
| 337 | + in->ops.dpi->set_timings(in, vm); | |
| 337 | 338 | } |
| 338 | 339 | |
| 339 | 340 | static void td028ttec1_panel_get_timings(struct omap_dss_device *dssdev, |
| 340 | − struct omap_video_timings *timings) | |
| 341 | + struct videomode *vm) | |
| 341 | 342 | { |
| 342 | 343 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 343 | 344 | |
| 344 | − *timings = ddata->videomode; | |
| 345 | + *vm = ddata->vm; | |
| 345 | 346 | } |
| 346 | 347 | |
| 347 | 348 | static int td028ttec1_panel_check_timings(struct omap_dss_device *dssdev, |
| 348 | − struct omap_video_timings *timings) | |
| 349 | + struct videomode *vm) | |
| 349 | 350 | { |
| 350 | 351 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 351 | 352 | struct omap_dss_device *in = ddata->in; |
| 352 | 353 | |
| 353 | − return in->ops.dpi->check_timings(in, timings); | |
| 354 | + return in->ops.dpi->check_timings(in, vm); | |
| 354 | 355 | } |
| 355 | 356 | |
| 356 | 357 | static struct omap_dss_driver td028ttec1_ops = { |
| @@ -414,14 +415,14 @@ static int td028ttec1_panel_probe(struct spi_device *spi) · 57 unmodified lines | ||
| 414 | 415 | if (r) |
| 415 | 416 | return r; |
| 416 | 417 | |
| 417 | − ddata->videomode = td028ttec1_panel_timings; | |
| 418 | + ddata->vm = td028ttec1_panel_vm; | |
| 418 | 419 | |
| 419 | 420 | dssdev = &ddata->dssdev; |
| 420 | 421 | dssdev->dev = &spi->dev; |
| 421 | 422 | dssdev->driver = &td028ttec1_ops; |
| 422 | 423 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; |
| 423 | 424 | dssdev->owner = THIS_MODULE; |
| 424 | − dssdev->panel.timings = ddata->videomode; | |
| 425 | + dssdev->panel.vm = ddata->vm; | |
| 425 | 426 | dssdev->phy.dpi.data_lines = ddata->data_lines; |
| 426 | 427 | |
| 427 | 428 | r = omapdss_register_display(dssdev); |
| @@ -56,7 +56,7 @@ struct panel_drv_data { · 55 unmodified lines | ||
| 56 | 56 | struct omap_dss_device dssdev; |
| 57 | 57 | struct omap_dss_device *in; |
| 58 | 58 | |
| 59 | − struct omap_video_timings videomode; | |
| 59 | + struct videomode vm; | |
| 60 | 60 | |
| 61 | 61 | int data_lines; |
| 62 | 62 | |
| @@ -72,25 +72,27 @@ struct panel_drv_data { · 9 unmodified lines | ||
| 72 | 72 | u32 power_on_resume:1; |
| 73 | 73 | }; |
| 74 | 74 | |
| 75 | −static const struct omap_video_timings tpo_td043_timings = { | |
| 76 | − .x_res = 800, | |
| 77 | − .y_res = 480, | |
| 75 | +static const struct videomode tpo_td043_vm = { | |
| 76 | + .hactive = 800, | |
| 77 | + .vactive = 480, | |
| 78 | 78 | |
| 79 | 79 | .pixelclock = 36000000, |
| 80 | 80 | |
| 81 | − .hsw = 1, | |
| 82 | − .hfp = 68, | |
| 83 | − .hbp = 214, | |
| 81 | + .hsync_len = 1, | |
| 82 | + .hfront_porch = 68, | |
| 83 | + .hback_porch = 214, | |
| 84 | 84 | |
| 85 | − .vsw = 1, | |
| 86 | − .vfp = 39, | |
| 87 | − .vbp = 34, | |
| 85 | + .vsync_len = 1, | |
| 86 | + .vfront_porch = 39, | |
| 87 | + .vback_porch = 34, | |
| 88 | 88 | |
| 89 | − .vsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 90 | − .hsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 91 | − .data_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE, | |
| 92 | − .de_level = OMAPDSS_SIG_ACTIVE_HIGH, | |
| 93 | − .sync_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, | |
| 89 | + .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW | | |
| 90 | + DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_SYNC_POSEDGE | | |
| 91 | + DISPLAY_FLAGS_PIXDATA_NEGEDGE, | |
| 92 | + /* | |
| 93 | + * Note: According to the panel documentation: | |
| 94 | + * SYNC needs to be driven on the FALLING edge | |
| 95 | + */ | |
| 94 | 96 | }; |
| 95 | 97 | |
| 96 | 98 | #define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev) |
| @@ -378,7 +380,7 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev) · 281 unmodified lines | ||
| 378 | 380 | |
| 379 | 381 | if (ddata->data_lines) |
| 380 | 382 | in->ops.dpi->set_data_lines(in, ddata->data_lines); |
| 381 | − in->ops.dpi->set_timings(in, &ddata->videomode); | |
| 383 | + in->ops.dpi->set_timings(in, &ddata->vm); | |
| 382 | 384 | |
| 383 | 385 | r = in->ops.dpi->enable(in); |
| 384 | 386 | if (r) |
| @@ -418,32 +420,32 @@ static void tpo_td043_disable(struct omap_dss_device *dssdev) · 33 unmodified lines | ||
| 418 | 420 | } |
| 419 | 421 | |
| 420 | 422 | static void tpo_td043_set_timings(struct omap_dss_device *dssdev, |
| 421 | − struct omap_video_timings *timings) | |
| 423 | + struct videomode *vm) | |
| 422 | 424 | { |
| 423 | 425 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 424 | 426 | struct omap_dss_device *in = ddata->in; |
| 425 | 427 | |
| 426 | − ddata->videomode = *timings; | |
| 427 | − dssdev->panel.timings = *timings; | |
| 428 | + ddata->vm = *vm; | |
| 429 | + dssdev->panel.vm = *vm; | |
| 428 | 430 | |
| 429 | − in->ops.dpi->set_timings(in, timings); | |
| 431 | + in->ops.dpi->set_timings(in, vm); | |
| 430 | 432 | } |
| 431 | 433 | |
| 432 | 434 | static void tpo_td043_get_timings(struct omap_dss_device *dssdev, |
| 433 | − struct omap_video_timings *timings) | |
| 435 | + struct videomode *vm) | |
| 434 | 436 | { |
| 435 | 437 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 436 | 438 | |
| 437 | − *timings = ddata->videomode; | |
| 439 | + *vm = ddata->vm; | |
| 438 | 440 | } |
| 439 | 441 | |
| 440 | 442 | static int tpo_td043_check_timings(struct omap_dss_device *dssdev, |
| 441 | − struct omap_video_timings *timings) | |
| 443 | + struct videomode *vm) | |
| 442 | 444 | { |
| 443 | 445 | struct panel_drv_data *ddata = to_panel_data(dssdev); |
| 444 | 446 | struct omap_dss_device *in = ddata->in; |
| 445 | 447 | |
| 446 | − return in->ops.dpi->check_timings(in, timings); | |
| 448 | + return in->ops.dpi->check_timings(in, vm); | |
| 447 | 449 | } |
| 448 | 450 | |
| 449 | 451 | static struct omap_dss_driver tpo_td043_ops = { |
| @@ -546,14 +548,14 @@ static int tpo_td043_probe(struct spi_device *spi) · 96 unmodified lines | ||
| 546 | 548 | goto err_sysfs; |
| 547 | 549 | } |
| 548 | 550 | |
| 549 | − ddata->videomode = tpo_td043_timings; | |
| 551 | + ddata->vm = tpo_td043_vm; | |
| 550 | 552 | |
| 551 | 553 | dssdev = &ddata->dssdev; |
| 552 | 554 | dssdev->dev = &spi->dev; |
| 553 | 555 | dssdev->driver = &tpo_td043_ops; |
| 554 | 556 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; |
| 555 | 557 | dssdev->owner = THIS_MODULE; |
| 556 | − dssdev->panel.timings = ddata->videomode; | |
| 558 | + dssdev->panel.vm = ddata->vm; | |
| 557 | 559 | |
| 558 | 560 | r = omapdss_register_display(dssdev); |
| 559 | 561 | if (r) { |
| @@ -75,7 +75,7 @@ struct dispc_features { · 74 unmodified lines | ||
| 75 | 75 | unsigned long max_lcd_pclk; |
| 76 | 76 | unsigned long max_tv_pclk; |
| 77 | 77 | int (*calc_scaling) (unsigned long pclk, unsigned long lclk, |
| 78 | − const struct omap_video_timings *mgr_timings, | |
| 78 | + const struct videomode *vm, | |
| 79 | 79 | u16 width, u16 height, u16 out_width, u16 out_height, |
| 80 | 80 | enum omap_color_mode color_mode, bool *five_taps, |
| 81 | 81 | int *x_predecim, int *y_predecim, int *decim_x, int *decim_y, |
| @@ -1679,7 +1679,7 @@ static void dispc_ovl_set_scaling_uv(enum omap_plane plane, · 1597 unmodified lines | ||
| 1679 | 1679 | { |
| 1680 | 1680 | int scale_x = out_width != orig_width; |
| 1681 | 1681 | int scale_y = out_height != orig_height; |
| 1682 | − bool chroma_upscale = plane != OMAP_DSS_WB ? true : false; | |
| 1682 | + bool chroma_upscale = plane != OMAP_DSS_WB; | |
| 1683 | 1683 | |
| 1684 | 1684 | if (!dss_has_feature(FEAT_HANDLE_UV_SEPARATE)) |
| 1685 | 1685 | return; |
| @@ -2179,7 +2179,7 @@ static void calc_tiler_rotation_offset(u16 screen_width, u16 width, · 493 unmodified lines | ||
| 2179 | 2179 | * undocumented horizontal position and timing related limitations. |
| 2180 | 2180 | */ |
| 2181 | 2181 | static int check_horiz_timing_omap3(unsigned long pclk, unsigned long lclk, |
| 2182 | − const struct omap_video_timings *t, u16 pos_x, | |
| 2182 | + const struct videomode *vm, u16 pos_x, | |
| 2183 | 2183 | u16 width, u16 height, u16 out_width, u16 out_height, |
| 2184 | 2184 | bool five_taps) |
| 2185 | 2185 | { |
| @@ -2189,14 +2189,16 @@ static int check_horiz_timing_omap3(unsigned long pclk, unsigned long lclk, · 3 unmodified lines | ||
| 2189 | 2189 | u64 val, blank; |
| 2190 | 2190 | int i; |
| 2191 | 2191 | |
| 2192 | − nonactive = t->x_res + t->hfp + t->hsw + t->hbp - out_width; | |
| 2192 | + nonactive = vm->hactive + vm->hfront_porch + vm->hsync_len + | |
| 2193 | + vm->hback_porch - out_width; | |
| 2193 | 2194 | |
| 2194 | 2195 | i = 0; |
| 2195 | 2196 | if (out_height < height) |
| 2196 | 2197 | i++; |
| 2197 | 2198 | if (out_width < width) |
| 2198 | 2199 | i++; |
| 2199 | − blank = div_u64((u64)(t->hbp + t->hsw + t->hfp) * lclk, pclk); | |
| 2200 | + blank = div_u64((u64)(vm->hback_porch + vm->hsync_len + vm->hfront_porch) * | |
| 2201 | + lclk, pclk); | |
| 2200 | 2202 | DSSDBG("blanking period + ppl = %llu (limit = %u)\n", blank, limits[i]); |
| 2201 | 2203 | if (blank <= limits[i]) |
| 2202 | 2204 | return -EINVAL; |
| @@ -2231,7 +2233,7 @@ static int check_horiz_timing_omap3(unsigned long pclk, unsigned long lclk, · 28 unmodified lines | ||
| 2231 | 2233 | } |
| 2232 | 2234 | |
| 2233 | 2235 | static unsigned long calc_core_clk_five_taps(unsigned long pclk, |
| 2234 | − const struct omap_video_timings *mgr_timings, u16 width, | |
| 2236 | + const struct videomode *vm, u16 width, | |
| 2235 | 2237 | u16 height, u16 out_width, u16 out_height, |
| 2236 | 2238 | enum omap_color_mode color_mode) |
| 2237 | 2239 | { |
| @@ -2242,7 +2244,7 @@ static unsigned long calc_core_clk_five_taps(unsigned long pclk, · 4 unmodified lines | ||
| 2242 | 2244 | return (unsigned long) pclk; |
| 2243 | 2245 | |
| 2244 | 2246 | if (height > out_height) { |
| 2245 | − unsigned int ppl = mgr_timings->x_res; | |
| 2247 | + unsigned int ppl = vm->hactive; | |
| 2246 | 2248 | |
| 2247 | 2249 | tmp = (u64)pclk * height * out_width; |
| 2248 | 2250 | do_div(tmp, 2 * out_height * ppl); |
| @@ -2324,7 +2326,7 @@ static unsigned long calc_core_clk_44xx(unsigned long pclk, u16 width, · 75 unmodified lines | ||
| 2324 | 2326 | } |
| 2325 | 2327 | |
| 2326 | 2328 | static int dispc_ovl_calc_scaling_24xx(unsigned long pclk, unsigned long lclk, |
| 2327 | − const struct omap_video_timings *mgr_timings, | |
| 2329 | + const struct videomode *vm, | |
| 2328 | 2330 | u16 width, u16 height, u16 out_width, u16 out_height, |
| 2329 | 2331 | enum omap_color_mode color_mode, bool *five_taps, |
| 2330 | 2332 | int *x_predecim, int *y_predecim, int *decim_x, int *decim_y, |
| @@ -2370,7 +2372,7 @@ static int dispc_ovl_calc_scaling_24xx(unsigned long pclk, unsigned long lclk, · 39 unmodified lines | ||
| 2370 | 2372 | } |
| 2371 | 2373 | |
| 2372 | 2374 | static int dispc_ovl_calc_scaling_34xx(unsigned long pclk, unsigned long lclk, |
| 2373 | − const struct omap_video_timings *mgr_timings, | |
| 2375 | + const struct videomode *vm, | |
| 2374 | 2376 | u16 width, u16 height, u16 out_width, u16 out_height, |
| 2375 | 2377 | enum omap_color_mode color_mode, bool *five_taps, |
| 2376 | 2378 | int *x_predecim, int *y_predecim, int *decim_x, int *decim_y, |
| @@ -2392,7 +2394,7 @@ static int dispc_ovl_calc_scaling_34xx(unsigned long pclk, unsigned long lclk, · 15 unmodified lines | ||
| 2392 | 2394 | *five_taps = false; |
| 2393 | 2395 | again: |
| 2394 | 2396 | if (*five_taps) |
| 2395 | − *core_clk = calc_core_clk_five_taps(pclk, mgr_timings, | |
| 2397 | + *core_clk = calc_core_clk_five_taps(pclk, vm, | |
| 2396 | 2398 | in_width, in_height, out_width, |
| 2397 | 2399 | out_height, color_mode); |
| 2398 | 2400 | else |
| @@ -2400,7 +2402,7 @@ again: · 1 unmodified line | ||
| 2400 | 2402 | in_height, out_width, out_height, |
| 2401 | 2403 | mem_to_mem); |
| 2402 | 2404 | |
| 2403 | − error = check_horiz_timing_omap3(pclk, lclk, mgr_timings, | |
| 2405 | + error = check_horiz_timing_omap3(pclk, lclk, vm, | |
| 2404 | 2406 | pos_x, in_width, in_height, out_width, |
| 2405 | 2407 | out_height, *five_taps); |
| 2406 | 2408 | if (error && *five_taps) { |
| @@ -2435,7 +2437,7 @@ again: · 28 unmodified lines | ||
| 2435 | 2437 | return -EINVAL; |
| 2436 | 2438 | } |
| 2437 | 2439 | |
| 2438 | − if (check_horiz_timing_omap3(pclk, lclk, mgr_timings, pos_x, in_width, | |
| 2440 | + if (check_horiz_timing_omap3(pclk, lclk, vm, pos_x, in_width, | |
| 2439 | 2441 | in_height, out_width, out_height, *five_taps)) { |
| 2440 | 2442 | DSSERR("horizontal timing too tight\n"); |
| 2441 | 2443 | return -EINVAL; |
| @@ -2455,7 +2457,7 @@ again: · 13 unmodified lines | ||
| 2455 | 2457 | } |
| 2456 | 2458 | |
| 2457 | 2459 | static int dispc_ovl_calc_scaling_44xx(unsigned long pclk, unsigned long lclk, |
| 2458 | − const struct omap_video_timings *mgr_timings, | |
| 2460 | + const struct videomode *vm, | |
| 2459 | 2461 | u16 width, u16 height, u16 out_width, u16 out_height, |
| 2460 | 2462 | enum omap_color_mode color_mode, bool *five_taps, |
| 2461 | 2463 | int *x_predecim, int *y_predecim, int *decim_x, int *decim_y, |
| @@ -2501,7 +2503,7 @@ static int dispc_ovl_calc_scaling_44xx(unsigned long pclk, unsigned long lclk, · 39 unmodified lines | ||
| 2501 | 2503 | |
| 2502 | 2504 | static int dispc_ovl_calc_scaling(unsigned long pclk, unsigned long lclk, |
| 2503 | 2505 | enum omap_overlay_caps caps, |
| 2504 | − const struct omap_video_timings *mgr_timings, | |
| 2506 | + const struct videomode *vm, | |
| 2505 | 2507 | u16 width, u16 height, u16 out_width, u16 out_height, |
| 2506 | 2508 | enum omap_color_mode color_mode, bool *five_taps, |
| 2507 | 2509 | int *x_predecim, int *y_predecim, u16 pos_x, |
| @@ -2515,7 +2517,7 @@ static int dispc_ovl_calc_scaling(unsigned long pclk, unsigned long lclk, · 7 unmodified lines | ||
| 2515 | 2517 | if (width == out_width && height == out_height) |
| 2516 | 2518 | return 0; |
| 2517 | 2519 | |
| 2518 | − if (!mem_to_mem && (pclk == 0 || mgr_timings->pixelclock == 0)) { | |
| 2520 | + if (!mem_to_mem && (pclk == 0 || vm->pixelclock == 0)) { | |
| 2519 | 2521 | DSSERR("cannot calculate scaling settings: pclk is zero\n"); |
| 2520 | 2522 | return -EINVAL; |
| 2521 | 2523 | } |
| @@ -2551,7 +2553,7 @@ static int dispc_ovl_calc_scaling(unsigned long pclk, unsigned long lclk, · 29 unmodified lines | ||
| 2551 | 2553 | if (decim_y > *y_predecim || out_height > height * 8) |
| 2552 | 2554 | return -EINVAL; |
| 2553 | 2555 | |
| 2554 | − ret = dispc.feat->calc_scaling(pclk, lclk, mgr_timings, width, height, | |
| 2556 | + ret = dispc.feat->calc_scaling(pclk, lclk, vm, width, height, | |
| 2555 | 2557 | out_width, out_height, color_mode, five_taps, |
| 2556 | 2558 | x_predecim, y_predecim, &decim_x, &decim_y, pos_x, &core_clk, |
| 2557 | 2559 | mem_to_mem); |
| @@ -2591,7 +2593,7 @@ static int dispc_ovl_setup_common(enum omap_plane plane, · 33 unmodified lines | ||
| 2591 | 2593 | u16 out_width, u16 out_height, enum omap_color_mode color_mode, |
| 2592 | 2594 | u8 rotation, bool mirror, u8 zorder, u8 pre_mult_alpha, |
| 2593 | 2595 | u8 global_alpha, enum omap_dss_rotation_type rotation_type, |
| 2594 | − bool replication, const struct omap_video_timings *mgr_timings, | |
| 2596 | + bool replication, const struct videomode *vm, | |
| 2595 | 2597 | bool mem_to_mem) |
| 2596 | 2598 | { |
| 2597 | 2599 | bool five_taps = true; |
| @@ -2605,7 +2607,7 @@ static int dispc_ovl_setup_common(enum omap_plane plane, · 7 unmodified lines | ||
| 2605 | 2607 | u16 in_height = height; |
| 2606 | 2608 | u16 in_width = width; |
| 2607 | 2609 | int x_predecim = 1, y_predecim = 1; |
| 2608 | − bool ilace = mgr_timings->interlace; | |
| 2610 | + bool ilace = !!(vm->flags & DISPLAY_FLAGS_INTERLACED); | |
| 2609 | 2611 | unsigned long pclk = dispc_plane_pclk_rate(plane); |
| 2610 | 2612 | unsigned long lclk = dispc_plane_lclk_rate(plane); |
| 2611 | 2613 | |
| @@ -2647,7 +2649,7 @@ static int dispc_ovl_setup_common(enum omap_plane plane, · 35 unmodified lines | ||
| 2647 | 2649 | if (!dss_feat_color_mode_supported(plane, color_mode)) |
| 2648 | 2650 | return -EINVAL; |
| 2649 | 2651 | |
| 2650 | − r = dispc_ovl_calc_scaling(pclk, lclk, caps, mgr_timings, in_width, | |
| 2652 | + r = dispc_ovl_calc_scaling(pclk, lclk, caps, vm, in_width, | |
| 2651 | 2653 | in_height, out_width, out_height, color_mode, |
| 2652 | 2654 | &five_taps, &x_predecim, &y_predecim, pos_x, |
| 2653 | 2655 | rotation_type, mem_to_mem); |
| @@ -2784,7 +2786,7 @@ static int dispc_ovl_setup_common(enum omap_plane plane, · 130 unmodified lines | ||
| 2784 | 2786 | } |
| 2785 | 2787 | |
| 2786 | 2788 | int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi, |
| 2787 | − bool replication, const struct omap_video_timings *mgr_timings, | |
| 2789 | + bool replication, const struct videomode *vm, | |
| 2788 | 2790 | bool mem_to_mem) |
| 2789 | 2791 | { |
| 2790 | 2792 | int r; |
| @@ -2803,14 +2805,14 @@ int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi, · 12 unmodified lines | ||
| 2803 | 2805 | oi->screen_width, oi->pos_x, oi->pos_y, oi->width, oi->height, |
| 2804 | 2806 | oi->out_width, oi->out_height, oi->color_mode, oi->rotation, |
| 2805 | 2807 | oi->mirror, oi->zorder, oi->pre_mult_alpha, oi->global_alpha, |
| 2806 | − oi->rotation_type, replication, mgr_timings, mem_to_mem); | |
| 2808 | + oi->rotation_type, replication, vm, mem_to_mem); | |
| 2807 | 2809 | |
| 2808 | 2810 | return r; |
| 2809 | 2811 | } |
| 2810 | 2812 | EXPORT_SYMBOL(dispc_ovl_setup); |
| 2811 | 2813 | |
| 2812 | 2814 | int dispc_wb_setup(const struct omap_dss_writeback_info *wi, |
| 2813 | − bool mem_to_mem, const struct omap_video_timings *mgr_timings) | |
| 2815 | + bool mem_to_mem, const struct videomode *vm) | |
| 2814 | 2816 | { |
| 2815 | 2817 | int r; |
| 2816 | 2818 | u32 l; |
| @@ -2819,8 +2821,8 @@ int dispc_wb_setup(const struct omap_dss_writeback_info *wi, · 2 unmodified lines | ||
| 2819 | 2821 | const u8 zorder = 0, global_alpha = 0; |
| 2820 | 2822 | const bool replication = false; |
| 2821 | 2823 | bool truncation; |
| 2822 | − int in_width = mgr_timings->x_res; | |
| 2823 | − int in_height = mgr_timings->y_res; | |
| 2824 | + int in_width = vm->hactive; | |
| 2825 | + int in_height = vm->vactive; | |
| 2824 | 2826 | enum omap_overlay_caps caps = |
| 2825 | 2827 | OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA; |
| 2826 | 2828 | |
| @@ -2833,7 +2835,7 @@ int dispc_wb_setup(const struct omap_dss_writeback_info *wi, · 6 unmodified lines | ||
| 2833 | 2835 | wi->buf_width, pos_x, pos_y, in_width, in_height, wi->width, |
| 2834 | 2836 | wi->height, wi->color_mode, wi->rotation, wi->mirror, zorder, |
| 2835 | 2837 | wi->pre_mult_alpha, global_alpha, wi->rotation_type, |
| 2836 | − replication, mgr_timings, mem_to_mem); | |
| 2838 | + replication, vm, mem_to_mem); | |
| 2837 | 2839 | |
| 2838 | 2840 | switch (wi->color_mode) { |
| 2839 | 2841 | case OMAP_DSS_COLOR_RGB16: |
| @@ -2867,8 +2869,8 @@ int dispc_wb_setup(const struct omap_dss_writeback_info *wi, · 27 unmodified lines | ||
| 2867 | 2869 | } else { |
| 2868 | 2870 | int wbdelay; |
| 2869 | 2871 | |
| 2870 | − wbdelay = min(mgr_timings->vfp + mgr_timings->vsw + | |
| 2871 | − mgr_timings->vbp, 255); | |
| 2872 | + wbdelay = min(vm->vfront_porch + | |
| 2873 | + vm->vsync_len + vm->vback_porch, (u32)255); | |
| 2872 | 2874 | |
| 2873 | 2875 | /* WBDELAYCOUNT */ |
| 2874 | 2876 | REG_FLD_MOD(DISPC_OVL_ATTRIBUTES2(plane), wbdelay, 7, 0); |
| @@ -3093,10 +3095,10 @@ static bool _dispc_mgr_size_ok(u16 width, u16 height) · 218 unmodified lines | ||
| 3093 | 3095 | height <= dispc.feat->mgr_height_max; |
| 3094 | 3096 | } |
| 3095 | 3097 | |
| 3096 | −static bool _dispc_lcd_timings_ok(int hsw, int hfp, int hbp, | |
| 3098 | +static bool _dispc_lcd_timings_ok(int hsync_len, int hfp, int hbp, | |
| 3097 | 3099 | int vsw, int vfp, int vbp) |
| 3098 | 3100 | { |
| 3099 | − if (hsw < 1 || hsw > dispc.feat->sw_max || | |
| 3101 | + if (hsync_len < 1 || hsync_len > dispc.feat->sw_max || | |
| 3100 | 3102 | hfp < 1 || hfp > dispc.feat->hp_max || |
| 3101 | 3103 | hbp < 1 || hbp > dispc.feat->hp_max || |
| 3102 | 3104 | vsw < 1 || vsw > dispc.feat->sw_max || |
| @@ -3110,113 +3112,77 @@ static bool _dispc_mgr_pclk_ok(enum omap_channel channel, · 7 unmodified lines | ||
| 3110 | 3112 | unsigned long pclk) |
| 3111 | 3113 | { |
| 3112 | 3114 | if (dss_mgr_is_lcd(channel)) |
| 3113 | − return pclk <= dispc.feat->max_lcd_pclk ? true : false; | |
| 3115 | + return pclk <= dispc.feat->max_lcd_pclk; | |
| 3114 | 3116 | else |
| 3115 | − return pclk <= dispc.feat->max_tv_pclk ? true : false; | |
| 3117 | + return pclk <= dispc.feat->max_tv_pclk; | |
| 3116 | 3118 | } |
| 3117 | 3119 | |
| 3118 | −bool dispc_mgr_timings_ok(enum omap_channel channel, | |
| 3119 | − const struct omap_video_timings *timings) | |
| 3120 | +bool dispc_mgr_timings_ok(enum omap_channel channel, const struct videomode *vm) | |
| 3120 | 3121 | { |
| 3121 | − if (!_dispc_mgr_size_ok(timings->x_res, timings->y_res)) | |
| 3122 | + if (!_dispc_mgr_size_ok(vm->hactive, vm->vactive)) | |
| 3122 | 3123 | return false; |
| 3123 | 3124 | |
| 3124 | − if (!_dispc_mgr_pclk_ok(channel, timings->pixelclock)) | |
| 3125 | + if (!_dispc_mgr_pclk_ok(channel, vm->pixelclock)) | |
| 3125 | 3126 | return false; |
| 3126 | 3127 | |
| 3127 | 3128 | if (dss_mgr_is_lcd(channel)) { |
| 3128 | 3129 | /* TODO: OMAP4+ supports interlace for LCD outputs */ |
| 3129 | − if (timings->interlace) | |
| 3130 | + if (vm->flags & DISPLAY_FLAGS_INTERLACED) | |
| 3130 | 3131 | return false; |
| 3131 | 3132 | |
| 3132 | − if (!_dispc_lcd_timings_ok(timings->hsw, timings->hfp, | |
| 3133 | − timings->hbp, timings->vsw, timings->vfp, | |
| 3134 | − timings->vbp)) | |
| 3133 | + if (!_dispc_lcd_timings_ok(vm->hsync_len, | |
| 3134 | + vm->hfront_porch, vm->hback_porch, | |
| 3135 | + vm->vsync_len, vm->vfront_porch, | |
| 3136 | + vm->vback_porch)) | |
| 3135 | 3137 | return false; |
| 3136 | 3138 | } |
| 3137 | 3139 | |
| 3138 | 3140 | return true; |
| 3139 | 3141 | } |
| 3140 | 3142 | |
| 3141 | −static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsw, | |
| 3142 | − int hfp, int hbp, int vsw, int vfp, int vbp, | |
| 3143 | − enum omap_dss_signal_level vsync_level, | |
| 3144 | − enum omap_dss_signal_level hsync_level, | |
| 3145 | − enum omap_dss_signal_edge data_pclk_edge, | |
| 3146 | − enum omap_dss_signal_level de_level, | |
| 3147 | − enum omap_dss_signal_edge sync_pclk_edge) | |
| 3148 | − | |
| 3143 | +static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, | |
| 3144 | + const struct videomode *vm) | |
| 3149 | 3145 | { |
| 3150 | 3146 | u32 timing_h, timing_v, l; |
| 3151 | 3147 | bool onoff, rf, ipc, vs, hs, de; |
| 3152 | 3148 | |
| 3153 | − timing_h = FLD_VAL(hsw-1, dispc.feat->sw_start, 0) | | |
| 3154 | − FLD_VAL(hfp-1, dispc.feat->fp_start, 8) | | |
| 3155 | − FLD_VAL(hbp-1, dispc.feat->bp_start, 20); | |
| 3156 | − timing_v = FLD_VAL(vsw-1, dispc.feat->sw_start, 0) | | |
| 3157 | − FLD_VAL(vfp, dispc.feat->fp_start, 8) | | |
| 3158 | − FLD_VAL(vbp, dispc.feat->bp_start, 20); | |
| 3149 | + timing_h = FLD_VAL(vm->hsync_len - 1, dispc.feat->sw_start, 0) | | |
| 3150 | + FLD_VAL(vm->hfront_porch - 1, dispc.feat->fp_start, 8) | | |
| 3151 | + FLD_VAL(vm->hback_porch - 1, dispc.feat->bp_start, 20); | |
| 3152 | + timing_v = FLD_VAL(vm->vsync_len - 1, dispc.feat->sw_start, 0) | | |
| 3153 | + FLD_VAL(vm->vfront_porch, dispc.feat->fp_start, 8) | | |
| 3154 | + FLD_VAL(vm->vback_porch, dispc.feat->bp_start, 20); | |
| 3159 | 3155 | |
| 3160 | 3156 | dispc_write_reg(DISPC_TIMING_H(channel), timing_h); |
| 3161 | 3157 | dispc_write_reg(DISPC_TIMING_V(channel), timing_v); |
| 3162 | 3158 | |
| 3163 | − switch (vsync_level) { | |
| 3164 | − case OMAPDSS_SIG_ACTIVE_LOW: | |
| 3165 | − vs = true; | |
| 3166 | − break; | |
| 3167 | − case OMAPDSS_SIG_ACTIVE_HIGH: | |
| 3159 | + if (vm->flags & DISPLAY_FLAGS_VSYNC_HIGH) | |
| 3168 | 3160 | vs = false; |
| 3169 | − break; | |
| 3170 | − default: | |
| 3171 | − BUG(); | |
| 3172 | − } | |
| 3161 | + else | |
| 3162 | + vs = true; | |
| 3173 | 3163 | |
| 3174 | − switch (hsync_level) { | |
| 3175 | − case OMAPDSS_SIG_ACTIVE_LOW: | |
| 3176 | − hs = true; | |
| 3177 | − break; | |
| 3178 | − case OMAPDSS_SIG_ACTIVE_HIGH: | |
| 3164 | + if (vm->flags & DISPLAY_FLAGS_HSYNC_HIGH) | |
| 3179 | 3165 | hs = false; |
| 3180 | − break; | |
| 3181 | − default: | |
| 3182 | − BUG(); | |
| 3183 | − } | |
| 3166 | + else | |
| 3167 | + hs = true; | |
| 3184 | 3168 | |
| 3185 | − switch (de_level) { | |
| 3186 | − case OMAPDSS_SIG_ACTIVE_LOW: | |
| 3187 | − de = true; | |
| 3188 | − break; | |
| 3189 | − case OMAPDSS_SIG_ACTIVE_HIGH: | |
| 3169 | + if (vm->flags & DISPLAY_FLAGS_DE_HIGH) | |
| 3190 | 3170 | de = false; |
| 3191 | − break; | |
| 3192 | − default: | |
| 3193 | − BUG(); | |
| 3194 | − } | |
| 3171 | + else | |
| 3172 | + de = true; | |
| 3195 | 3173 | |
| 3196 | − switch (data_pclk_edge) { | |
| 3197 | − case OMAPDSS_DRIVE_SIG_RISING_EDGE: | |
| 3174 | + if (vm->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE) | |
| 3198 | 3175 | ipc = false; |
| 3199 | − break; | |
| 3200 | − case OMAPDSS_DRIVE_SIG_FALLING_EDGE: | |
| 3176 | + else | |
| 3201 | 3177 | ipc = true; |
| 3202 | − break; | |
| 3203 | − default: | |
| 3204 | − BUG(); | |
| 3205 | − } | |
| 3206 | 3178 | |
| 3207 | 3179 | /* always use the 'rf' setting */ |
| 3208 | 3180 | onoff = true; |
| 3209 | 3181 | |
| 3210 | − switch (sync_pclk_edge) { | |
| 3211 | − case OMAPDSS_DRIVE_SIG_FALLING_EDGE: | |
| 3212 | − rf = false; | |
| 3213 | − break; | |
| 3214 | − case OMAPDSS_DRIVE_SIG_RISING_EDGE: | |
| 3182 | + if (vm->flags & DISPLAY_FLAGS_SYNC_POSEDGE) | |
| 3215 | 3183 | rf = true; |
| 3216 | − break; | |
| 3217 | − default: | |
| 3218 | − BUG(); | |
| 3219 | − } | |
| 3184 | + else | |
| 3185 | + rf = false; | |
| 3220 | 3186 | |
| 3221 | 3187 | l = FLD_VAL(onoff, 17, 17) | |
| 3222 | 3188 | FLD_VAL(rf, 16, 16) | |
| @@ -3253,13 +3219,13 @@ static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsw, · 30 unmodified lines | ||
| 3253 | 3219 | |
| 3254 | 3220 | /* change name to mode? */ |
| 3255 | 3221 | void dispc_mgr_set_timings(enum omap_channel channel, |
| 3256 | − const struct omap_video_timings *timings) | |
| 3222 | + const struct videomode *vm) | |
| 3257 | 3223 | { |
| 3258 | 3224 | unsigned xtot, ytot; |
| 3259 | 3225 | unsigned long ht, vt; |
| 3260 | − struct omap_video_timings t = *timings; | |
| 3226 | + struct videomode t = *vm; | |
| 3261 | 3227 | |
| 3262 | − DSSDBG("channel %d xres %u yres %u\n", channel, t.x_res, t.y_res); | |
| 3228 | + DSSDBG("channel %d xres %u yres %u\n", channel, t.hactive, t.vactive); | |
| 3263 | 3229 | |
| 3264 | 3230 | if (!dispc_mgr_timings_ok(channel, &t)) { |
| 3265 | 3231 | BUG(); |
| @@ -3267,34 +3233,37 @@ void dispc_mgr_set_timings(enum omap_channel channel, · 1 unmodified line | ||
| 3267 | 3233 | } |
| 3268 | 3234 | |
| 3269 | 3235 | if (dss_mgr_is_lcd(channel)) { |
| 3270 | − _dispc_mgr_set_lcd_timings(channel, t.hsw, t.hfp, t.hbp, t.vsw, | |
| 3271 | − t.vfp, t.vbp, t.vsync_level, t.hsync_level, | |
| 3272 | − t.data_pclk_edge, t.de_level, t.sync_pclk_edge); | |
| 3236 | + _dispc_mgr_set_lcd_timings(channel, &t); | |
| 3273 | 3237 | |
| 3274 | − xtot = t.x_res + t.hfp + t.hsw + t.hbp; | |
| 3275 | − ytot = t.y_res + t.vfp + t.vsw + t.vbp; | |
| 3238 | + xtot = t.hactive + t.hfront_porch + t.hsync_len + t.hback_porch; | |
| 3239 | + ytot = t.vactive + t.vfront_porch + t.vsync_len + t.vback_porch; | |
| 3276 | 3240 | |
| 3277 | − ht = timings->pixelclock / xtot; | |
| 3278 | − vt = timings->pixelclock / xtot / ytot; | |
| 3241 | + ht = vm->pixelclock / xtot; | |
| 3242 | + vt = vm->pixelclock / xtot / ytot; | |
| 3279 | 3243 | |
| 3280 | − DSSDBG("pck %u\n", timings->pixelclock); | |
| 3281 | − DSSDBG("hsw %d hfp %d hbp %d vsw %d vfp %d vbp %d\n", | |
| 3282 | − t.hsw, t.hfp, t.hbp, t.vsw, t.vfp, t.vbp); | |
| 3244 | + DSSDBG("pck %lu\n", vm->pixelclock); | |
| 3245 | + DSSDBG("hsync_len %d hfp %d hbp %d vsw %d vfp %d vbp %d\n", | |
| 3246 | + t.hsync_len, t.hfront_porch, t.hback_porch, | |
| 3247 | + t.vsync_len, t.vfront_porch, t.vback_porch); | |
| 3283 | 3248 | DSSDBG("vsync_level %d hsync_level %d data_pclk_edge %d de_level %d sync_pclk_edge %d\n", |
| 3284 | − t.vsync_level, t.hsync_level, t.data_pclk_edge, | |
| 3285 | − t.de_level, t.sync_pclk_edge); | |
| 3249 | + !!(t.flags & DISPLAY_FLAGS_VSYNC_HIGH), | |
| 3250 | + !!(t.flags & DISPLAY_FLAGS_HSYNC_HIGH), | |
| 3251 | + !!(t.flags & DISPLAY_FLAGS_PIXDATA_POSEDGE), | |
| 3252 | + !!(t.flags & DISPLAY_FLAGS_DE_HIGH), | |
| 3253 | + !!(t.flags & DISPLAY_FLAGS_SYNC_POSEDGE)); | |
| 3286 | 3254 | |
| 3287 | 3255 | DSSDBG("hsync %luHz, vsync %luHz\n", ht, vt); |
| 3288 | 3256 | } else { |
| 3289 | − if (t.interlace) | |
| 3290 | − t.y_res /= 2; | |
| 3257 | + if (t.flags & DISPLAY_FLAGS_INTERLACED) | |
| 3258 | + t.vactive /= 2; | |
| 3291 | 3259 | |
| 3292 | 3260 | if (dispc.feat->supports_double_pixel) |
| 3293 | − REG_FLD_MOD(DISPC_CONTROL, t.double_pixel ? 1 : 0, | |
| 3294 | − 19, 17); | |
| 3261 | + REG_FLD_MOD(DISPC_CONTROL, | |
| 3262 | + !!(t.flags & DISPLAY_FLAGS_DOUBLECLK), | |
| 3263 | + 19, 17); | |
| 3295 | 3264 | } |
| 3296 | 3265 | |
| 3297 | − dispc_mgr_set_size(channel, t.x_res, t.y_res); | |
| 3266 | + dispc_mgr_set_size(channel, t.hactive, t.vactive); | |
| 3298 | 3267 | } |
| 3299 | 3268 | EXPORT_SYMBOL(dispc_mgr_set_timings); |
| 3300 | 3269 | |
| @@ -4214,23 +4183,20 @@ EXPORT_SYMBOL(dispc_free_irq); · 913 unmodified lines | ||
| 4214 | 4183 | */ |
| 4215 | 4184 | |
| 4216 | 4185 | static const struct dispc_errata_i734_data { |
| 4217 | − struct omap_video_timings timings; | |
| 4186 | + struct videomode vm; | |
| 4218 | 4187 | struct omap_overlay_info ovli; |
| 4219 | 4188 | struct omap_overlay_manager_info mgri; |
| 4220 | 4189 | struct dss_lcd_mgr_config lcd_conf; |
| 4221 | 4190 | } i734 = { |
| 4222 | − .timings = { | |
| 4223 | − .x_res = 8, .y_res = 1, | |
| 4191 | + .vm = { | |
| 4192 | + .hactive = 8, .vactive = 1, | |
| 4224 | 4193 | .pixelclock = 16000000, |
| 4225 | − .hsw = 8, .hfp = 4, .hbp = 4, | |
| 4226 | − .vsw = 1, .vfp = 1, .vbp = 1, | |
| 4227 | − .vsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 4228 | − .hsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 4229 | − .interlace = false, | |
| 4230 | − .data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, | |
| 4231 | − .de_level = OMAPDSS_SIG_ACTIVE_HIGH, | |
| 4232 | − .sync_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, | |
| 4233 | − .double_pixel = false, | |
| 4194 | + .hsync_len = 8, .hfront_porch = 4, .hback_porch = 4, | |
| 4195 | + .vsync_len = 1, .vfront_porch = 1, .vback_porch = 1, | |
| 4196 | + | |
| 4197 | + .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW | | |
| 4198 | + DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_SYNC_POSEDGE | | |
| 4199 | + DISPLAY_FLAGS_PIXDATA_POSEDGE, | |
| 4234 | 4200 | }, |
| 4235 | 4201 | .ovli = { |
| 4236 | 4202 | .screen_width = 1, |
| @@ -4320,7 +4286,7 @@ static void dispc_errata_i734_wa(void) · 83 unmodified lines | ||
| 4320 | 4286 | |
| 4321 | 4287 | /* Setup and enable GFX plane */ |
| 4322 | 4288 | dispc_ovl_set_channel_out(OMAP_DSS_GFX, OMAP_DSS_CHANNEL_LCD); |
| 4323 | − dispc_ovl_setup(OMAP_DSS_GFX, &ovli, false, &i734.timings, false); | |
| 4289 | + dispc_ovl_setup(OMAP_DSS_GFX, &ovli, false, &i734.vm, false); | |
| 4324 | 4290 | dispc_ovl_enable(OMAP_DSS_GFX, true); |
| 4325 | 4291 | |
| 4326 | 4292 | /* Set up and enable display manager for LCD1 */ |
| @@ -4328,7 +4294,7 @@ static void dispc_errata_i734_wa(void) · 1 unmodified line | ||
| 4328 | 4294 | dispc_calc_clock_rates(dss_get_dispc_clk_rate(), |
| 4329 | 4295 | &lcd_conf.clock_info); |
| 4330 | 4296 | dispc_mgr_set_lcd_config(OMAP_DSS_CHANNEL_LCD, &lcd_conf); |
| 4331 | − dispc_mgr_set_timings(OMAP_DSS_CHANNEL_LCD, &i734.timings); | |
| 4297 | + dispc_mgr_set_timings(OMAP_DSS_CHANNEL_LCD, &i734.vm); | |
| 4332 | 4298 | |
| 4333 | 4299 | dispc_clear_irqstatus(framedone_irq); |
| 4334 | 4300 | |
| @@ -35,8 +35,8 @@ · 34 unmodified lines | ||
| 35 | 35 | void omapdss_default_get_resolution(struct omap_dss_device *dssdev, |
| 36 | 36 | u16 *xres, u16 *yres) |
| 37 | 37 | { |
| 38 | − *xres = dssdev->panel.timings.x_res; | |
| 39 | − *yres = dssdev->panel.timings.y_res; | |
| 38 | + *xres = dssdev->panel.vm.hactive; | |
| 39 | + *yres = dssdev->panel.vm.vactive; | |
| 40 | 40 | } |
| 41 | 41 | EXPORT_SYMBOL(omapdss_default_get_resolution); |
| 42 | 42 | |
| @@ -72,9 +72,9 @@ int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev) · 29 unmodified lines | ||
| 72 | 72 | EXPORT_SYMBOL(omapdss_default_get_recommended_bpp); |
| 73 | 73 | |
| 74 | 74 | void omapdss_default_get_timings(struct omap_dss_device *dssdev, |
| 75 | − struct omap_video_timings *timings) | |
| 75 | + struct videomode *vm) | |
| 76 | 76 | { |
| 77 | − *timings = dssdev->panel.timings; | |
| 77 | + *vm = dssdev->panel.vm; | |
| 78 | 78 | } |
| 79 | 79 | EXPORT_SYMBOL(omapdss_default_get_timings); |
| 80 | 80 | |
| @@ -217,73 +217,3 @@ struct omap_dss_device *omap_dss_find_device(void *data, · 136 unmodified lines | ||
| 217 | 217 | return NULL; |
| 218 | 218 | } |
| 219 | 219 | EXPORT_SYMBOL(omap_dss_find_device); |
| 220 | − | |
| 221 | −void videomode_to_omap_video_timings(const struct videomode *vm, | |
| 222 | − struct omap_video_timings *ovt) | |
| 223 | −{ | |
| 224 | − memset(ovt, 0, sizeof(*ovt)); | |
| 225 | − | |
| 226 | − ovt->pixelclock = vm->pixelclock; | |
| 227 | − ovt->x_res = vm->hactive; | |
| 228 | − ovt->hbp = vm->hback_porch; | |
| 229 | − ovt->hfp = vm->hfront_porch; | |
| 230 | − ovt->hsw = vm->hsync_len; | |
| 231 | − ovt->y_res = vm->vactive; | |
| 232 | − ovt->vbp = vm->vback_porch; | |
| 233 | − ovt->vfp = vm->vfront_porch; | |
| 234 | − ovt->vsw = vm->vsync_len; | |
| 235 | − | |
| 236 | − ovt->vsync_level = vm->flags & DISPLAY_FLAGS_VSYNC_HIGH ? | |
| 237 | − OMAPDSS_SIG_ACTIVE_HIGH : | |
| 238 | − OMAPDSS_SIG_ACTIVE_LOW; | |
| 239 | − ovt->hsync_level = vm->flags & DISPLAY_FLAGS_HSYNC_HIGH ? | |
| 240 | − OMAPDSS_SIG_ACTIVE_HIGH : | |
| 241 | − OMAPDSS_SIG_ACTIVE_LOW; | |
| 242 | − ovt->de_level = vm->flags & DISPLAY_FLAGS_DE_HIGH ? | |
| 243 | − OMAPDSS_SIG_ACTIVE_HIGH : | |
| 244 | − OMAPDSS_SIG_ACTIVE_LOW; | |
| 245 | − ovt->data_pclk_edge = vm->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE ? | |
| 246 | − OMAPDSS_DRIVE_SIG_RISING_EDGE : | |
| 247 | − OMAPDSS_DRIVE_SIG_FALLING_EDGE; | |
| 248 | − | |
| 249 | − ovt->sync_pclk_edge = ovt->data_pclk_edge; | |
| 250 | −} | |
| 251 | −EXPORT_SYMBOL(videomode_to_omap_video_timings); | |
| 252 | − | |
| 253 | −void omap_video_timings_to_videomode(const struct omap_video_timings *ovt, | |
| 254 | − struct videomode *vm) | |
| 255 | −{ | |
| 256 | − memset(vm, 0, sizeof(*vm)); | |
| 257 | − | |
| 258 | − vm->pixelclock = ovt->pixelclock; | |
| 259 | − | |
| 260 | − vm->hactive = ovt->x_res; | |
| 261 | − vm->hback_porch = ovt->hbp; | |
| 262 | − vm->hfront_porch = ovt->hfp; | |
| 263 | − vm->hsync_len = ovt->hsw; | |
| 264 | − vm->vactive = ovt->y_res; | |
| 265 | − vm->vback_porch = ovt->vbp; | |
| 266 | − vm->vfront_porch = ovt->vfp; | |
| 267 | − vm->vsync_len = ovt->vsw; | |
| 268 | − | |
| 269 | − if (ovt->hsync_level == OMAPDSS_SIG_ACTIVE_HIGH) | |
| 270 | − vm->flags |= DISPLAY_FLAGS_HSYNC_HIGH; | |
| 271 | − else | |
| 272 | − vm->flags |= DISPLAY_FLAGS_HSYNC_LOW; | |
| 273 | − | |
| 274 | − if (ovt->vsync_level == OMAPDSS_SIG_ACTIVE_HIGH) | |
| 275 | − vm->flags |= DISPLAY_FLAGS_VSYNC_HIGH; | |
| 276 | − else | |
| 277 | − vm->flags |= DISPLAY_FLAGS_VSYNC_LOW; | |
| 278 | − | |
| 279 | − if (ovt->de_level == OMAPDSS_SIG_ACTIVE_HIGH) | |
| 280 | − vm->flags |= DISPLAY_FLAGS_DE_HIGH; | |
| 281 | − else | |
| 282 | − vm->flags |= DISPLAY_FLAGS_DE_LOW; | |
| 283 | − | |
| 284 | − if (ovt->data_pclk_edge == OMAPDSS_DRIVE_SIG_RISING_EDGE) | |
| 285 | − vm->flags |= DISPLAY_FLAGS_PIXDATA_POSEDGE; | |
| 286 | − else | |
| 287 | − vm->flags |= DISPLAY_FLAGS_PIXDATA_NEGEDGE; | |
| 288 | −} | |
| 289 | −EXPORT_SYMBOL(omap_video_timings_to_videomode); | |
| @@ -47,7 +47,7 @@ struct dpi_data { · 46 unmodified lines | ||
| 47 | 47 | |
| 48 | 48 | struct mutex lock; |
| 49 | 49 | |
| 50 | − struct omap_video_timings timings; | |
| 50 | + struct videomode vm; | |
| 51 | 51 | struct dss_lcd_mgr_config mgr_config; |
| 52 | 52 | int data_lines; |
| 53 | 53 | |
| @@ -333,31 +333,31 @@ static int dpi_set_mode(struct dpi_data *dpi) · 279 unmodified lines | ||
| 333 | 333 | { |
| 334 | 334 | struct omap_dss_device *out = &dpi->output; |
| 335 | 335 | enum omap_channel channel = out->dispc_channel; |
| 336 | − struct omap_video_timings *t = &dpi->timings; | |
| 336 | + struct videomode *vm = &dpi->vm; | |
| 337 | 337 | int lck_div = 0, pck_div = 0; |
| 338 | 338 | unsigned long fck = 0; |
| 339 | 339 | unsigned long pck; |
| 340 | 340 | int r = 0; |
| 341 | 341 | |
| 342 | 342 | if (dpi->pll) |
| 343 | − r = dpi_set_pll_clk(dpi, channel, t->pixelclock, &fck, | |
| 343 | + r = dpi_set_pll_clk(dpi, channel, vm->pixelclock, &fck, | |
| 344 | 344 | &lck_div, &pck_div); |
| 345 | 345 | else |
| 346 | − r = dpi_set_dispc_clk(dpi, t->pixelclock, &fck, | |
| 346 | + r = dpi_set_dispc_clk(dpi, vm->pixelclock, &fck, | |
| 347 | 347 | &lck_div, &pck_div); |
| 348 | 348 | if (r) |
| 349 | 349 | return r; |
| 350 | 350 | |
| 351 | 351 | pck = fck / lck_div / pck_div; |
| 352 | 352 | |
| 353 | − if (pck != t->pixelclock) { | |
| 354 | − DSSWARN("Could not find exact pixel clock. Requested %d Hz, got %lu Hz\n", | |
| 355 | − t->pixelclock, pck); | |
| 353 | + if (pck != vm->pixelclock) { | |
| 354 | + DSSWARN("Could not find exact pixel clock. Requested %lu Hz, got %lu Hz\n", | |
| 355 | + vm->pixelclock, pck); | |
| 356 | 356 | |
| 357 | − t->pixelclock = pck; | |
| 357 | + vm->pixelclock = pck; | |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | − dss_mgr_set_timings(channel, t); | |
| 360 | + dss_mgr_set_timings(channel, vm); | |
| 361 | 361 | |
| 362 | 362 | return 0; |
| 363 | 363 | } |
| @@ -476,7 +476,7 @@ static void dpi_display_disable(struct omap_dss_device *dssdev) · 112 unmodified lines | ||
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | static void dpi_set_timings(struct omap_dss_device *dssdev, |
| 479 | − struct omap_video_timings *timings) | |
| 479 | + struct videomode *vm) | |
| 480 | 480 | { |
| 481 | 481 | struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev); |
| 482 | 482 | |
| @@ -484,25 +484,25 @@ static void dpi_set_timings(struct omap_dss_device *dssdev, · 1 unmodified line | ||
| 484 | 484 | |
| 485 | 485 | mutex_lock(&dpi->lock); |
| 486 | 486 | |
| 487 | − dpi->timings = *timings; | |
| 487 | + dpi->vm = *vm; | |
| 488 | 488 | |
| 489 | 489 | mutex_unlock(&dpi->lock); |
| 490 | 490 | } |
| 491 | 491 | |
| 492 | 492 | static void dpi_get_timings(struct omap_dss_device *dssdev, |
| 493 | − struct omap_video_timings *timings) | |
| 493 | + struct videomode *vm) | |
| 494 | 494 | { |
| 495 | 495 | struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev); |
| 496 | 496 | |
| 497 | 497 | mutex_lock(&dpi->lock); |
| 498 | 498 | |
| 499 | − *timings = dpi->timings; | |
| 499 | + *vm = dpi->vm; | |
| 500 | 500 | |
| 501 | 501 | mutex_unlock(&dpi->lock); |
| 502 | 502 | } |
| 503 | 503 | |
| 504 | 504 | static int dpi_check_timings(struct omap_dss_device *dssdev, |
| 505 | − struct omap_video_timings *timings) | |
| 505 | + struct videomode *vm) | |
| 506 | 506 | { |
| 507 | 507 | struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev); |
| 508 | 508 | enum omap_channel channel = dpi->output.dispc_channel; |
| @@ -512,23 +512,23 @@ static int dpi_check_timings(struct omap_dss_device *dssdev, · 3 unmodified lines | ||
| 512 | 512 | struct dpi_clk_calc_ctx ctx; |
| 513 | 513 | bool ok; |
| 514 | 514 | |
| 515 | − if (timings->x_res % 8 != 0) | |
| 515 | + if (vm->hactive % 8 != 0) | |
| 516 | 516 | return -EINVAL; |
| 517 | 517 | |
| 518 | − if (!dispc_mgr_timings_ok(channel, timings)) | |
| 518 | + if (!dispc_mgr_timings_ok(channel, vm)) | |
| 519 | 519 | return -EINVAL; |
| 520 | 520 | |
| 521 | − if (timings->pixelclock == 0) | |
| 521 | + if (vm->pixelclock == 0) | |
| 522 | 522 | return -EINVAL; |
| 523 | 523 | |
| 524 | 524 | if (dpi->pll) { |
| 525 | − ok = dpi_pll_clk_calc(dpi, timings->pixelclock, &ctx); | |
| 525 | + ok = dpi_pll_clk_calc(dpi, vm->pixelclock, &ctx); | |
| 526 | 526 | if (!ok) |
| 527 | 527 | return -EINVAL; |
| 528 | 528 | |
| 529 | 529 | fck = ctx.pll_cinfo.clkout[ctx.clkout_idx]; |
| 530 | 530 | } else { |
| 531 | − ok = dpi_dss_clk_calc(timings->pixelclock, &ctx); | |
| 531 | + ok = dpi_dss_clk_calc(vm->pixelclock, &ctx); | |
| 532 | 532 | if (!ok) |
| 533 | 533 | return -EINVAL; |
| 534 | 534 | |
| @@ -540,7 +540,7 @@ static int dpi_check_timings(struct omap_dss_device *dssdev, · 5 unmodified lines | ||
| 540 | 540 | |
| 541 | 541 | pck = fck / lck_div / pck_div; |
| 542 | 542 | |
| 543 | − timings->pixelclock = pck; | |
| 543 | + vm->pixelclock = pck; | |
| 544 | 544 | |
| 545 | 545 | return 0; |
| 546 | 546 | } |
| @@ -289,7 +289,7 @@ struct dsi_clk_calc_ctx { · 288 unmodified lines | ||
| 289 | 289 | struct dss_pll_clock_info dsi_cinfo; |
| 290 | 290 | struct dispc_clock_info dispc_cinfo; |
| 291 | 291 | |
| 292 | − struct omap_video_timings dispc_vm; | |
| 292 | + struct videomode vm; | |
| 293 | 293 | struct omap_dss_dsi_videomode_timings dsi_vm; |
| 294 | 294 | }; |
| 295 | 295 | |
| @@ -383,7 +383,7 @@ struct dsi_data { · 87 unmodified lines | ||
| 383 | 383 | unsigned scp_clk_refcount; |
| 384 | 384 | |
| 385 | 385 | struct dss_lcd_mgr_config mgr_config; |
| 386 | − struct omap_video_timings timings; | |
| 386 | + struct videomode vm; | |
| 387 | 387 | enum omap_dss_dsi_pixel_format pix_fmt; |
| 388 | 388 | enum omap_dss_dsi_mode mode; |
| 389 | 389 | struct omap_dss_dsi_videomode_timings vm_timings; |
| @@ -3321,12 +3321,12 @@ static void dsi_config_vp_num_line_buffers(struct platform_device *dsidev) · 2931 unmodified lines | ||
| 3321 | 3321 | |
| 3322 | 3322 | if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { |
| 3323 | 3323 | int bpp = dsi_get_pixel_size(dsi->pix_fmt); |
| 3324 | − struct omap_video_timings *timings = &dsi->timings; | |
| 3324 | + struct videomode *vm = &dsi->vm; | |
| 3325 | 3325 | /* |
| 3326 | 3326 | * Don't use line buffers if width is greater than the video |
| 3327 | 3327 | * port's line buffer size |
| 3328 | 3328 | */ |
| 3329 | − if (dsi->line_buffer_size <= timings->x_res * bpp / 8) | |
| 3329 | + if (dsi->line_buffer_size <= vm->hactive * bpp / 8) | |
| 3330 | 3330 | num_line_buffers = 0; |
| 3331 | 3331 | else |
| 3332 | 3332 | num_line_buffers = 2; |
| @@ -3453,7 +3453,7 @@ static void dsi_config_cmd_mode_interleaving(struct platform_device *dsidev) · 120 unmodified lines | ||
| 3453 | 3453 | int ddr_clk_pre, ddr_clk_post, enter_hs_mode_lat, exit_hs_mode_lat; |
| 3454 | 3454 | int tclk_trail, ths_exit, exiths_clk; |
| 3455 | 3455 | bool ddr_alwon; |
| 3456 | − struct omap_video_timings *timings = &dsi->timings; | |
| 3456 | + struct videomode *vm = &dsi->vm; | |
| 3457 | 3457 | int bpp = dsi_get_pixel_size(dsi->pix_fmt); |
| 3458 | 3458 | int ndl = dsi->num_lanes_used - 1; |
| 3459 | 3459 | int dsi_fclk_hsdiv = dsi->user_dsi_cinfo.mX[HSDIV_DSI] + 1; |
| @@ -3494,7 +3494,7 @@ static void dsi_config_cmd_mode_interleaving(struct platform_device *dsidev) · 34 unmodified lines | ||
| 3494 | 3494 | |
| 3495 | 3495 | exiths_clk = ths_exit + tclk_trail; |
| 3496 | 3496 | |
| 3497 | − width_bytes = DIV_ROUND_UP(timings->x_res * bpp, 8); | |
| 3497 | + width_bytes = DIV_ROUND_UP(vm->hactive * bpp, 8); | |
| 3498 | 3498 | bllp = hbp + hfp + hsa + DIV_ROUND_UP(width_bytes + 6, ndl); |
| 3499 | 3499 | |
| 3500 | 3500 | if (!hsa_blanking_mode) { |
| @@ -3705,7 +3705,7 @@ static void dsi_proto_timings(struct platform_device *dsidev) · 204 unmodified lines | ||
| 3705 | 3705 | int vbp = dsi->vm_timings.vbp; |
| 3706 | 3706 | int window_sync = dsi->vm_timings.window_sync; |
| 3707 | 3707 | bool hsync_end; |
| 3708 | − struct omap_video_timings *timings = &dsi->timings; | |
| 3708 | + struct videomode *vm = &dsi->vm; | |
| 3709 | 3709 | int bpp = dsi_get_pixel_size(dsi->pix_fmt); |
| 3710 | 3710 | int tl, t_he, width_bytes; |
| 3711 | 3711 | |
| @@ -3713,7 +3713,7 @@ static void dsi_proto_timings(struct platform_device *dsidev) · 1 unmodified line | ||
| 3713 | 3713 | t_he = hsync_end ? |
| 3714 | 3714 | ((hsa == 0 && ndl == 3) ? 1 : DIV_ROUND_UP(4, ndl)) : 0; |
| 3715 | 3715 | |
| 3716 | − width_bytes = DIV_ROUND_UP(timings->x_res * bpp, 8); | |
| 3716 | + width_bytes = DIV_ROUND_UP(vm->hactive * bpp, 8); | |
| 3717 | 3717 | |
| 3718 | 3718 | /* TL = t_HS + HSA + t_HE + HFP + ceil((WC + 6) / NDL) + HBP */ |
| 3719 | 3719 | tl = DIV_ROUND_UP(4, ndl) + (hsync_end ? hsa : 0) + t_he + hfp + |
| @@ -3722,7 +3722,7 @@ static void dsi_proto_timings(struct platform_device *dsidev) · 2 unmodified lines | ||
| 3722 | 3722 | DSSDBG("HBP: %d, HFP: %d, HSA: %d, TL: %d TXBYTECLKHS\n", hbp, |
| 3723 | 3723 | hfp, hsync_end ? hsa : 0, tl); |
| 3724 | 3724 | DSSDBG("VBP: %d, VFP: %d, VSA: %d, VACT: %d lines\n", vbp, vfp, |
| 3725 | − vsa, timings->y_res); | |
| 3725 | + vsa, vm->vactive); | |
| 3726 | 3726 | |
| 3727 | 3727 | r = dsi_read_reg(dsidev, DSI_VM_TIMING1); |
| 3728 | 3728 | r = FLD_MOD(r, hbp, 11, 0); /* HBP */ |
| @@ -3738,7 +3738,7 @@ static void dsi_proto_timings(struct platform_device *dsidev) · 9 unmodified lines | ||
| 3738 | 3738 | dsi_write_reg(dsidev, DSI_VM_TIMING2, r); |
| 3739 | 3739 | |
| 3740 | 3740 | r = dsi_read_reg(dsidev, DSI_VM_TIMING3); |
| 3741 | − r = FLD_MOD(r, timings->y_res, 14, 0); /* VACT */ | |
| 3741 | + r = FLD_MOD(r, vm->vactive, 14, 0); /* VACT */ | |
| 3742 | 3742 | r = FLD_MOD(r, tl, 31, 16); /* TL */ |
| 3743 | 3743 | dsi_write_reg(dsidev, DSI_VM_TIMING3, r); |
| 3744 | 3744 | } |
| @@ -3856,7 +3856,7 @@ static int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel) · 111 unmodified lines | ||
| 3856 | 3856 | /* MODE, 1 = video mode */ |
| 3857 | 3857 | REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), 1, 4, 4); |
| 3858 | 3858 | |
| 3859 | − word_count = DIV_ROUND_UP(dsi->timings.x_res * bpp, 8); | |
| 3859 | + word_count = DIV_ROUND_UP(dsi->vm.hactive * bpp, 8); | |
| 3860 | 3860 | |
| 3861 | 3861 | dsi_vc_write_long_header(dsidev, channel, data_type, |
| 3862 | 3862 | word_count, 0); |
| @@ -3918,8 +3918,8 @@ static void dsi_update_screen_dispc(struct platform_device *dsidev) · 55 unmodified lines | ||
| 3918 | 3918 | int r; |
| 3919 | 3919 | const unsigned channel = dsi->update_channel; |
| 3920 | 3920 | const unsigned line_buf_size = dsi->line_buffer_size; |
| 3921 | − u16 w = dsi->timings.x_res; | |
| 3922 | − u16 h = dsi->timings.y_res; | |
| 3921 | + u16 w = dsi->vm.hactive; | |
| 3922 | + u16 h = dsi->vm.vactive; | |
| 3923 | 3923 | |
| 3924 | 3924 | DSSDBG("dsi_update_screen_dispc(%dx%d)\n", w, h); |
| 3925 | 3925 | |
| @@ -3969,7 +3969,7 @@ static void dsi_update_screen_dispc(struct platform_device *dsidev) · 43 unmodified lines | ||
| 3969 | 3969 | msecs_to_jiffies(250)); |
| 3970 | 3970 | BUG_ON(r == 0); |
| 3971 | 3971 | |
| 3972 | − dss_mgr_set_timings(dispc_channel, &dsi->timings); | |
| 3972 | + dss_mgr_set_timings(dispc_channel, &dsi->vm); | |
| 3973 | 3973 | |
| 3974 | 3974 | dss_mgr_start_update(dispc_channel); |
| 3975 | 3975 | |
| @@ -4056,8 +4056,8 @@ static int dsi_update(struct omap_dss_device *dssdev, int channel, · 80 unmodified lines | ||
| 4056 | 4056 | dsi->framedone_callback = callback; |
| 4057 | 4057 | dsi->framedone_data = data; |
| 4058 | 4058 | |
| 4059 | − dw = dsi->timings.x_res; | |
| 4060 | − dh = dsi->timings.y_res; | |
| 4059 | + dw = dsi->vm.hactive; | |
| 4060 | + dh = dsi->vm.vactive; | |
| 4061 | 4061 | |
| 4062 | 4062 | #ifdef DSI_PERF_MEASURE |
| 4063 | 4063 | dsi->update_bytes = dw * dh * |
| @@ -4120,16 +4120,21 @@ static int dsi_display_init_dispc(struct platform_device *dsidev, · 56 unmodified lines | ||
| 4120 | 4120 | |
| 4121 | 4121 | /* |
| 4122 | 4122 | * override interlace, logic level and edge related parameters in |
| 4123 | − * omap_video_timings with default values | |
| 4123 | + * videomode with default values | |
| 4124 | 4124 | */ |
| 4125 | − dsi->timings.interlace = false; | |
| 4126 | − dsi->timings.hsync_level = OMAPDSS_SIG_ACTIVE_HIGH; | |
| 4127 | − dsi->timings.vsync_level = OMAPDSS_SIG_ACTIVE_HIGH; | |
| 4128 | − dsi->timings.data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; | |
| 4129 | − dsi->timings.de_level = OMAPDSS_SIG_ACTIVE_HIGH; | |
| 4130 | − dsi->timings.sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE; | |
| 4131 | − | |
| 4132 | − dss_mgr_set_timings(channel, &dsi->timings); | |
| 4125 | + dsi->vm.flags &= ~DISPLAY_FLAGS_INTERLACED; | |
| 4126 | + dsi->vm.flags &= ~DISPLAY_FLAGS_HSYNC_LOW; | |
| 4127 | + dsi->vm.flags |= DISPLAY_FLAGS_HSYNC_HIGH; | |
| 4128 | + dsi->vm.flags &= ~DISPLAY_FLAGS_VSYNC_LOW; | |
| 4129 | + dsi->vm.flags |= DISPLAY_FLAGS_VSYNC_HIGH; | |
| 4130 | + dsi->vm.flags &= ~DISPLAY_FLAGS_PIXDATA_NEGEDGE; | |
| 4131 | + dsi->vm.flags |= DISPLAY_FLAGS_PIXDATA_POSEDGE; | |
| 4132 | + dsi->vm.flags &= ~DISPLAY_FLAGS_DE_LOW; | |
| 4133 | + dsi->vm.flags |= DISPLAY_FLAGS_DE_HIGH; | |
| 4134 | + dsi->vm.flags &= ~DISPLAY_FLAGS_SYNC_POSEDGE; | |
| 4135 | + dsi->vm.flags |= DISPLAY_FLAGS_SYNC_NEGEDGE; | |
| 4136 | + | |
| 4137 | + dss_mgr_set_timings(channel, &dsi->vm); | |
| 4133 | 4138 | |
| 4134 | 4139 | r = dsi_configure_dispc_clocks(dsidev); |
| 4135 | 4140 | if (r) |
| @@ -4331,7 +4336,7 @@ static void print_dsi_vm(const char *str, · 195 unmodified lines | ||
| 4331 | 4336 | |
| 4332 | 4337 | wc = DIV_ROUND_UP(t->hact * t->bitspp, 8); |
| 4333 | 4338 | pps = DIV_ROUND_UP(wc + 6, t->ndl); /* pixel packet size */ |
| 4334 | − bl = t->hss + t->hsa + t->hse + t->hbp + t->hfp; | |
| 4339 | + bl = t->hss + t->hsa + t->hse + t->hbp + t->hfront_porch; | |
| 4335 | 4340 | tot = bl + pps; |
| 4336 | 4341 | |
| 4337 | 4342 | #define TO_DSI_T(x) ((u32)div64_u64((u64)x * 1000000000llu, byteclk)) |
| @@ -4340,14 +4345,14 @@ static void print_dsi_vm(const char *str, · 2 unmodified lines | ||
| 4340 | 4345 | "%u/%u/%u/%u/%u/%u = %u + %u = %u\n", |
| 4341 | 4346 | str, |
| 4342 | 4347 | byteclk, |
| 4343 | − t->hss, t->hsa, t->hse, t->hbp, pps, t->hfp, | |
| 4348 | + t->hss, t->hsa, t->hse, t->hbp, pps, t->hfront_porch, | |
| 4344 | 4349 | bl, pps, tot, |
| 4345 | 4350 | TO_DSI_T(t->hss), |
| 4346 | 4351 | TO_DSI_T(t->hsa), |
| 4347 | 4352 | TO_DSI_T(t->hse), |
| 4348 | 4353 | TO_DSI_T(t->hbp), |
| 4349 | 4354 | TO_DSI_T(pps), |
| 4350 | − TO_DSI_T(t->hfp), | |
| 4355 | + TO_DSI_T(t->hfront_porch), | |
| 4351 | 4356 | |
| 4352 | 4357 | TO_DSI_T(bl), |
| 4353 | 4358 | TO_DSI_T(pps), |
| @@ -4356,13 +4361,13 @@ static void print_dsi_vm(const char *str, · 2 unmodified lines | ||
| 4356 | 4361 | #undef TO_DSI_T |
| 4357 | 4362 | } |
| 4358 | 4363 | |
| 4359 | −static void print_dispc_vm(const char *str, const struct omap_video_timings *t) | |
| 4364 | +static void print_dispc_vm(const char *str, const struct videomode *vm) | |
| 4360 | 4365 | { |
| 4361 | − unsigned long pck = t->pixelclock; | |
| 4366 | + unsigned long pck = vm->pixelclock; | |
| 4362 | 4367 | int hact, bl, tot; |
| 4363 | 4368 | |
| 4364 | − hact = t->x_res; | |
| 4365 | − bl = t->hsw + t->hbp + t->hfp; | |
| 4369 | + hact = vm->hactive; | |
| 4370 | + bl = vm->hsync_len + vm->hbp + vm->hfront_porch; | |
| 4366 | 4371 | tot = hact + bl; |
| 4367 | 4372 | |
| 4368 | 4373 | #define TO_DISPC_T(x) ((u32)div64_u64((u64)x * 1000000000llu, pck)) |
| @@ -4371,12 +4376,12 @@ static void print_dispc_vm(const char *str, const struct omap_video_timings *t) · 2 unmodified lines | ||
| 4371 | 4376 | "%u/%u/%u/%u = %u + %u = %u\n", |
| 4372 | 4377 | str, |
| 4373 | 4378 | pck, |
| 4374 | − t->hsw, t->hbp, hact, t->hfp, | |
| 4379 | + vm->hsync_len, vm->hbp, hact, vm->hfront_porch, | |
| 4375 | 4380 | bl, hact, tot, |
| 4376 | − TO_DISPC_T(t->hsw), | |
| 4377 | − TO_DISPC_T(t->hbp), | |
| 4381 | + TO_DISPC_T(vm->hsync_len), | |
| 4382 | + TO_DISPC_T(vm->hbp), | |
| 4378 | 4383 | TO_DISPC_T(hact), |
| 4379 | − TO_DISPC_T(t->hfp), | |
| 4384 | + TO_DISPC_T(vm->hfront_porch), | |
| 4380 | 4385 | TO_DISPC_T(bl), |
| 4381 | 4386 | TO_DISPC_T(hact), |
| 4382 | 4387 | TO_DISPC_T(tot)); |
| @@ -4387,7 +4392,7 @@ static void print_dispc_vm(const char *str, const struct omap_video_timings *t) · 4 unmodified lines | ||
| 4387 | 4392 | static void print_dsi_dispc_vm(const char *str, |
| 4388 | 4393 | const struct omap_dss_dsi_videomode_timings *t) |
| 4389 | 4394 | { |
| 4390 | − struct omap_video_timings vm = { 0 }; | |
| 4395 | + struct videomode vm = { 0 }; | |
| 4391 | 4396 | unsigned long byteclk = t->hsclk / 4; |
| 4392 | 4397 | unsigned long pck; |
| 4393 | 4398 | u64 dsi_tput; |
| @@ -4396,13 +4401,13 @@ static void print_dsi_dispc_vm(const char *str, · 2 unmodified lines | ||
| 4396 | 4401 | dsi_tput = (u64)byteclk * t->ndl * 8; |
| 4397 | 4402 | pck = (u32)div64_u64(dsi_tput, t->bitspp); |
| 4398 | 4403 | dsi_hact = DIV_ROUND_UP(DIV_ROUND_UP(t->hact * t->bitspp, 8) + 6, t->ndl); |
| 4399 | − dsi_htot = t->hss + t->hsa + t->hse + t->hbp + dsi_hact + t->hfp; | |
| 4404 | + dsi_htot = t->hss + t->hsa + t->hse + t->hbp + dsi_hact + t->hfront_porch; | |
| 4400 | 4405 | |
| 4401 | 4406 | vm.pixelclock = pck; |
| 4402 | − vm.hsw = div64_u64((u64)(t->hsa + t->hse) * pck, byteclk); | |
| 4407 | + vm.hsync_len = div64_u64((u64)(t->hsa + t->hse) * pck, byteclk); | |
| 4403 | 4408 | vm.hbp = div64_u64((u64)t->hbp * pck, byteclk); |
| 4404 | − vm.hfp = div64_u64((u64)t->hfp * pck, byteclk); | |
| 4405 | − vm.x_res = t->hact; | |
| 4409 | + vm.hfront_porch = div64_u64((u64)t->hfront_porch * pck, byteclk); | |
| 4410 | + vm.hactive = t->hact; | |
| 4406 | 4411 | |
| 4407 | 4412 | print_dispc_vm(str, &vm); |
| 4408 | 4413 | } |
| @@ -4412,19 +4417,19 @@ static bool dsi_cm_calc_dispc_cb(int lckd, int pckd, unsigned long lck, · 3 unmodified lines | ||
| 4412 | 4417 | unsigned long pck, void *data) |
| 4413 | 4418 | { |
| 4414 | 4419 | struct dsi_clk_calc_ctx *ctx = data; |
| 4415 | − struct omap_video_timings *t = &ctx->dispc_vm; | |
| 4420 | + struct videomode *vm = &ctx->vm; | |
| 4416 | 4421 | |
| 4417 | 4422 | ctx->dispc_cinfo.lck_div = lckd; |
| 4418 | 4423 | ctx->dispc_cinfo.pck_div = pckd; |
| 4419 | 4424 | ctx->dispc_cinfo.lck = lck; |
| 4420 | 4425 | ctx->dispc_cinfo.pck = pck; |
| 4421 | 4426 | |
| 4422 | − *t = *ctx->config->timings; | |
| 4423 | − t->pixelclock = pck; | |
| 4424 | − t->x_res = ctx->config->timings->x_res; | |
| 4425 | − t->y_res = ctx->config->timings->y_res; | |
| 4426 | − t->hsw = t->hfp = t->hbp = t->vsw = 1; | |
| 4427 | − t->vfp = t->vbp = 0; | |
| 4427 | + *vm = *ctx->config->vm; | |
| 4428 | + vm->pixelclock = pck; | |
| 4429 | + vm->hactive = ctx->config->vm->hactive; | |
| 4430 | + vm->vactive = ctx->config->vm->vactive; | |
| 4431 | + vm->hsync_len = vm->hfront_porch = vm->hback_porch = vm->vsync_len = 1; | |
| 4432 | + vm->vfront_porch = vm->vback_porch = 0; | |
| 4428 | 4433 | |
| 4429 | 4434 | return true; |
| 4430 | 4435 | } |
| @@ -4475,7 +4480,7 @@ static bool dsi_cm_calc(struct dsi_data *dsi, · 44 unmodified lines | ||
| 4475 | 4480 | * especially as we go to LP between each pixel packet due to HW |
| 4476 | 4481 | * "feature". So let's just estimate very roughly and multiply by 1.5. |
| 4477 | 4482 | */ |
| 4478 | − pck = cfg->timings->pixelclock; | |
| 4483 | + pck = cfg->vm->pixelclock; | |
| 4479 | 4484 | pck = pck * 3 / 2; |
| 4480 | 4485 | txbyteclk = pck * bitspp / 8 / ndl; |
| 4481 | 4486 | |
| @@ -4510,14 +4515,14 @@ static bool dsi_vm_calc_blanking(struct dsi_clk_calc_ctx *ctx) · 28 unmodified lines | ||
| 4510 | 4515 | int dispc_htot, dispc_hbl; /* pixels */ |
| 4511 | 4516 | int dsi_htot, dsi_hact, dsi_hbl, hss, hse; /* byteclks */ |
| 4512 | 4517 | int hfp, hsa, hbp; |
| 4513 | − const struct omap_video_timings *req_vm; | |
| 4514 | − struct omap_video_timings *dispc_vm; | |
| 4518 | + const struct videomode *req_vm; | |
| 4519 | + struct videomode *dispc_vm; | |
| 4515 | 4520 | struct omap_dss_dsi_videomode_timings *dsi_vm; |
| 4516 | 4521 | u64 dsi_tput, dispc_tput; |
| 4517 | 4522 | |
| 4518 | 4523 | dsi_tput = (u64)byteclk * ndl * 8; |
| 4519 | 4524 | |
| 4520 | − req_vm = cfg->timings; | |
| 4525 | + req_vm = cfg->vm; | |
| 4521 | 4526 | req_pck_min = ctx->req_pck_min; |
| 4522 | 4527 | req_pck_max = ctx->req_pck_max; |
| 4523 | 4528 | req_pck_nom = ctx->req_pck_nom; |
| @@ -4525,9 +4530,10 @@ static bool dsi_vm_calc_blanking(struct dsi_clk_calc_ctx *ctx) · 1 unmodified line | ||
| 4525 | 4530 | dispc_pck = ctx->dispc_cinfo.pck; |
| 4526 | 4531 | dispc_tput = (u64)dispc_pck * bitspp; |
| 4527 | 4532 | |
| 4528 | − xres = req_vm->x_res; | |
| 4533 | + xres = req_vm->hactive; | |
| 4529 | 4534 | |
| 4530 | − panel_hbl = req_vm->hfp + req_vm->hbp + req_vm->hsw; | |
| 4535 | + panel_hbl = req_vm->hfront_porch + req_vm->hback_porch + | |
| 4536 | + req_vm->hsync_len; | |
| 4531 | 4537 | panel_htot = xres + panel_hbl; |
| 4532 | 4538 | |
| 4533 | 4539 | dsi_hact = DIV_ROUND_UP(DIV_ROUND_UP(xres * bitspp, 8) + 6, ndl); |
| @@ -4557,7 +4563,7 @@ static bool dsi_vm_calc_blanking(struct dsi_clk_calc_ctx *ctx) · 23 unmodified lines | ||
| 4557 | 4563 | hss = DIV_ROUND_UP(4, ndl); |
| 4558 | 4564 | |
| 4559 | 4565 | if (cfg->trans_mode == OMAP_DSS_DSI_PULSE_MODE) { |
| 4560 | − if (ndl == 3 && req_vm->hsw == 0) | |
| 4566 | + if (ndl == 3 && req_vm->hsync_len == 0) | |
| 4561 | 4567 | hse = 1; |
| 4562 | 4568 | else |
| 4563 | 4569 | hse = DIV_ROUND_UP(4, ndl); |
| @@ -4596,14 +4602,14 @@ static bool dsi_vm_calc_blanking(struct dsi_clk_calc_ctx *ctx) · 32 unmodified lines | ||
| 4596 | 4602 | |
| 4597 | 4603 | if (cfg->trans_mode != OMAP_DSS_DSI_PULSE_MODE) { |
| 4598 | 4604 | hsa = 0; |
| 4599 | − } else if (ndl == 3 && req_vm->hsw == 0) { | |
| 4605 | + } else if (ndl == 3 && req_vm->hsync_len == 0) { | |
| 4600 | 4606 | hsa = 0; |
| 4601 | 4607 | } else { |
| 4602 | − hsa = div64_u64((u64)req_vm->hsw * byteclk, req_pck_nom); | |
| 4608 | + hsa = div64_u64((u64)req_vm->hsync_len * byteclk, req_pck_nom); | |
| 4603 | 4609 | hsa = max(hsa - hse, 1); |
| 4604 | 4610 | } |
| 4605 | 4611 | |
| 4606 | − hbp = div64_u64((u64)req_vm->hbp * byteclk, req_pck_nom); | |
| 4612 | + hbp = div64_u64((u64)req_vm->hback_porch * byteclk, req_pck_nom); | |
| 4607 | 4613 | hbp = max(hbp, 1); |
| 4608 | 4614 | |
| 4609 | 4615 | hfp = dsi_hbl - (hss + hsa + hse + hbp); |
| @@ -4633,10 +4639,10 @@ static bool dsi_vm_calc_blanking(struct dsi_clk_calc_ctx *ctx) · 23 unmodified lines | ||
| 4633 | 4639 | dsi_vm->hact = xres; |
| 4634 | 4640 | dsi_vm->hfp = hfp; |
| 4635 | 4641 | |
| 4636 | − dsi_vm->vsa = req_vm->vsw; | |
| 4637 | − dsi_vm->vbp = req_vm->vbp; | |
| 4638 | − dsi_vm->vact = req_vm->y_res; | |
| 4639 | − dsi_vm->vfp = req_vm->vfp; | |
| 4642 | + dsi_vm->vsa = req_vm->vsync_len; | |
| 4643 | + dsi_vm->vbp = req_vm->vback_porch; | |
| 4644 | + dsi_vm->vact = req_vm->vactive; | |
| 4645 | + dsi_vm->vfp = req_vm->vfront_porch; | |
| 4640 | 4646 | |
| 4641 | 4647 | dsi_vm->trans_mode = cfg->trans_mode; |
| 4642 | 4648 | |
| @@ -4650,19 +4656,19 @@ static bool dsi_vm_calc_blanking(struct dsi_clk_calc_ctx *ctx) · 7 unmodified lines | ||
| 4650 | 4656 | |
| 4651 | 4657 | /* setup DISPC videomode */ |
| 4652 | 4658 | |
| 4653 | − dispc_vm = &ctx->dispc_vm; | |
| 4659 | + dispc_vm = &ctx->vm; | |
| 4654 | 4660 | *dispc_vm = *req_vm; |
| 4655 | 4661 | dispc_vm->pixelclock = dispc_pck; |
| 4656 | 4662 | |
| 4657 | 4663 | if (cfg->trans_mode == OMAP_DSS_DSI_PULSE_MODE) { |
| 4658 | − hsa = div64_u64((u64)req_vm->hsw * dispc_pck, | |
| 4664 | + hsa = div64_u64((u64)req_vm->hsync_len * dispc_pck, | |
| 4659 | 4665 | req_pck_nom); |
| 4660 | 4666 | hsa = max(hsa, 1); |
| 4661 | 4667 | } else { |
| 4662 | 4668 | hsa = 1; |
| 4663 | 4669 | } |
| 4664 | 4670 | |
| 4665 | − hbp = div64_u64((u64)req_vm->hbp * dispc_pck, req_pck_nom); | |
| 4671 | + hbp = div64_u64((u64)req_vm->hback_porch * dispc_pck, req_pck_nom); | |
| 4666 | 4672 | hbp = max(hbp, 1); |
| 4667 | 4673 | |
| 4668 | 4674 | hfp = dispc_hbl - hsa - hbp; |
| @@ -4685,9 +4691,9 @@ static bool dsi_vm_calc_blanking(struct dsi_clk_calc_ctx *ctx) · 16 unmodified lines | ||
| 4685 | 4691 | if (hfp < 1) |
| 4686 | 4692 | return false; |
| 4687 | 4693 | |
| 4688 | − dispc_vm->hfp = hfp; | |
| 4689 | − dispc_vm->hsw = hsa; | |
| 4690 | − dispc_vm->hbp = hbp; | |
| 4694 | + dispc_vm->hfront_porch = hfp; | |
| 4695 | + dispc_vm->hsync_len = hsa; | |
| 4696 | + dispc_vm->hback_porch = hbp; | |
| 4691 | 4697 | |
| 4692 | 4698 | return true; |
| 4693 | 4699 | } |
| @@ -4707,9 +4713,9 @@ static bool dsi_vm_calc_dispc_cb(int lckd, int pckd, unsigned long lck, · 13 unmodified lines | ||
| 4707 | 4713 | return false; |
| 4708 | 4714 | |
| 4709 | 4715 | #ifdef PRINT_VERBOSE_VM_TIMINGS |
| 4710 | − print_dispc_vm("dispc", &ctx->dispc_vm); | |
| 4716 | + print_dispc_vm("dispc", &ctx->vm); | |
| 4711 | 4717 | print_dsi_vm("dsi ", &ctx->dsi_vm); |
| 4712 | − print_dispc_vm("req ", ctx->config->timings); | |
| 4718 | + print_dispc_vm("req ", ctx->config->vm); | |
| 4713 | 4719 | print_dsi_dispc_vm("act ", &ctx->dsi_vm); |
| 4714 | 4720 | #endif |
| 4715 | 4721 | |
| @@ -4758,7 +4764,7 @@ static bool dsi_vm_calc(struct dsi_data *dsi, · 42 unmodified lines | ||
| 4758 | 4764 | const struct omap_dss_dsi_config *cfg, |
| 4759 | 4765 | struct dsi_clk_calc_ctx *ctx) |
| 4760 | 4766 | { |
| 4761 | − const struct omap_video_timings *t = cfg->timings; | |
| 4767 | + const struct videomode *vm = cfg->vm; | |
| 4762 | 4768 | unsigned long clkin; |
| 4763 | 4769 | unsigned long pll_min; |
| 4764 | 4770 | unsigned long pll_max; |
| @@ -4774,9 +4780,9 @@ static bool dsi_vm_calc(struct dsi_data *dsi, · 9 unmodified lines | ||
| 4774 | 4780 | ctx->config = cfg; |
| 4775 | 4781 | |
| 4776 | 4782 | /* these limits should come from the panel driver */ |
| 4777 | − ctx->req_pck_min = t->pixelclock - 1000; | |
| 4778 | − ctx->req_pck_nom = t->pixelclock; | |
| 4779 | − ctx->req_pck_max = t->pixelclock + 1000; | |
| 4783 | + ctx->req_pck_min = vm->pixelclock - 1000; | |
| 4784 | + ctx->req_pck_nom = vm->pixelclock; | |
| 4785 | + ctx->req_pck_max = vm->pixelclock + 1000; | |
| 4780 | 4786 | |
| 4781 | 4787 | byteclk_min = div64_u64((u64)ctx->req_pck_min * bitspp, ndl * 8); |
| 4782 | 4788 | pll_min = max(cfg->hs_clk_min * 4, byteclk_min * 4 * 4); |
| @@ -4833,7 +4839,7 @@ static int dsi_set_config(struct omap_dss_device *dssdev, · 50 unmodified lines | ||
| 4833 | 4839 | dsi->user_dsi_cinfo = ctx.dsi_cinfo; |
| 4834 | 4840 | dsi->user_dispc_cinfo = ctx.dispc_cinfo; |
| 4835 | 4841 | |
| 4836 | − dsi->timings = ctx.dispc_vm; | |
| 4842 | + dsi->vm = ctx.vm; | |
| 4837 | 4843 | dsi->vm_timings = ctx.dsi_vm; |
| 4838 | 4844 | |
| 4839 | 4845 | mutex_unlock(&dsi->lock); |
| @@ -5342,7 +5348,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data) · 502 unmodified lines | ||
| 5342 | 5348 | |
| 5343 | 5349 | dsi->phy_base = devm_ioremap(&dsidev->dev, res->start, |
| 5344 | 5350 | resource_size(res)); |
| 5345 | − if (!dsi->proto_base) { | |
| 5351 | + if (!dsi->phy_base) { | |
| 5346 | 5352 | DSSERR("can't ioremap DSI PHY\n"); |
| 5347 | 5353 | return -ENOMEM; |
| 5348 | 5354 | } |
| @@ -5362,7 +5368,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data) · 13 unmodified lines | ||
| 5362 | 5368 | |
| 5363 | 5369 | dsi->pll_base = devm_ioremap(&dsidev->dev, res->start, |
| 5364 | 5370 | resource_size(res)); |
| 5365 | − if (!dsi->proto_base) { | |
| 5371 | + if (!dsi->pll_base) { | |
| 5366 | 5372 | DSSERR("can't ioremap DSI PLL\n"); |
| 5367 | 5373 | return -ENOMEM; |
| 5368 | 5374 | } |
| @@ -366,8 +366,7 @@ bool dispc_div_calc(unsigned long dispc, · 365 unmodified lines | ||
| 366 | 366 | unsigned long pck_min, unsigned long pck_max, |
| 367 | 367 | dispc_div_calc_func func, void *data); |
| 368 | 368 | |
| 369 | −bool dispc_mgr_timings_ok(enum omap_channel channel, | |
| 370 | − const struct omap_video_timings *timings); | |
| 369 | +bool dispc_mgr_timings_ok(enum omap_channel channel, const struct videomode *vm); | |
| 371 | 370 | int dispc_calc_clock_rates(unsigned long dispc_fclk_rate, |
| 372 | 371 | struct dispc_clock_info *cinfo); |
| 373 | 372 | |
| @@ -390,7 +389,7 @@ void dispc_wb_enable(bool enable); · 16 unmodified lines | ||
| 390 | 389 | bool dispc_wb_is_enabled(void); |
| 391 | 390 | void dispc_wb_set_channel_in(enum dss_writeback_channel channel); |
| 392 | 391 | int dispc_wb_setup(const struct omap_dss_writeback_info *wi, |
| 393 | − bool mem_to_mem, const struct omap_video_timings *timings); | |
| 392 | + bool mem_to_mem, const struct videomode *vm); | |
| 394 | 393 | |
| 395 | 394 | /* VENC */ |
| 396 | 395 | int venc_init_platform_driver(void) __init; |
| @@ -181,7 +181,7 @@ struct hdmi_video_format { · 180 unmodified lines | ||
| 181 | 181 | }; |
| 182 | 182 | |
| 183 | 183 | struct hdmi_config { |
| 184 | − struct omap_video_timings timings; | |
| 184 | + struct videomode vm; | |
| 185 | 185 | struct hdmi_avi_infoframe infoframe; |
| 186 | 186 | enum hdmi_core_hdmi_dvi hdmi_dvi_mode; |
| 187 | 187 | }; |
| @@ -298,11 +298,11 @@ int hdmi_wp_set_pll_pwr(struct hdmi_wp_data *wp, enum hdmi_pll_pwr val); · 110 unmodified lines | ||
| 298 | 298 | void hdmi_wp_video_config_format(struct hdmi_wp_data *wp, |
| 299 | 299 | struct hdmi_video_format *video_fmt); |
| 300 | 300 | void hdmi_wp_video_config_interface(struct hdmi_wp_data *wp, |
| 301 | − struct omap_video_timings *timings); | |
| 301 | + struct videomode *vm); | |
| 302 | 302 | void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp, |
| 303 | − struct omap_video_timings *timings); | |
| 303 | + struct videomode *vm); | |
| 304 | 304 | void hdmi_wp_init_vid_fmt_timings(struct hdmi_video_format *video_fmt, |
| 305 | − struct omap_video_timings *timings, struct hdmi_config *param); | |
| 305 | + struct videomode *vm, struct hdmi_config *param); | |
| 306 | 306 | int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp); |
| 307 | 307 | phys_addr_t hdmi_wp_get_audio_dma_addr(struct hdmi_wp_data *wp); |
| 308 | 308 | |
| @@ -155,7 +155,7 @@ static void hdmi_power_off_core(struct omap_dss_device *dssdev) · 154 unmodified lines | ||
| 155 | 155 | static int hdmi_power_on_full(struct omap_dss_device *dssdev) |
| 156 | 156 | { |
| 157 | 157 | int r; |
| 158 | − struct omap_video_timings *p; | |
| 158 | + struct videomode *vm; | |
| 159 | 159 | enum omap_channel channel = dssdev->dispc_channel; |
| 160 | 160 | struct hdmi_wp_data *wp = &hdmi.wp; |
| 161 | 161 | struct dss_pll_clock_info hdmi_cinfo = { 0 }; |
| @@ -169,12 +169,13 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev) · 7 unmodified lines | ||
| 169 | 169 | hdmi_wp_clear_irqenable(wp, 0xffffffff); |
| 170 | 170 | hdmi_wp_set_irqstatus(wp, 0xffffffff); |
| 171 | 171 | |
| 172 | − p = &hdmi.cfg.timings; | |
| 172 | + vm = &hdmi.cfg.vm; | |
| 173 | 173 | |
| 174 | − DSSDBG("hdmi_power_on x_res= %d y_res = %d\n", p->x_res, p->y_res); | |
| 174 | + DSSDBG("hdmi_power_on hactive= %d vactive = %d\n", vm->hactive, | |
| 175 | + vm->vactive); | |
| 175 | 176 | |
| 176 | − pc = p->pixelclock; | |
| 177 | − if (p->double_pixel) | |
| 177 | + pc = vm->pixelclock; | |
| 178 | + if (vm->flags & DISPLAY_FLAGS_DOUBLECLK) | |
| 178 | 179 | pc *= 2; |
| 179 | 180 | |
| 180 | 181 | /* DSS_HDMI_TCLK is bitclk / 10 */ |
| @@ -209,7 +210,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev) · 28 unmodified lines | ||
| 209 | 210 | hdmi4_configure(&hdmi.core, &hdmi.wp, &hdmi.cfg); |
| 210 | 211 | |
| 211 | 212 | /* tv size */ |
| 212 | − dss_mgr_set_timings(channel, p); | |
| 213 | + dss_mgr_set_timings(channel, vm); | |
| 213 | 214 | |
| 214 | 215 | r = dss_mgr_enable(channel); |
| 215 | 216 | if (r) |
| @@ -255,30 +256,30 @@ static void hdmi_power_off_full(struct omap_dss_device *dssdev) · 39 unmodified lines | ||
| 255 | 256 | } |
| 256 | 257 | |
| 257 | 258 | static int hdmi_display_check_timing(struct omap_dss_device *dssdev, |
| 258 | − struct omap_video_timings *timings) | |
| 259 | + struct videomode *vm) | |
| 259 | 260 | { |
| 260 | − if (!dispc_mgr_timings_ok(dssdev->dispc_channel, timings)) | |
| 261 | + if (!dispc_mgr_timings_ok(dssdev->dispc_channel, vm)) | |
| 261 | 262 | return -EINVAL; |
| 262 | 263 | |
| 263 | 264 | return 0; |
| 264 | 265 | } |
| 265 | 266 | |
| 266 | 267 | static void hdmi_display_set_timing(struct omap_dss_device *dssdev, |
| 267 | − struct omap_video_timings *timings) | |
| 268 | + struct videomode *vm) | |
| 268 | 269 | { |
| 269 | 270 | mutex_lock(&hdmi.lock); |
| 270 | 271 | |
| 271 | − hdmi.cfg.timings = *timings; | |
| 272 | + hdmi.cfg.vm = *vm; | |
| 272 | 273 | |
| 273 | − dispc_set_tv_pclk(timings->pixelclock); | |
| 274 | + dispc_set_tv_pclk(vm->pixelclock); | |
| 274 | 275 | |
| 275 | 276 | mutex_unlock(&hdmi.lock); |
| 276 | 277 | } |
| 277 | 278 | |
| 278 | 279 | static void hdmi_display_get_timings(struct omap_dss_device *dssdev, |
| 279 | − struct omap_video_timings *timings) | |
| 280 | + struct videomode *vm) | |
| 280 | 281 | { |
| 281 | − *timings = hdmi.cfg.timings; | |
| 282 | + *vm = hdmi.cfg.vm; | |
| 282 | 283 | } |
| 283 | 284 | |
| 284 | 285 | static void hdmi_dump_regs(struct seq_file *s) |
| @@ -352,7 +353,7 @@ static int hdmi_display_enable(struct omap_dss_device *dssdev) · 67 unmodified lines | ||
| 352 | 353 | |
| 353 | 354 | if (hdmi.audio_configured) { |
| 354 | 355 | r = hdmi4_audio_config(&hdmi.core, &hdmi.wp, &hdmi.audio_config, |
| 355 | − hdmi.cfg.timings.pixelclock); | |
| 356 | + hdmi.cfg.vm.pixelclock); | |
| 356 | 357 | if (r) { |
| 357 | 358 | DSSERR("Error restoring audio configuration: %d", r); |
| 358 | 359 | hdmi.audio_abort_cb(&hdmi.pdev->dev); |
| @@ -643,7 +644,7 @@ static int hdmi_audio_config(struct device *dev, · 284 unmodified lines | ||
| 643 | 644 | } |
| 644 | 645 | |
| 645 | 646 | ret = hdmi4_audio_config(&hd->core, &hd->wp, dss_audio, |
| 646 | − hd->cfg.timings.pixelclock); | |
| 647 | + hd->cfg.vm.pixelclock); | |
| 647 | 648 | if (!ret) { |
| 648 | 649 | hd->audio_configured = true; |
| 649 | 650 | hd->audio_config = *dss_audio; |
| @@ -310,7 +310,7 @@ void hdmi4_configure(struct hdmi_core_data *core, · 309 unmodified lines | ||
| 310 | 310 | struct hdmi_wp_data *wp, struct hdmi_config *cfg) |
| 311 | 311 | { |
| 312 | 312 | /* HDMI */ |
| 313 | − struct omap_video_timings video_timing; | |
| 313 | + struct videomode vm; | |
| 314 | 314 | struct hdmi_video_format video_format; |
| 315 | 315 | /* HDMI core */ |
| 316 | 316 | struct hdmi_core_video_config v_core_cfg; |
| @@ -318,16 +318,16 @@ void hdmi4_configure(struct hdmi_core_data *core, · 1 unmodified line | ||
| 318 | 318 | |
| 319 | 319 | hdmi_core_init(&v_core_cfg); |
| 320 | 320 | |
| 321 | − hdmi_wp_init_vid_fmt_timings(&video_format, &video_timing, cfg); | |
| 321 | + hdmi_wp_init_vid_fmt_timings(&video_format, &vm, cfg); | |
| 322 | 322 | |
| 323 | − hdmi_wp_video_config_timing(wp, &video_timing); | |
| 323 | + hdmi_wp_video_config_timing(wp, &vm); | |
| 324 | 324 | |
| 325 | 325 | /* video config */ |
| 326 | 326 | video_format.packing_mode = HDMI_PACK_24b_RGB_YUV444_YUV422; |
| 327 | 327 | |
| 328 | 328 | hdmi_wp_video_config_format(wp, &video_format); |
| 329 | 329 | |
| 330 | − hdmi_wp_video_config_interface(wp, &video_timing); | |
| 330 | + hdmi_wp_video_config_interface(wp, &vm); | |
| 331 | 331 | |
| 332 | 332 | /* |
| 333 | 333 | * configure core video part |
| @@ -172,7 +172,7 @@ static void hdmi_power_off_core(struct omap_dss_device *dssdev) · 171 unmodified lines | ||
| 172 | 172 | static int hdmi_power_on_full(struct omap_dss_device *dssdev) |
| 173 | 173 | { |
| 174 | 174 | int r; |
| 175 | − struct omap_video_timings *p; | |
| 175 | + struct videomode *vm; | |
| 176 | 176 | enum omap_channel channel = dssdev->dispc_channel; |
| 177 | 177 | struct dss_pll_clock_info hdmi_cinfo = { 0 }; |
| 178 | 178 | unsigned pc; |
| @@ -181,12 +181,13 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev) · 2 unmodified lines | ||
| 181 | 181 | if (r) |
| 182 | 182 | return r; |
| 183 | 183 | |
| 184 | − p = &hdmi.cfg.timings; | |
| 184 | + vm = &hdmi.cfg.vm; | |
| 185 | 185 | |
| 186 | − DSSDBG("hdmi_power_on x_res= %d y_res = %d\n", p->x_res, p->y_res); | |
| 186 | + DSSDBG("hdmi_power_on hactive= %d vactive = %d\n", vm->hactive, | |
| 187 | + vm->vactive); | |
| 187 | 188 | |
| 188 | − pc = p->pixelclock; | |
| 189 | − if (p->double_pixel) | |
| 189 | + pc = vm->pixelclock; | |
| 190 | + if (vm->flags & DISPLAY_FLAGS_DOUBLECLK) | |
| 190 | 191 | pc *= 2; |
| 191 | 192 | |
| 192 | 193 | /* DSS_HDMI_TCLK is bitclk / 10 */ |
| @@ -226,7 +227,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev) · 33 unmodified lines | ||
| 226 | 227 | hdmi5_configure(&hdmi.core, &hdmi.wp, &hdmi.cfg); |
| 227 | 228 | |
| 228 | 229 | /* tv size */ |
| 229 | − dss_mgr_set_timings(channel, p); | |
| 230 | + dss_mgr_set_timings(channel, vm); | |
| 230 | 231 | |
| 231 | 232 | r = dss_mgr_enable(channel); |
| 232 | 233 | if (r) |
| @@ -272,30 +273,30 @@ static void hdmi_power_off_full(struct omap_dss_device *dssdev) · 39 unmodified lines | ||
| 272 | 273 | } |
| 273 | 274 | |
| 274 | 275 | static int hdmi_display_check_timing(struct omap_dss_device *dssdev, |
| 275 | − struct omap_video_timings *timings) | |
| 276 | + struct videomode *vm) | |
| 276 | 277 | { |
| 277 | − if (!dispc_mgr_timings_ok(dssdev->dispc_channel, timings)) | |
| 278 | + if (!dispc_mgr_timings_ok(dssdev->dispc_channel, vm)) | |
| 278 | 279 | return -EINVAL; |
| 279 | 280 | |
| 280 | 281 | return 0; |
| 281 | 282 | } |
| 282 | 283 | |
| 283 | 284 | static void hdmi_display_set_timing(struct omap_dss_device *dssdev, |
| 284 | − struct omap_video_timings *timings) | |
| 285 | + struct videomode *vm) | |
| 285 | 286 | { |
| 286 | 287 | mutex_lock(&hdmi.lock); |
| 287 | 288 | |
| 288 | − hdmi.cfg.timings = *timings; | |
| 289 | + hdmi.cfg.vm = *vm; | |
| 289 | 290 | |
| 290 | − dispc_set_tv_pclk(timings->pixelclock); | |
| 291 | + dispc_set_tv_pclk(vm->pixelclock); | |
| 291 | 292 | |
| 292 | 293 | mutex_unlock(&hdmi.lock); |
| 293 | 294 | } |
| 294 | 295 | |
| 295 | 296 | static void hdmi_display_get_timings(struct omap_dss_device *dssdev, |
| 296 | − struct omap_video_timings *timings) | |
| 297 | + struct videomode *vm) | |
| 297 | 298 | { |
| 298 | − *timings = hdmi.cfg.timings; | |
| 299 | + *vm = hdmi.cfg.vm; | |
| 299 | 300 | } |
| 300 | 301 | |
| 301 | 302 | static void hdmi_dump_regs(struct seq_file *s) |
| @@ -378,7 +379,7 @@ static int hdmi_display_enable(struct omap_dss_device *dssdev) · 76 unmodified lines | ||
| 378 | 379 | |
| 379 | 380 | if (hdmi.audio_configured) { |
| 380 | 381 | r = hdmi5_audio_config(&hdmi.core, &hdmi.wp, &hdmi.audio_config, |
| 381 | − hdmi.cfg.timings.pixelclock); | |
| 382 | + hdmi.cfg.vm.pixelclock); | |
| 382 | 383 | if (r) { |
| 383 | 384 | DSSERR("Error restoring audio configuration: %d", r); |
| 384 | 385 | hdmi.audio_abort_cb(&hdmi.pdev->dev); |
| @@ -669,7 +670,7 @@ static int hdmi_audio_config(struct device *dev, · 284 unmodified lines | ||
| 669 | 670 | } |
| 670 | 671 | |
| 671 | 672 | ret = hdmi5_audio_config(&hd->core, &hd->wp, dss_audio, |
| 672 | − hd->cfg.timings.pixelclock); | |
| 673 | + hd->cfg.vm.pixelclock); | |
| 673 | 674 | |
| 674 | 675 | if (!ret) { |
| 675 | 676 | hd->audio_configured = true; |
| @@ -292,35 +292,35 @@ static void hdmi_core_init(struct hdmi_core_vid_config *video_cfg, · 291 unmodified lines | ||
| 292 | 292 | { |
| 293 | 293 | DSSDBG("hdmi_core_init\n"); |
| 294 | 294 | |
| 295 | − video_cfg->v_fc_config.timings = cfg->timings; | |
| 295 | + video_cfg->v_fc_config.vm = cfg->vm; | |
| 296 | 296 | |
| 297 | 297 | /* video core */ |
| 298 | 298 | video_cfg->data_enable_pol = 1; /* It is always 1*/ |
| 299 | − video_cfg->hblank = cfg->timings.hfp + | |
| 300 | − cfg->timings.hbp + cfg->timings.hsw; | |
| 299 | + video_cfg->hblank = cfg->vm.hfront_porch + | |
| 300 | + cfg->vm.hback_porch + cfg->vm.hsync_len; | |
| 301 | 301 | video_cfg->vblank_osc = 0; |
| 302 | − video_cfg->vblank = cfg->timings.vsw + | |
| 303 | − cfg->timings.vfp + cfg->timings.vbp; | |
| 302 | + video_cfg->vblank = cfg->vm.vsync_len + cfg->vm.vfront_porch + | |
| 303 | + cfg->vm.vback_porch; | |
| 304 | 304 | video_cfg->v_fc_config.hdmi_dvi_mode = cfg->hdmi_dvi_mode; |
| 305 | 305 | |
| 306 | − if (cfg->timings.interlace) { | |
| 306 | + if (cfg->vm.flags & DISPLAY_FLAGS_INTERLACED) { | |
| 307 | 307 | /* set vblank_osc if vblank is fractional */ |
| 308 | 308 | if (video_cfg->vblank % 2 != 0) |
| 309 | 309 | video_cfg->vblank_osc = 1; |
| 310 | 310 | |
| 311 | − video_cfg->v_fc_config.timings.y_res /= 2; | |
| 311 | + video_cfg->v_fc_config.vm.vactive /= 2; | |
| 312 | 312 | video_cfg->vblank /= 2; |
| 313 | − video_cfg->v_fc_config.timings.vfp /= 2; | |
| 314 | − video_cfg->v_fc_config.timings.vsw /= 2; | |
| 315 | − video_cfg->v_fc_config.timings.vbp /= 2; | |
| 313 | + video_cfg->v_fc_config.vm.vfront_porch /= 2; | |
| 314 | + video_cfg->v_fc_config.vm.vsync_len /= 2; | |
| 315 | + video_cfg->v_fc_config.vm.vback_porch /= 2; | |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | − if (cfg->timings.double_pixel) { | |
| 319 | − video_cfg->v_fc_config.timings.x_res *= 2; | |
| 318 | + if (cfg->vm.flags & DISPLAY_FLAGS_DOUBLECLK) { | |
| 319 | + video_cfg->v_fc_config.vm.hactive *= 2; | |
| 320 | 320 | video_cfg->hblank *= 2; |
| 321 | − video_cfg->v_fc_config.timings.hfp *= 2; | |
| 322 | − video_cfg->v_fc_config.timings.hsw *= 2; | |
| 323 | − video_cfg->v_fc_config.timings.hbp *= 2; | |
| 321 | + video_cfg->v_fc_config.vm.hfront_porch *= 2; | |
| 322 | + video_cfg->v_fc_config.vm.hsync_len *= 2; | |
| 323 | + video_cfg->v_fc_config.vm.hback_porch *= 2; | |
| 324 | 324 | } |
| 325 | 325 | } |
| 326 | 326 | |
| @@ -329,13 +329,12 @@ static void hdmi_core_video_config(struct hdmi_core_data *core, · 2 unmodified lines | ||
| 329 | 329 | struct hdmi_core_vid_config *cfg) |
| 330 | 330 | { |
| 331 | 331 | void __iomem *base = core->base; |
| 332 | + struct videomode *vm = &cfg->v_fc_config.vm; | |
| 332 | 333 | unsigned char r = 0; |
| 333 | 334 | bool vsync_pol, hsync_pol; |
| 334 | 335 | |
| 335 | − vsync_pol = | |
| 336 | − cfg->v_fc_config.timings.vsync_level == OMAPDSS_SIG_ACTIVE_HIGH; | |
| 337 | − hsync_pol = | |
| 338 | − cfg->v_fc_config.timings.hsync_level == OMAPDSS_SIG_ACTIVE_HIGH; | |
| 336 | + vsync_pol = !!(vm->flags & DISPLAY_FLAGS_VSYNC_HIGH); | |
| 337 | + hsync_pol = !!(vm->flags & DISPLAY_FLAGS_HSYNC_HIGH); | |
| 339 | 338 | |
| 340 | 339 | /* Set hsync, vsync and data-enable polarity */ |
| 341 | 340 | r = hdmi_read_reg(base, HDMI_CORE_FC_INVIDCONF); |
| @@ -343,20 +342,16 @@ static void hdmi_core_video_config(struct hdmi_core_data *core, · 1 unmodified line | ||
| 343 | 342 | r = FLD_MOD(r, hsync_pol, 5, 5); |
| 344 | 343 | r = FLD_MOD(r, cfg->data_enable_pol, 4, 4); |
| 345 | 344 | r = FLD_MOD(r, cfg->vblank_osc, 1, 1); |
| 346 | − r = FLD_MOD(r, cfg->v_fc_config.timings.interlace, 0, 0); | |
| 345 | + r = FLD_MOD(r, !!(vm->flags & DISPLAY_FLAGS_INTERLACED), 0, 0); | |
| 347 | 346 | hdmi_write_reg(base, HDMI_CORE_FC_INVIDCONF, r); |
| 348 | 347 | |
| 349 | 348 | /* set x resolution */ |
| 350 | − REG_FLD_MOD(base, HDMI_CORE_FC_INHACTIV1, | |
| 351 | − cfg->v_fc_config.timings.x_res >> 8, 4, 0); | |
| 352 | − REG_FLD_MOD(base, HDMI_CORE_FC_INHACTIV0, | |
| 353 | − cfg->v_fc_config.timings.x_res & 0xFF, 7, 0); | |
| 349 | + REG_FLD_MOD(base, HDMI_CORE_FC_INHACTIV1, vm->hactive >> 8, 4, 0); | |
| 350 | + REG_FLD_MOD(base, HDMI_CORE_FC_INHACTIV0, vm->hactive & 0xFF, 7, 0); | |
| 354 | 351 | |
| 355 | 352 | /* set y resolution */ |
| 356 | − REG_FLD_MOD(base, HDMI_CORE_FC_INVACTIV1, | |
| 357 | − cfg->v_fc_config.timings.y_res >> 8, 4, 0); | |
| 358 | − REG_FLD_MOD(base, HDMI_CORE_FC_INVACTIV0, | |
| 359 | − cfg->v_fc_config.timings.y_res & 0xFF, 7, 0); | |
| 353 | + REG_FLD_MOD(base, HDMI_CORE_FC_INVACTIV1, vm->vactive >> 8, 4, 0); | |
| 354 | + REG_FLD_MOD(base, HDMI_CORE_FC_INVACTIV0, vm->vactive & 0xFF, 7, 0); | |
| 360 | 355 | |
| 361 | 356 | /* set horizontal blanking pixels */ |
| 362 | 357 | REG_FLD_MOD(base, HDMI_CORE_FC_INHBLANK1, cfg->hblank >> 8, 4, 0); |
| @@ -366,30 +361,28 @@ static void hdmi_core_video_config(struct hdmi_core_data *core, · 3 unmodified lines | ||
| 366 | 361 | REG_FLD_MOD(base, HDMI_CORE_FC_INVBLANK, cfg->vblank, 7, 0); |
| 367 | 362 | |
| 368 | 363 | /* set horizontal sync offset */ |
| 369 | − REG_FLD_MOD(base, HDMI_CORE_FC_HSYNCINDELAY1, | |
| 370 | − cfg->v_fc_config.timings.hfp >> 8, 4, 0); | |
| 371 | − REG_FLD_MOD(base, HDMI_CORE_FC_HSYNCINDELAY0, | |
| 372 | − cfg->v_fc_config.timings.hfp & 0xFF, 7, 0); | |
| 364 | + REG_FLD_MOD(base, HDMI_CORE_FC_HSYNCINDELAY1, vm->hfront_porch >> 8, | |
| 365 | + 4, 0); | |
| 366 | + REG_FLD_MOD(base, HDMI_CORE_FC_HSYNCINDELAY0, vm->hfront_porch & 0xFF, | |
| 367 | + 7, 0); | |
| 373 | 368 | |
| 374 | 369 | /* set vertical sync offset */ |
| 375 | − REG_FLD_MOD(base, HDMI_CORE_FC_VSYNCINDELAY, | |
| 376 | − cfg->v_fc_config.timings.vfp, 7, 0); | |
| 370 | + REG_FLD_MOD(base, HDMI_CORE_FC_VSYNCINDELAY, vm->vfront_porch, 7, 0); | |
| 377 | 371 | |
| 378 | 372 | /* set horizontal sync pulse width */ |
| 379 | − REG_FLD_MOD(base, HDMI_CORE_FC_HSYNCINWIDTH1, | |
| 380 | − (cfg->v_fc_config.timings.hsw >> 8), 1, 0); | |
| 381 | − REG_FLD_MOD(base, HDMI_CORE_FC_HSYNCINWIDTH0, | |
| 382 | − cfg->v_fc_config.timings.hsw & 0xFF, 7, 0); | |
| 373 | + REG_FLD_MOD(base, HDMI_CORE_FC_HSYNCINWIDTH1, (vm->hsync_len >> 8), | |
| 374 | + 1, 0); | |
| 375 | + REG_FLD_MOD(base, HDMI_CORE_FC_HSYNCINWIDTH0, vm->hsync_len & 0xFF, | |
| 376 | + 7, 0); | |
| 383 | 377 | |
| 384 | 378 | /* set vertical sync pulse width */ |
| 385 | − REG_FLD_MOD(base, HDMI_CORE_FC_VSYNCINWIDTH, | |
| 386 | − cfg->v_fc_config.timings.vsw, 5, 0); | |
| 379 | + REG_FLD_MOD(base, HDMI_CORE_FC_VSYNCINWIDTH, vm->vsync_len, 5, 0); | |
| 387 | 380 | |
| 388 | 381 | /* select DVI mode */ |
| 389 | 382 | REG_FLD_MOD(base, HDMI_CORE_FC_INVIDCONF, |
| 390 | − cfg->v_fc_config.hdmi_dvi_mode, 3, 3); | |
| 383 | + cfg->v_fc_config.hdmi_dvi_mode, 3, 3); | |
| 391 | 384 | |
| 392 | − if (cfg->v_fc_config.timings.double_pixel) | |
| 385 | + if (vm->flags & DISPLAY_FLAGS_DOUBLECLK) | |
| 393 | 386 | REG_FLD_MOD(base, HDMI_CORE_FC_PRCONF, 2, 7, 4); |
| 394 | 387 | else |
| 395 | 388 | REG_FLD_MOD(base, HDMI_CORE_FC_PRCONF, 1, 7, 4); |
| @@ -616,7 +609,7 @@ int hdmi5_core_handle_irqs(struct hdmi_core_data *core) · 220 unmodified lines | ||
| 616 | 609 | void hdmi5_configure(struct hdmi_core_data *core, struct hdmi_wp_data *wp, |
| 617 | 610 | struct hdmi_config *cfg) |
| 618 | 611 | { |
| 619 | − struct omap_video_timings video_timing; | |
| 612 | + struct videomode vm; | |
| 620 | 613 | struct hdmi_video_format video_format; |
| 621 | 614 | struct hdmi_core_vid_config v_core_cfg; |
| 622 | 615 | |
| @@ -624,16 +617,16 @@ void hdmi5_configure(struct hdmi_core_data *core, struct hdmi_wp_data *wp, · 1 unmodified line | ||
| 624 | 617 | |
| 625 | 618 | hdmi_core_init(&v_core_cfg, cfg); |
| 626 | 619 | |
| 627 | − hdmi_wp_init_vid_fmt_timings(&video_format, &video_timing, cfg); | |
| 620 | + hdmi_wp_init_vid_fmt_timings(&video_format, &vm, cfg); | |
| 628 | 621 | |
| 629 | − hdmi_wp_video_config_timing(wp, &video_timing); | |
| 622 | + hdmi_wp_video_config_timing(wp, &vm); | |
| 630 | 623 | |
| 631 | 624 | /* video config */ |
| 632 | 625 | video_format.packing_mode = HDMI_PACK_24b_RGB_YUV444_YUV422; |
| 633 | 626 | |
| 634 | 627 | hdmi_wp_video_config_format(wp, &video_format); |
| 635 | 628 | |
| 636 | − hdmi_wp_video_config_interface(wp, &video_timing); | |
| 629 | + hdmi_wp_video_config_interface(wp, &vm); | |
| 637 | 630 | |
| 638 | 631 | /* support limited range with 24 bit color depth for now */ |
| 639 | 632 | hdmi_core_configure_range(core); |
| @@ -144,87 +144,84 @@ void hdmi_wp_video_config_format(struct hdmi_wp_data *wp, · 143 unmodified lines | ||
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | void hdmi_wp_video_config_interface(struct hdmi_wp_data *wp, |
| 147 | − struct omap_video_timings *timings) | |
| 147 | + struct videomode *vm) | |
| 148 | 148 | { |
| 149 | 149 | u32 r; |
| 150 | 150 | bool vsync_pol, hsync_pol; |
| 151 | 151 | DSSDBG("Enter hdmi_wp_video_config_interface\n"); |
| 152 | 152 | |
| 153 | − vsync_pol = timings->vsync_level == OMAPDSS_SIG_ACTIVE_HIGH; | |
| 154 | − hsync_pol = timings->hsync_level == OMAPDSS_SIG_ACTIVE_HIGH; | |
| 153 | + vsync_pol = !!(vm->flags & DISPLAY_FLAGS_VSYNC_HIGH); | |
| 154 | + hsync_pol = !!(vm->flags & DISPLAY_FLAGS_HSYNC_HIGH); | |
| 155 | 155 | |
| 156 | 156 | r = hdmi_read_reg(wp->base, HDMI_WP_VIDEO_CFG); |
| 157 | 157 | r = FLD_MOD(r, vsync_pol, 7, 7); |
| 158 | 158 | r = FLD_MOD(r, hsync_pol, 6, 6); |
| 159 | − r = FLD_MOD(r, timings->interlace, 3, 3); | |
| 159 | + r = FLD_MOD(r, !!(vm->flags & DISPLAY_FLAGS_INTERLACED), 3, 3); | |
| 160 | 160 | r = FLD_MOD(r, 1, 1, 0); /* HDMI_TIMING_MASTER_24BIT */ |
| 161 | 161 | hdmi_write_reg(wp->base, HDMI_WP_VIDEO_CFG, r); |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp, |
| 165 | − struct omap_video_timings *timings) | |
| 165 | + struct videomode *vm) | |
| 166 | 166 | { |
| 167 | 167 | u32 timing_h = 0; |
| 168 | 168 | u32 timing_v = 0; |
| 169 | − unsigned hsw_offset = 1; | |
| 169 | + unsigned hsync_len_offset = 1; | |
| 170 | 170 | |
| 171 | 171 | DSSDBG("Enter hdmi_wp_video_config_timing\n"); |
| 172 | 172 | |
| 173 | 173 | /* |
| 174 | 174 | * On OMAP4 and OMAP5 ES1 the HSW field is programmed as is. On OMAP5 |
| 175 | − * ES2+ (including DRA7/AM5 SoCs) HSW field is programmed to hsw-1. | |
| 175 | + * ES2+ (including DRA7/AM5 SoCs) HSW field is programmed to hsync_len-1. | |
| 176 | 176 | * However, we don't support OMAP5 ES1 at all, so we can just check for |
| 177 | 177 | * OMAP4 here. |
| 178 | 178 | */ |
| 179 | 179 | if (omapdss_get_version() == OMAPDSS_VER_OMAP4430_ES1 || |
| 180 | 180 | omapdss_get_version() == OMAPDSS_VER_OMAP4430_ES2 || |
| 181 | 181 | omapdss_get_version() == OMAPDSS_VER_OMAP4) |
| 182 | − hsw_offset = 0; | |
| 182 | + hsync_len_offset = 0; | |
| 183 | 183 | |
| 184 | − timing_h |= FLD_VAL(timings->hbp, 31, 20); | |
| 185 | − timing_h |= FLD_VAL(timings->hfp, 19, 8); | |
| 186 | − timing_h |= FLD_VAL(timings->hsw - hsw_offset, 7, 0); | |
| 184 | + timing_h |= FLD_VAL(vm->hback_porch, 31, 20); | |
| 185 | + timing_h |= FLD_VAL(vm->hfront_porch, 19, 8); | |
| 186 | + timing_h |= FLD_VAL(vm->hsync_len - hsync_len_offset, 7, 0); | |
| 187 | 187 | hdmi_write_reg(wp->base, HDMI_WP_VIDEO_TIMING_H, timing_h); |
| 188 | 188 | |
| 189 | − timing_v |= FLD_VAL(timings->vbp, 31, 20); | |
| 190 | − timing_v |= FLD_VAL(timings->vfp, 19, 8); | |
| 191 | − timing_v |= FLD_VAL(timings->vsw, 7, 0); | |
| 189 | + timing_v |= FLD_VAL(vm->vback_porch, 31, 20); | |
| 190 | + timing_v |= FLD_VAL(vm->vfront_porch, 19, 8); | |
| 191 | + timing_v |= FLD_VAL(vm->vsync_len, 7, 0); | |
| 192 | 192 | hdmi_write_reg(wp->base, HDMI_WP_VIDEO_TIMING_V, timing_v); |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | void hdmi_wp_init_vid_fmt_timings(struct hdmi_video_format *video_fmt, |
| 196 | − struct omap_video_timings *timings, struct hdmi_config *param) | |
| 196 | + struct videomode *vm, struct hdmi_config *param) | |
| 197 | 197 | { |
| 198 | 198 | DSSDBG("Enter hdmi_wp_video_init_format\n"); |
| 199 | 199 | |
| 200 | 200 | video_fmt->packing_mode = HDMI_PACK_10b_RGB_YUV444; |
| 201 | − video_fmt->y_res = param->timings.y_res; | |
| 202 | − video_fmt->x_res = param->timings.x_res; | |
| 203 | − | |
| 204 | − timings->hbp = param->timings.hbp; | |
| 205 | − timings->hfp = param->timings.hfp; | |
| 206 | − timings->hsw = param->timings.hsw; | |
| 207 | − timings->vbp = param->timings.vbp; | |
| 208 | − timings->vfp = param->timings.vfp; | |
| 209 | − timings->vsw = param->timings.vsw; | |
| 210 | − | |
| 211 | − timings->vsync_level = param->timings.vsync_level; | |
| 212 | − timings->hsync_level = param->timings.hsync_level; | |
| 213 | − timings->interlace = param->timings.interlace; | |
| 214 | − timings->double_pixel = param->timings.double_pixel; | |
| 215 | − | |
| 216 | − if (param->timings.interlace) { | |
| 201 | + video_fmt->y_res = param->vm.vactive; | |
| 202 | + video_fmt->x_res = param->vm.hactive; | |
| 203 | + | |
| 204 | + vm->hback_porch = param->vm.hback_porch; | |
| 205 | + vm->hfront_porch = param->vm.hfront_porch; | |
| 206 | + vm->hsync_len = param->vm.hsync_len; | |
| 207 | + vm->vback_porch = param->vm.vback_porch; | |
| 208 | + vm->vfront_porch = param->vm.vfront_porch; | |
| 209 | + vm->vsync_len = param->vm.vsync_len; | |
| 210 | + | |
| 211 | + vm->flags = param->vm.flags; | |
| 212 | + | |
| 213 | + if (param->vm.flags & DISPLAY_FLAGS_INTERLACED) { | |
| 217 | 214 | video_fmt->y_res /= 2; |
| 218 | − timings->vbp /= 2; | |
| 219 | − timings->vfp /= 2; | |
| 220 | − timings->vsw /= 2; | |
| 215 | + vm->vback_porch /= 2; | |
| 216 | + vm->vfront_porch /= 2; | |
| 217 | + vm->vsync_len /= 2; | |
| 221 | 218 | } |
| 222 | 219 | |
| 223 | − if (param->timings.double_pixel) { | |
| 220 | + if (param->vm.flags & DISPLAY_FLAGS_DOUBLECLK) { | |
| 224 | 221 | video_fmt->x_res *= 2; |
| 225 | − timings->hfp *= 2; | |
| 226 | − timings->hsw *= 2; | |
| 227 | − timings->hbp *= 2; | |
| 222 | + vm->hfront_porch *= 2; | |
| 223 | + vm->hsync_len *= 2; | |
| 224 | + vm->hback_porch *= 2; | |
| 228 | 225 | } |
| 229 | 226 | } |
| 230 | 227 | |
| @@ -290,7 +290,7 @@ struct omap_dss_dsi_videomode_timings { · 289 unmodified lines | ||
| 290 | 290 | struct omap_dss_dsi_config { |
| 291 | 291 | enum omap_dss_dsi_mode mode; |
| 292 | 292 | enum omap_dss_dsi_pixel_format pixel_format; |
| 293 | − const struct omap_video_timings *timings; | |
| 293 | + const struct videomode *vm; | |
| 294 | 294 | |
| 295 | 295 | unsigned long hs_clk_min, hs_clk_max; |
| 296 | 296 | unsigned long lp_clk_min, lp_clk_max; |
| @@ -299,48 +299,12 @@ struct omap_dss_dsi_config { · 2 unmodified lines | ||
| 299 | 299 | enum omap_dss_dsi_trans_mode trans_mode; |
| 300 | 300 | }; |
| 301 | 301 | |
| 302 | −struct omap_video_timings { | |
| 303 | − /* Unit: pixels */ | |
| 304 | − u16 x_res; | |
| 305 | − /* Unit: pixels */ | |
| 306 | − u16 y_res; | |
| 307 | − /* Unit: Hz */ | |
| 308 | − u32 pixelclock; | |
| 309 | − /* Unit: pixel clocks */ | |
| 310 | − u16 hsw; /* Horizontal synchronization pulse width */ | |
| 311 | − /* Unit: pixel clocks */ | |
| 312 | − u16 hfp; /* Horizontal front porch */ | |
| 313 | − /* Unit: pixel clocks */ | |
| 314 | − u16 hbp; /* Horizontal back porch */ | |
| 315 | − /* Unit: line clocks */ | |
| 316 | − u16 vsw; /* Vertical synchronization pulse width */ | |
| 317 | − /* Unit: line clocks */ | |
| 318 | − u16 vfp; /* Vertical front porch */ | |
| 319 | − /* Unit: line clocks */ | |
| 320 | − u16 vbp; /* Vertical back porch */ | |
| 321 | − | |
| 322 | − /* Vsync logic level */ | |
| 323 | − enum omap_dss_signal_level vsync_level; | |
| 324 | − /* Hsync logic level */ | |
| 325 | − enum omap_dss_signal_level hsync_level; | |
| 326 | − /* Interlaced or Progressive timings */ | |
| 327 | − bool interlace; | |
| 328 | − /* Pixel clock edge to drive LCD data */ | |
| 329 | − enum omap_dss_signal_edge data_pclk_edge; | |
| 330 | − /* Data enable logic level */ | |
| 331 | − enum omap_dss_signal_level de_level; | |
| 332 | − /* Pixel clock edges to drive HSYNC and VSYNC signals */ | |
| 333 | − enum omap_dss_signal_edge sync_pclk_edge; | |
| 334 | − | |
| 335 | − bool double_pixel; | |
| 336 | −}; | |
| 337 | − | |
| 338 | −/* Hardcoded timings for tv modes. Venc only uses these to | |
| 302 | +/* Hardcoded videomodes for tv. Venc only uses these to | |
| 339 | 303 | * identify the mode, and does not actually use the configs |
| 340 | 304 | * itself. However, the configs should be something that |
| 341 | 305 | * a normal monitor can also show */ |
| 342 | −extern const struct omap_video_timings omap_dss_pal_timings; | |
| 343 | −extern const struct omap_video_timings omap_dss_ntsc_timings; | |
| 306 | +extern const struct videomode omap_dss_pal_vm; | |
| 307 | +extern const struct videomode omap_dss_ntsc_vm; | |
| 344 | 308 | |
| 345 | 309 | struct omap_dss_cpr_coefs { |
| 346 | 310 | s16 rr, rg, rb; |
| @@ -502,11 +466,11 @@ struct omapdss_dpi_ops { · 155 unmodified lines | ||
| 502 | 466 | void (*disable)(struct omap_dss_device *dssdev); |
| 503 | 467 | |
| 504 | 468 | int (*check_timings)(struct omap_dss_device *dssdev, |
| 505 | − struct omap_video_timings *timings); | |
| 469 | + struct videomode *vm); | |
| 506 | 470 | void (*set_timings)(struct omap_dss_device *dssdev, |
| 507 | − struct omap_video_timings *timings); | |
| 471 | + struct videomode *vm); | |
| 508 | 472 | void (*get_timings)(struct omap_dss_device *dssdev, |
| 509 | − struct omap_video_timings *timings); | |
| 473 | + struct videomode *vm); | |
| 510 | 474 | |
| 511 | 475 | void (*set_data_lines)(struct omap_dss_device *dssdev, int data_lines); |
| 512 | 476 | }; |
| @@ -521,11 +485,11 @@ struct omapdss_sdi_ops { · 8 unmodified lines | ||
| 521 | 485 | void (*disable)(struct omap_dss_device *dssdev); |
| 522 | 486 | |
| 523 | 487 | int (*check_timings)(struct omap_dss_device *dssdev, |
| 524 | − struct omap_video_timings *timings); | |
| 488 | + struct videomode *vm); | |
| 525 | 489 | void (*set_timings)(struct omap_dss_device *dssdev, |
| 526 | − struct omap_video_timings *timings); | |
| 490 | + struct videomode *vm); | |
| 527 | 491 | void (*get_timings)(struct omap_dss_device *dssdev, |
| 528 | − struct omap_video_timings *timings); | |
| 492 | + struct videomode *vm); | |
| 529 | 493 | |
| 530 | 494 | void (*set_datapairs)(struct omap_dss_device *dssdev, int datapairs); |
| 531 | 495 | }; |
| @@ -540,11 +504,11 @@ struct omapdss_dvi_ops { · 8 unmodified lines | ||
| 540 | 504 | void (*disable)(struct omap_dss_device *dssdev); |
| 541 | 505 | |
| 542 | 506 | int (*check_timings)(struct omap_dss_device *dssdev, |
| 543 | − struct omap_video_timings *timings); | |
| 507 | + struct videomode *vm); | |
| 544 | 508 | void (*set_timings)(struct omap_dss_device *dssdev, |
| 545 | − struct omap_video_timings *timings); | |
| 509 | + struct videomode *vm); | |
| 546 | 510 | void (*get_timings)(struct omap_dss_device *dssdev, |
| 547 | − struct omap_video_timings *timings); | |
| 511 | + struct videomode *vm); | |
| 548 | 512 | }; |
| 549 | 513 | |
| 550 | 514 | struct omapdss_atv_ops { |
| @@ -557,11 +521,11 @@ struct omapdss_atv_ops { · 6 unmodified lines | ||
| 557 | 521 | void (*disable)(struct omap_dss_device *dssdev); |
| 558 | 522 | |
| 559 | 523 | int (*check_timings)(struct omap_dss_device *dssdev, |
| 560 | − struct omap_video_timings *timings); | |
| 524 | + struct videomode *vm); | |
| 561 | 525 | void (*set_timings)(struct omap_dss_device *dssdev, |
| 562 | − struct omap_video_timings *timings); | |
| 526 | + struct videomode *vm); | |
| 563 | 527 | void (*get_timings)(struct omap_dss_device *dssdev, |
| 564 | − struct omap_video_timings *timings); | |
| 528 | + struct videomode *vm); | |
| 565 | 529 | |
| 566 | 530 | void (*set_type)(struct omap_dss_device *dssdev, |
| 567 | 531 | enum omap_dss_venc_type type); |
| @@ -582,11 +546,11 @@ struct omapdss_hdmi_ops { · 14 unmodified lines | ||
| 582 | 546 | void (*disable)(struct omap_dss_device *dssdev); |
| 583 | 547 | |
| 584 | 548 | int (*check_timings)(struct omap_dss_device *dssdev, |
| 585 | − struct omap_video_timings *timings); | |
| 549 | + struct videomode *vm); | |
| 586 | 550 | void (*set_timings)(struct omap_dss_device *dssdev, |
| 587 | − struct omap_video_timings *timings); | |
| 551 | + struct videomode *vm); | |
| 588 | 552 | void (*get_timings)(struct omap_dss_device *dssdev, |
| 589 | − struct omap_video_timings *timings); | |
| 553 | + struct videomode *vm); | |
| 590 | 554 | |
| 591 | 555 | int (*read_edid)(struct omap_dss_device *dssdev, u8 *buf, int len); |
| 592 | 556 | bool (*detect)(struct omap_dss_device *dssdev); |
| @@ -692,7 +656,7 @@ struct omap_dss_device { · 99 unmodified lines | ||
| 692 | 656 | } phy; |
| 693 | 657 | |
| 694 | 658 | struct { |
| 695 | − struct omap_video_timings timings; | |
| 659 | + struct videomode vm; | |
| 696 | 660 | |
| 697 | 661 | enum omap_dss_dsi_pixel_format dsi_pix_fmt; |
| 698 | 662 | enum omap_dss_dsi_mode dsi_mode; |
| @@ -785,11 +749,11 @@ struct omap_dss_driver { · 86 unmodified lines | ||
| 785 | 749 | int (*get_recommended_bpp)(struct omap_dss_device *dssdev); |
| 786 | 750 | |
| 787 | 751 | int (*check_timings)(struct omap_dss_device *dssdev, |
| 788 | − struct omap_video_timings *timings); | |
| 752 | + struct videomode *vm); | |
| 789 | 753 | void (*set_timings)(struct omap_dss_device *dssdev, |
| 790 | − struct omap_video_timings *timings); | |
| 754 | + struct videomode *vm); | |
| 791 | 755 | void (*get_timings)(struct omap_dss_device *dssdev, |
| 792 | − struct omap_video_timings *timings); | |
| 756 | + struct videomode *vm); | |
| 793 | 757 | |
| 794 | 758 | int (*set_wss)(struct omap_dss_device *dssdev, u32 wss); |
| 795 | 759 | u32 (*get_wss)(struct omap_dss_device *dssdev); |
| @@ -819,11 +783,6 @@ struct omap_dss_device *omap_dss_find_device(void *data, · 23 unmodified lines | ||
| 819 | 783 | int (*match)(struct omap_dss_device *dssdev, void *data)); |
| 820 | 784 | const char *omapdss_get_default_display_name(void); |
| 821 | 785 | |
| 822 | −void videomode_to_omap_video_timings(const struct videomode *vm, | |
| 823 | − struct omap_video_timings *ovt); | |
| 824 | −void omap_video_timings_to_videomode(const struct omap_video_timings *ovt, | |
| 825 | − struct videomode *vm); | |
| 826 | − | |
| 827 | 786 | int dss_feat_get_num_mgrs(void); |
| 828 | 787 | int dss_feat_get_num_ovls(void); |
| 829 | 788 | enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane); |
| @@ -852,7 +811,7 @@ void omapdss_default_get_resolution(struct omap_dss_device *dssdev, · 22 unmodified lines | ||
| 852 | 811 | u16 *xres, u16 *yres); |
| 853 | 812 | int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev); |
| 854 | 813 | void omapdss_default_get_timings(struct omap_dss_device *dssdev, |
| 855 | − struct omap_video_timings *timings); | |
| 814 | + struct videomode *vm); | |
| 856 | 815 | |
| 857 | 816 | typedef void (*omap_dispc_isr_t) (void *arg, u32 mask); |
| 858 | 817 | int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask); |
| @@ -906,7 +865,7 @@ void dispc_mgr_go(enum omap_channel channel); · 47 unmodified lines | ||
| 906 | 865 | void dispc_mgr_set_lcd_config(enum omap_channel channel, |
| 907 | 866 | const struct dss_lcd_mgr_config *config); |
| 908 | 867 | void dispc_mgr_set_timings(enum omap_channel channel, |
| 909 | − const struct omap_video_timings *timings); | |
| 868 | + const struct videomode *vm); | |
| 910 | 869 | void dispc_mgr_setup(enum omap_channel channel, |
| 911 | 870 | const struct omap_overlay_manager_info *info); |
| 912 | 871 | u32 dispc_mgr_gamma_size(enum omap_channel channel); |
| @@ -919,8 +878,7 @@ bool dispc_ovl_enabled(enum omap_plane plane); · 6 unmodified lines | ||
| 919 | 878 | void dispc_ovl_set_channel_out(enum omap_plane plane, |
| 920 | 879 | enum omap_channel channel); |
| 921 | 880 | int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi, |
| 922 | − bool replication, const struct omap_video_timings *mgr_timings, | |
| 923 | − bool mem_to_mem); | |
| 881 | + bool replication, const struct videomode *vm, bool mem_to_mem); | |
| 924 | 882 | |
| 925 | 883 | enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel channel); |
| 926 | 884 | |
| @@ -934,7 +892,7 @@ struct dss_mgr_ops { · 7 unmodified lines | ||
| 934 | 892 | int (*enable)(enum omap_channel channel); |
| 935 | 893 | void (*disable)(enum omap_channel channel); |
| 936 | 894 | void (*set_timings)(enum omap_channel channel, |
| 937 | − const struct omap_video_timings *timings); | |
| 895 | + const struct videomode *vm); | |
| 938 | 896 | void (*set_lcd_config)(enum omap_channel channel, |
| 939 | 897 | const struct dss_lcd_mgr_config *config); |
| 940 | 898 | int (*register_framedone_handler)(enum omap_channel channel, |
| @@ -951,7 +909,7 @@ int dss_mgr_connect(enum omap_channel channel, · 10 unmodified lines | ||
| 951 | 909 | void dss_mgr_disconnect(enum omap_channel channel, |
| 952 | 910 | struct omap_dss_device *dst); |
| 953 | 911 | void dss_mgr_set_timings(enum omap_channel channel, |
| 954 | − const struct omap_video_timings *timings); | |
| 912 | + const struct videomode *vm); | |
| 955 | 913 | void dss_mgr_set_lcd_config(enum omap_channel channel, |
| 956 | 914 | const struct dss_lcd_mgr_config *config); |
| 957 | 915 | int dss_mgr_enable(enum omap_channel channel); |
| @@ -201,10 +201,9 @@ void dss_mgr_disconnect(enum omap_channel channel, · 200 unmodified lines | ||
| 201 | 201 | } |
| 202 | 202 | EXPORT_SYMBOL(dss_mgr_disconnect); |
| 203 | 203 | |
| 204 | −void dss_mgr_set_timings(enum omap_channel channel, | |
| 205 | − const struct omap_video_timings *timings) | |
| 204 | +void dss_mgr_set_timings(enum omap_channel channel, const struct videomode *vm) | |
| 206 | 205 | { |
| 207 | − dss_mgr_ops->set_timings(channel, timings); | |
| 206 | + dss_mgr_ops->set_timings(channel, vm); | |
| 208 | 207 | } |
| 209 | 208 | EXPORT_SYMBOL(dss_mgr_set_timings); |
| 210 | 209 | |
| @@ -113,7 +113,7 @@ static struct { · 112 unmodified lines | ||
| 113 | 113 | |
| 114 | 114 | struct semaphore bus_lock; |
| 115 | 115 | |
| 116 | − struct omap_video_timings timings; | |
| 116 | + struct videomode vm; | |
| 117 | 117 | int pixel_size; |
| 118 | 118 | int data_lines; |
| 119 | 119 | struct rfbi_timings intf_timings; |
| @@ -308,15 +308,15 @@ static int rfbi_transfer_area(struct omap_dss_device *dssdev, · 188 unmodified lines | ||
| 308 | 308 | u32 l; |
| 309 | 309 | int r; |
| 310 | 310 | struct omap_overlay_manager *mgr = rfbi.output.manager; |
| 311 | − u16 width = rfbi.timings.x_res; | |
| 312 | − u16 height = rfbi.timings.y_res; | |
| 311 | + u16 width = rfbi.vm.hactive; | |
| 312 | + u16 height = rfbi.vm.vactive; | |
| 313 | 313 | |
| 314 | 314 | /*BUG_ON(callback == 0);*/ |
| 315 | 315 | BUG_ON(rfbi.framedone_callback != NULL); |
| 316 | 316 | |
| 317 | 317 | DSSDBG("rfbi_transfer_area %dx%d\n", width, height); |
| 318 | 318 | |
| 319 | − dss_mgr_set_timings(mgr, &rfbi.timings); | |
| 319 | + dss_mgr_set_timings(mgr, &rfbi.vm); | |
| 320 | 320 | |
| 321 | 321 | r = dss_mgr_enable(mgr); |
| 322 | 322 | if (r) |
| @@ -777,8 +777,8 @@ static int rfbi_update(struct omap_dss_device *dssdev, void (*callback)(void *), · 454 unmodified lines | ||
| 777 | 777 | |
| 778 | 778 | static void rfbi_set_size(struct omap_dss_device *dssdev, u16 w, u16 h) |
| 779 | 779 | { |
| 780 | − rfbi.timings.x_res = w; | |
| 781 | − rfbi.timings.y_res = h; | |
| 780 | + rfbi.vm.hactive = w; | |
| 781 | + rfbi.vm.vactive = h; | |
| 782 | 782 | } |
| 783 | 783 | |
| 784 | 784 | static void rfbi_set_pixel_size(struct omap_dss_device *dssdev, int pixel_size) |
| @@ -854,25 +854,30 @@ static void rfbi_config_lcd_manager(struct omap_dss_device *dssdev) · 69 unmodified lines | ||
| 854 | 854 | dss_mgr_set_lcd_config(mgr, &mgr_config); |
| 855 | 855 | |
| 856 | 856 | /* |
| 857 | − * Set rfbi.timings with default values, the x_res and y_res fields | |
| 857 | + * Set rfbi.timings with default values, the hactive and vactive fields | |
| 858 | 858 | * are expected to be already configured by the panel driver via |
| 859 | 859 | * omapdss_rfbi_set_size() |
| 860 | 860 | */ |
| 861 | − rfbi.timings.hsw = 1; | |
| 862 | − rfbi.timings.hfp = 1; | |
| 863 | − rfbi.timings.hbp = 1; | |
| 864 | − rfbi.timings.vsw = 1; | |
| 865 | − rfbi.timings.vfp = 0; | |
| 866 | − rfbi.timings.vbp = 0; | |
| 867 | − | |
| 868 | − rfbi.timings.interlace = false; | |
| 869 | − rfbi.timings.hsync_level = OMAPDSS_SIG_ACTIVE_HIGH; | |
| 870 | − rfbi.timings.vsync_level = OMAPDSS_SIG_ACTIVE_HIGH; | |
| 871 | − rfbi.timings.data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; | |
| 872 | − rfbi.timings.de_level = OMAPDSS_SIG_ACTIVE_HIGH; | |
| 873 | − rfbi.timings.sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE; | |
| 874 | − | |
| 875 | − dss_mgr_set_timings(mgr, &rfbi.timings); | |
| 861 | + rfbi.vm.hsync_len = 1; | |
| 862 | + rfbi.vm.hfront_porch = 1; | |
| 863 | + rfbi.vm.hback_porch = 1; | |
| 864 | + rfbi.vm.vsync_len = 1; | |
| 865 | + rfbi.vm.vfront_porch = 0; | |
| 866 | + rfbi.vm.vback_porch = 0; | |
| 867 | + | |
| 868 | + rfbi.vm.flags &= ~DISPLAY_FLAGS_INTERLACED; | |
| 869 | + rfbi.vm.flags &= ~DISPLAY_FLAGS_HSYNC_LOW; | |
| 870 | + rfbi.vm.flags |= DISPLAY_FLAGS_HSYNC_HIGH; | |
| 871 | + rfbi.vm.flags &= ~DISPLAY_FLAGS_VSYNC_LOW; | |
| 872 | + rfbi.vm.flags |= DISPLAY_FLAGS_VSYNC_HIGH; | |
| 873 | + rfbi.vm.flags &= ~DISPLAY_FLAGS_PIXDATA_NEGEDGE; | |
| 874 | + rfbi.vm.flags |= DISPLAY_FLAGS_PIXDATA_POSEDGE; | |
| 875 | + rfbi.vm.flags &= ~DISPLAY_FLAGS_DE_LOW; | |
| 876 | + rfbi.vm.flags |= DISPLAY_FLAGS_DE_HIGH; | |
| 877 | + rfbi.vm.flags &= ~DISPLAY_FLAGS_SYNC_POSEDGE; | |
| 878 | + rfbi.vm.flags |= DISPLAY_FLAGS_SYNC_NEGEDGE; | |
| 879 | + | |
| 880 | + dss_mgr_set_timings(mgr, &rfbi.vm); | |
| 876 | 881 | } |
| 877 | 882 | |
| 878 | 883 | static int rfbi_display_enable(struct omap_dss_device *dssdev) |
| @@ -39,7 +39,7 @@ static struct { · 38 unmodified lines | ||
| 39 | 39 | struct regulator *vdds_sdi_reg; |
| 40 | 40 | |
| 41 | 41 | struct dss_lcd_mgr_config mgr_config; |
| 42 | − struct omap_video_timings timings; | |
| 42 | + struct videomode vm; | |
| 43 | 43 | int datapairs; |
| 44 | 44 | |
| 45 | 45 | struct omap_dss_device output; |
| @@ -131,7 +131,7 @@ static int sdi_display_enable(struct omap_dss_device *dssdev) · 85 unmodified lines | ||
| 131 | 131 | { |
| 132 | 132 | struct omap_dss_device *out = &sdi.output; |
| 133 | 133 | enum omap_channel channel = dssdev->dispc_channel; |
| 134 | − struct omap_video_timings *t = &sdi.timings; | |
| 134 | + struct videomode *vm = &sdi.vm; | |
| 135 | 135 | unsigned long fck; |
| 136 | 136 | struct dispc_clock_info dispc_cinfo; |
| 137 | 137 | unsigned long pck; |
| @@ -151,10 +151,9 @@ static int sdi_display_enable(struct omap_dss_device *dssdev) · 13 unmodified lines | ||
| 151 | 151 | goto err_get_dispc; |
| 152 | 152 | |
| 153 | 153 | /* 15.5.9.1.2 */ |
| 154 | − t->data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; | |
| 155 | − t->sync_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; | |
| 154 | + vm->flags |= DISPLAY_FLAGS_PIXDATA_POSEDGE | DISPLAY_FLAGS_SYNC_POSEDGE; | |
| 156 | 155 | |
| 157 | − r = sdi_calc_clock_div(t->pixelclock, &fck, &dispc_cinfo); | |
| 156 | + r = sdi_calc_clock_div(vm->pixelclock, &fck, &dispc_cinfo); | |
| 158 | 157 | if (r) |
| 159 | 158 | goto err_calc_clock_div; |
| 160 | 159 | |
| @@ -162,15 +161,15 @@ static int sdi_display_enable(struct omap_dss_device *dssdev) · 1 unmodified line | ||
| 162 | 161 | |
| 163 | 162 | pck = fck / dispc_cinfo.lck_div / dispc_cinfo.pck_div; |
| 164 | 163 | |
| 165 | − if (pck != t->pixelclock) { | |
| 166 | − DSSWARN("Could not find exact pixel clock. Requested %d Hz, got %lu Hz\n", | |
| 167 | − t->pixelclock, pck); | |
| 164 | + if (pck != vm->pixelclock) { | |
| 165 | + DSSWARN("Could not find exact pixel clock. Requested %lu Hz, got %lu Hz\n", | |
| 166 | + vm->pixelclock, pck); | |
| 168 | 167 | |
| 169 | − t->pixelclock = pck; | |
| 168 | + vm->pixelclock = pck; | |
| 170 | 169 | } |
| 171 | 170 | |
| 172 | 171 | |
| 173 | − dss_mgr_set_timings(channel, t); | |
| 172 | + dss_mgr_set_timings(channel, vm); | |
| 174 | 173 | |
| 175 | 174 | r = dss_set_fck_rate(fck); |
| 176 | 175 | if (r) |
| @@ -229,26 +228,26 @@ static void sdi_display_disable(struct omap_dss_device *dssdev) · 52 unmodified lines | ||
| 229 | 228 | } |
| 230 | 229 | |
| 231 | 230 | static void sdi_set_timings(struct omap_dss_device *dssdev, |
| 232 | − struct omap_video_timings *timings) | |
| 231 | + struct videomode *vm) | |
| 233 | 232 | { |
| 234 | − sdi.timings = *timings; | |
| 233 | + sdi.vm = *vm; | |
| 235 | 234 | } |
| 236 | 235 | |
| 237 | 236 | static void sdi_get_timings(struct omap_dss_device *dssdev, |
| 238 | − struct omap_video_timings *timings) | |
| 237 | + struct videomode *vm) | |
| 239 | 238 | { |
| 240 | − *timings = sdi.timings; | |
| 239 | + *vm = sdi.vm; | |
| 241 | 240 | } |
| 242 | 241 | |
| 243 | 242 | static int sdi_check_timings(struct omap_dss_device *dssdev, |
| 244 | − struct omap_video_timings *timings) | |
| 243 | + struct videomode *vm) | |
| 245 | 244 | { |
| 246 | 245 | enum omap_channel channel = dssdev->dispc_channel; |
| 247 | 246 | |
| 248 | − if (!dispc_mgr_timings_ok(channel, timings)) | |
| 247 | + if (!dispc_mgr_timings_ok(channel, vm)) | |
| 249 | 248 | return -EINVAL; |
| 250 | 249 | |
| 251 | − if (timings->pixelclock == 0) | |
| 250 | + if (vm->pixelclock == 0) | |
| 252 | 251 | return -EINVAL; |
| 253 | 252 | |
| 254 | 253 | return 0; |
| @@ -262,47 +262,41 @@ static const struct venc_config venc_config_pal_bdghi = { · 261 unmodified lines | ||
| 262 | 262 | .fid_ext_start_y__fid_ext_offset_y = 0x01380005, |
| 263 | 263 | }; |
| 264 | 264 | |
| 265 | −const struct omap_video_timings omap_dss_pal_timings = { | |
| 266 | − .x_res = 720, | |
| 267 | − .y_res = 574, | |
| 265 | +const struct videomode omap_dss_pal_vm = { | |
| 266 | + .hactive = 720, | |
| 267 | + .vactive = 574, | |
| 268 | 268 | .pixelclock = 13500000, |
| 269 | − .hsw = 64, | |
| 270 | − .hfp = 12, | |
| 271 | − .hbp = 68, | |
| 272 | − .vsw = 5, | |
| 273 | − .vfp = 5, | |
| 274 | − .vbp = 41, | |
| 275 | − | |
| 276 | − .interlace = true, | |
| 277 | − | |
| 278 | − .hsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 279 | − .vsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 280 | − .data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, | |
| 281 | − .de_level = OMAPDSS_SIG_ACTIVE_HIGH, | |
| 282 | − .sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE, | |
| 269 | + .hsync_len = 64, | |
| 270 | + .hfront_porch = 12, | |
| 271 | + .hback_porch = 68, | |
| 272 | + .vsync_len = 5, | |
| 273 | + .vfront_porch = 5, | |
| 274 | + .vback_porch = 41, | |
| 275 | + | |
| 276 | + .flags = DISPLAY_FLAGS_INTERLACED | DISPLAY_FLAGS_HSYNC_LOW | | |
| 277 | + DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_DE_HIGH | | |
| 278 | + DISPLAY_FLAGS_PIXDATA_POSEDGE | | |
| 279 | + DISPLAY_FLAGS_SYNC_NEGEDGE, | |
| 283 | 280 | }; |
| 284 | −EXPORT_SYMBOL(omap_dss_pal_timings); | |
| 281 | +EXPORT_SYMBOL(omap_dss_pal_vm); | |
| 285 | 282 | |
| 286 | −const struct omap_video_timings omap_dss_ntsc_timings = { | |
| 287 | − .x_res = 720, | |
| 288 | − .y_res = 482, | |
| 283 | +const struct videomode omap_dss_ntsc_vm = { | |
| 284 | + .hactive = 720, | |
| 285 | + .vactive = 482, | |
| 289 | 286 | .pixelclock = 13500000, |
| 290 | − .hsw = 64, | |
| 291 | − .hfp = 16, | |
| 292 | − .hbp = 58, | |
| 293 | − .vsw = 6, | |
| 294 | − .vfp = 6, | |
| 295 | − .vbp = 31, | |
| 296 | − | |
| 297 | − .interlace = true, | |
| 298 | − | |
| 299 | − .hsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 300 | − .vsync_level = OMAPDSS_SIG_ACTIVE_LOW, | |
| 301 | − .data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, | |
| 302 | − .de_level = OMAPDSS_SIG_ACTIVE_HIGH, | |
| 303 | − .sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE, | |
| 287 | + .hsync_len = 64, | |
| 288 | + .hfront_porch = 16, | |
| 289 | + .hback_porch = 58, | |
| 290 | + .vsync_len = 6, | |
| 291 | + .vfront_porch = 6, | |
| 292 | + .vback_porch = 31, | |
| 293 | + | |
| 294 | + .flags = DISPLAY_FLAGS_INTERLACED | DISPLAY_FLAGS_HSYNC_LOW | | |
| 295 | + DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_DE_HIGH | | |
| 296 | + DISPLAY_FLAGS_PIXDATA_POSEDGE | | |
| 297 | + DISPLAY_FLAGS_SYNC_NEGEDGE, | |
| 304 | 298 | }; |
| 305 | −EXPORT_SYMBOL(omap_dss_ntsc_timings); | |
| 299 | +EXPORT_SYMBOL(omap_dss_ntsc_vm); | |
| 306 | 300 | |
| 307 | 301 | static struct { |
| 308 | 302 | struct platform_device *pdev; |
| @@ -313,7 +307,7 @@ static struct { · 4 unmodified lines | ||
| 313 | 307 | |
| 314 | 308 | struct clk *tv_dac_clk; |
| 315 | 309 | |
| 316 | − struct omap_video_timings timings; | |
| 310 | + struct videomode vm; | |
| 317 | 311 | enum omap_dss_venc_type type; |
| 318 | 312 | bool invert_polarity; |
| 319 | 313 | |
| @@ -427,13 +421,12 @@ static void venc_runtime_put(void) · 107 unmodified lines | ||
| 427 | 421 | WARN_ON(r < 0 && r != -ENOSYS); |
| 428 | 422 | } |
| 429 | 423 | |
| 430 | −static const struct venc_config *venc_timings_to_config( | |
| 431 | − struct omap_video_timings *timings) | |
| 424 | +static const struct venc_config *venc_timings_to_config(struct videomode *vm) | |
| 432 | 425 | { |
| 433 | − if (memcmp(&omap_dss_pal_timings, timings, sizeof(*timings)) == 0) | |
| 426 | + if (memcmp(&omap_dss_pal_vm, vm, sizeof(*vm)) == 0) | |
| 434 | 427 | return &venc_config_pal_trm; |
| 435 | 428 | |
| 436 | − if (memcmp(&omap_dss_ntsc_timings, timings, sizeof(*timings)) == 0) | |
| 429 | + if (memcmp(&omap_dss_ntsc_vm, vm, sizeof(*vm)) == 0) | |
| 437 | 430 | return &venc_config_ntsc_trm; |
| 438 | 431 | |
| 439 | 432 | BUG(); |
| @@ -451,7 +444,7 @@ static int venc_power_on(struct omap_dss_device *dssdev) · 11 unmodified lines | ||
| 451 | 444 | goto err0; |
| 452 | 445 | |
| 453 | 446 | venc_reset(); |
| 454 | − venc_write_config(venc_timings_to_config(&venc.timings)); | |
| 447 | + venc_write_config(venc_timings_to_config(&venc.vm)); | |
| 455 | 448 | |
| 456 | 449 | dss_set_venc_output(venc.type); |
| 457 | 450 | dss_set_dac_pwrdn_bgz(1); |
| @@ -468,7 +461,7 @@ static int venc_power_on(struct omap_dss_device *dssdev) · 10 unmodified lines | ||
| 468 | 461 | |
| 469 | 462 | venc_write_reg(VENC_OUTPUT_CONTROL, l); |
| 470 | 463 | |
| 471 | − dss_mgr_set_timings(channel, &venc.timings); | |
| 464 | + dss_mgr_set_timings(channel, &venc.vm); | |
| 472 | 465 | |
| 473 | 466 | r = regulator_enable(venc.vdda_dac_reg); |
| 474 | 467 | if (r) |
| @@ -546,17 +539,17 @@ static void venc_display_disable(struct omap_dss_device *dssdev) · 71 unmodified lines | ||
| 546 | 539 | } |
| 547 | 540 | |
| 548 | 541 | static void venc_set_timings(struct omap_dss_device *dssdev, |
| 549 | − struct omap_video_timings *timings) | |
| 542 | + struct videomode *vm) | |
| 550 | 543 | { |
| 551 | 544 | DSSDBG("venc_set_timings\n"); |
| 552 | 545 | |
| 553 | 546 | mutex_lock(&venc.venc_lock); |
| 554 | 547 | |
| 555 | 548 | /* Reset WSS data when the TV standard changes. */ |
| 556 | − if (memcmp(&venc.timings, timings, sizeof(*timings))) | |
| 549 | + if (memcmp(&venc.vm, vm, sizeof(*vm))) | |
| 557 | 550 | venc.wss_data = 0; |
| 558 | 551 | |
| 559 | − venc.timings = *timings; | |
| 552 | + venc.vm = *vm; | |
| 560 | 553 | |
| 561 | 554 | dispc_set_tv_pclk(13500000); |
| 562 | 555 | |
| @@ -564,25 +557,25 @@ static void venc_set_timings(struct omap_dss_device *dssdev, · 1 unmodified line | ||
| 564 | 557 | } |
| 565 | 558 | |
| 566 | 559 | static int venc_check_timings(struct omap_dss_device *dssdev, |
| 567 | − struct omap_video_timings *timings) | |
| 560 | + struct videomode *vm) | |
| 568 | 561 | { |
| 569 | 562 | DSSDBG("venc_check_timings\n"); |
| 570 | 563 | |
| 571 | − if (memcmp(&omap_dss_pal_timings, timings, sizeof(*timings)) == 0) | |
| 564 | + if (memcmp(&omap_dss_pal_vm, vm, sizeof(*vm)) == 0) | |
| 572 | 565 | return 0; |
| 573 | 566 | |
| 574 | − if (memcmp(&omap_dss_ntsc_timings, timings, sizeof(*timings)) == 0) | |
| 567 | + if (memcmp(&omap_dss_ntsc_vm, vm, sizeof(*vm)) == 0) | |
| 575 | 568 | return 0; |
| 576 | 569 | |
| 577 | 570 | return -EINVAL; |
| 578 | 571 | } |
| 579 | 572 | |
| 580 | 573 | static void venc_get_timings(struct omap_dss_device *dssdev, |
| 581 | − struct omap_video_timings *timings) | |
| 574 | + struct videomode *vm) | |
| 582 | 575 | { |
| 583 | 576 | mutex_lock(&venc.venc_lock); |
| 584 | 577 | |
| 585 | − *timings = venc.timings; | |
| 578 | + *vm = venc.vm; | |
| 586 | 579 | |
| 587 | 580 | mutex_unlock(&venc.venc_lock); |
| 588 | 581 | } |
| @@ -602,7 +595,7 @@ static int venc_set_wss(struct omap_dss_device *dssdev, u32 wss) · 13 unmodified lines | ||
| 602 | 595 | |
| 603 | 596 | mutex_lock(&venc.venc_lock); |
| 604 | 597 | |
| 605 | − config = venc_timings_to_config(&venc.timings); | |
| 598 | + config = venc_timings_to_config(&venc.vm); | |
| 606 | 599 | |
| 607 | 600 | /* Invert due to VENC_L21_WC_CTL:INV=1 */ |
| 608 | 601 | venc.wss_data = (wss ^ 0xfffff) << 8; |
| @@ -42,73 +42,6 @@ bool omap_connector_get_hdmi_mode(struct drm_connector *connector) · 41 unmodified lines | ||
| 42 | 42 | return omap_connector->hdmi_mode; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | −void copy_timings_omap_to_drm(struct drm_display_mode *mode, | |
| 46 | − struct omap_video_timings *timings) | |
| 47 | −{ | |
| 48 | − mode->clock = timings->pixelclock / 1000; | |
| 49 | − | |
| 50 | − mode->hdisplay = timings->x_res; | |
| 51 | − mode->hsync_start = mode->hdisplay + timings->hfp; | |
| 52 | − mode->hsync_end = mode->hsync_start + timings->hsw; | |
| 53 | − mode->htotal = mode->hsync_end + timings->hbp; | |
| 54 | − | |
| 55 | − mode->vdisplay = timings->y_res; | |
| 56 | − mode->vsync_start = mode->vdisplay + timings->vfp; | |
| 57 | − mode->vsync_end = mode->vsync_start + timings->vsw; | |
| 58 | − mode->vtotal = mode->vsync_end + timings->vbp; | |
| 59 | − | |
| 60 | − mode->flags = 0; | |
| 61 | − | |
| 62 | − if (timings->interlace) | |
| 63 | − mode->flags |= DRM_MODE_FLAG_INTERLACE; | |
| 64 | − | |
| 65 | − if (timings->double_pixel) | |
| 66 | − mode->flags |= DRM_MODE_FLAG_DBLCLK; | |
| 67 | − | |
| 68 | − if (timings->hsync_level == OMAPDSS_SIG_ACTIVE_HIGH) | |
| 69 | − mode->flags |= DRM_MODE_FLAG_PHSYNC; | |
| 70 | − else | |
| 71 | − mode->flags |= DRM_MODE_FLAG_NHSYNC; | |
| 72 | − | |
| 73 | − if (timings->vsync_level == OMAPDSS_SIG_ACTIVE_HIGH) | |
| 74 | − mode->flags |= DRM_MODE_FLAG_PVSYNC; | |
| 75 | − else | |
| 76 | − mode->flags |= DRM_MODE_FLAG_NVSYNC; | |
| 77 | −} | |
| 78 | − | |
| 79 | −void copy_timings_drm_to_omap(struct omap_video_timings *timings, | |
| 80 | − struct drm_display_mode *mode) | |
| 81 | −{ | |
| 82 | − timings->pixelclock = mode->clock * 1000; | |
| 83 | − | |
| 84 | − timings->x_res = mode->hdisplay; | |
| 85 | − timings->hfp = mode->hsync_start - mode->hdisplay; | |
| 86 | − timings->hsw = mode->hsync_end - mode->hsync_start; | |
| 87 | − timings->hbp = mode->htotal - mode->hsync_end; | |
| 88 | − | |
| 89 | − timings->y_res = mode->vdisplay; | |
| 90 | − timings->vfp = mode->vsync_start - mode->vdisplay; | |
| 91 | − timings->vsw = mode->vsync_end - mode->vsync_start; | |
| 92 | − timings->vbp = mode->vtotal - mode->vsync_end; | |
| 93 | − | |
| 94 | − timings->interlace = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); | |
| 95 | − timings->double_pixel = !!(mode->flags & DRM_MODE_FLAG_DBLCLK); | |
| 96 | − | |
| 97 | − if (mode->flags & DRM_MODE_FLAG_PHSYNC) | |
| 98 | − timings->hsync_level = OMAPDSS_SIG_ACTIVE_HIGH; | |
| 99 | − else | |
| 100 | − timings->hsync_level = OMAPDSS_SIG_ACTIVE_LOW; | |
| 101 | − | |
| 102 | − if (mode->flags & DRM_MODE_FLAG_PVSYNC) | |
| 103 | − timings->vsync_level = OMAPDSS_SIG_ACTIVE_HIGH; | |
| 104 | − else | |
| 105 | − timings->vsync_level = OMAPDSS_SIG_ACTIVE_LOW; | |
| 106 | − | |
| 107 | − timings->data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; | |
| 108 | − timings->de_level = OMAPDSS_SIG_ACTIVE_HIGH; | |
| 109 | − timings->sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE; | |
| 110 | −} | |
| 111 | − | |
| 112 | 45 | static enum drm_connector_status omap_connector_detect( |
| 113 | 46 | struct drm_connector *connector, bool force) |
| 114 | 47 | { |
| @@ -185,11 +118,11 @@ static int omap_connector_get_modes(struct drm_connector *connector) · 70 unmodified lines | ||
| 185 | 118 | kfree(edid); |
| 186 | 119 | } else { |
| 187 | 120 | struct drm_display_mode *mode = drm_mode_create(dev); |
| 188 | − struct omap_video_timings timings = {0}; | |
| 121 | + struct videomode vm = {0}; | |
| 189 | 122 | |
| 190 | − dssdrv->get_timings(dssdev, &timings); | |
| 123 | + dssdrv->get_timings(dssdev, &vm); | |
| 191 | 124 | |
| 192 | − copy_timings_omap_to_drm(mode, &timings); | |
| 125 | + drm_display_mode_from_videomode(&vm, mode); | |
| 193 | 126 | |
| 194 | 127 | mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; |
| 195 | 128 | drm_mode_set_name(mode); |
| @@ -207,12 +140,14 @@ static int omap_connector_mode_valid(struct drm_connector *connector, · 11 unmodified lines | ||
| 207 | 140 | struct omap_connector *omap_connector = to_omap_connector(connector); |
| 208 | 141 | struct omap_dss_device *dssdev = omap_connector->dssdev; |
| 209 | 142 | struct omap_dss_driver *dssdrv = dssdev->driver; |
| 210 | − struct omap_video_timings timings = {0}; | |
| 143 | + struct videomode vm = {0}; | |
| 211 | 144 | struct drm_device *dev = connector->dev; |
| 212 | 145 | struct drm_display_mode *new_mode; |
| 213 | 146 | int r, ret = MODE_BAD; |
| 214 | 147 | |
| 215 | − copy_timings_drm_to_omap(&timings, mode); | |
| 148 | + drm_display_mode_to_videomode(mode, &vm); | |
| 149 | + vm.flags |= DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE | | |
| 150 | + DISPLAY_FLAGS_SYNC_NEGEDGE; | |
| 216 | 151 | mode->vrefresh = drm_mode_vrefresh(mode); |
| 217 | 152 | |
| 218 | 153 | /* |
| @@ -221,13 +156,13 @@ static int omap_connector_mode_valid(struct drm_connector *connector, · 2 unmodified lines | ||
| 221 | 156 | * panel's timings |
| 222 | 157 | */ |
| 223 | 158 | if (dssdrv->check_timings) { |
| 224 | − r = dssdrv->check_timings(dssdev, &timings); | |
| 159 | + r = dssdrv->check_timings(dssdev, &vm); | |
| 225 | 160 | } else { |
| 226 | − struct omap_video_timings t = {0}; | |
| 161 | + struct videomode t = {0}; | |
| 227 | 162 | |
| 228 | 163 | dssdrv->get_timings(dssdev, &t); |
| 229 | 164 | |
| 230 | − if (memcmp(&timings, &t, sizeof(struct omap_video_timings))) | |
| 165 | + if (memcmp(&vm, &t, sizeof(struct videomode))) | |
| 231 | 166 | r = -EINVAL; |
| 232 | 167 | else |
| 233 | 168 | r = 0; |
| @@ -236,7 +171,7 @@ static int omap_connector_mode_valid(struct drm_connector *connector, · 2 unmodified lines | ||
| 236 | 171 | if (!r) { |
| 237 | 172 | /* check if vrefresh is still valid */ |
| 238 | 173 | new_mode = drm_mode_duplicate(dev, mode); |
| 239 | − new_mode->clock = timings.pixelclock / 1000; | |
| 174 | + new_mode->clock = vm.pixelclock / 1000; | |
| 240 | 175 | new_mode->vrefresh = 0; |
| 241 | 176 | if (mode->vrefresh == drm_mode_vrefresh(new_mode)) |
| 242 | 177 | ret = MODE_OK; |
| @@ -34,7 +34,7 @@ struct omap_crtc { · 33 unmodified lines | ||
| 34 | 34 | const char *name; |
| 35 | 35 | enum omap_channel channel; |
| 36 | 36 | |
| 37 | − struct omap_video_timings timings; | |
| 37 | + struct videomode vm; | |
| 38 | 38 | |
| 39 | 39 | struct omap_drm_irq vblank_irq; |
| 40 | 40 | struct omap_drm_irq error_irq; |
| @@ -56,10 +56,10 @@ uint32_t pipe2vbl(struct drm_crtc *crtc) · 15 unmodified lines | ||
| 56 | 56 | return dispc_mgr_get_vsync_irq(omap_crtc->channel); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | −struct omap_video_timings *omap_crtc_timings(struct drm_crtc *crtc) | |
| 59 | +struct videomode *omap_crtc_timings(struct drm_crtc *crtc) | |
| 60 | 60 | { |
| 61 | 61 | struct omap_crtc *omap_crtc = to_omap_crtc(crtc); |
| 62 | − return &omap_crtc->timings; | |
| 62 | + return &omap_crtc->vm; | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | enum omap_channel omap_crtc_channel(struct drm_crtc *crtc) |
| @@ -201,7 +201,7 @@ static int omap_crtc_dss_enable(enum omap_channel channel) · 135 unmodified lines | ||
| 201 | 201 | |
| 202 | 202 | dispc_mgr_setup(omap_crtc->channel, &info); |
| 203 | 203 | dispc_mgr_set_timings(omap_crtc->channel, |
| 204 | − &omap_crtc->timings); | |
| 204 | + &omap_crtc->vm); | |
| 205 | 205 | omap_crtc_set_enabled(&omap_crtc->base, true); |
| 206 | 206 | |
| 207 | 207 | return 0; |
| @@ -215,11 +215,11 @@ static void omap_crtc_dss_disable(enum omap_channel channel) · 7 unmodified lines | ||
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | static void omap_crtc_dss_set_timings(enum omap_channel channel, |
| 218 | − const struct omap_video_timings *timings) | |
| 218 | + const struct videomode *vm) | |
| 219 | 219 | { |
| 220 | 220 | struct omap_crtc *omap_crtc = omap_crtcs[channel]; |
| 221 | 221 | DBG("%s", omap_crtc->name); |
| 222 | − omap_crtc->timings = *timings; | |
| 222 | + omap_crtc->vm = *vm; | |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | static void omap_crtc_dss_set_lcd_config(enum omap_channel channel, |
| @@ -369,7 +369,10 @@ static void omap_crtc_mode_set_nofb(struct drm_crtc *crtc) · 143 unmodified lines | ||
| 369 | 369 | mode->vdisplay, mode->vsync_start, mode->vsync_end, mode->vtotal, |
| 370 | 370 | mode->type, mode->flags); |
| 371 | 371 | |
| 372 | − copy_timings_drm_to_omap(&omap_crtc->timings, mode); | |
| 372 | + drm_display_mode_to_videomode(mode, &omap_crtc->vm); | |
| 373 | + omap_crtc->vm.flags |= DISPLAY_FLAGS_DE_HIGH | | |
| 374 | + DISPLAY_FLAGS_PIXDATA_POSEDGE | | |
| 375 | + DISPLAY_FLAGS_SYNC_NEGEDGE; | |
| 373 | 376 | } |
| 374 | 377 | |
| 375 | 378 | static int omap_crtc_atomic_check(struct drm_crtc *crtc, |
| @@ -411,19 +414,6 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc, · 35 unmodified lines | ||
| 411 | 414 | dispc_mgr_set_gamma(omap_crtc->channel, lut, length); |
| 412 | 415 | } |
| 413 | 416 | |
| 414 | − if (crtc->state->color_mgmt_changed) { | |
| 415 | − struct drm_color_lut *lut = NULL; | |
| 416 | − uint length = 0; | |
| 417 | − | |
| 418 | − if (crtc->state->gamma_lut) { | |
| 419 | − lut = (struct drm_color_lut *) | |
| 420 | − crtc->state->gamma_lut->data; | |
| 421 | − length = crtc->state->gamma_lut->length / | |
| 422 | − sizeof(*lut); | |
| 423 | − } | |
| 424 | − dispc_mgr_set_gamma(omap_crtc->channel, lut, length); | |
| 425 | − } | |
| 426 | − | |
| 427 | 417 | if (dispc_mgr_is_enabled(omap_crtc->channel)) { |
| 428 | 418 | |
| 429 | 419 | DBG("%s: GO", omap_crtc->name); |
| @@ -148,7 +148,7 @@ static inline void omap_fbdev_free(struct drm_device *dev) · 147 unmodified lines | ||
| 148 | 148 | } |
| 149 | 149 | #endif |
| 150 | 150 | |
| 151 | −struct omap_video_timings *omap_crtc_timings(struct drm_crtc *crtc); | |
| 151 | +struct videomode *omap_crtc_timings(struct drm_crtc *crtc); | |
| 152 | 152 | enum omap_channel omap_crtc_channel(struct drm_crtc *crtc); |
| 153 | 153 | void omap_crtc_pre_init(void); |
| 154 | 154 | void omap_crtc_pre_uninit(void); |
| @@ -171,11 +171,6 @@ struct drm_encoder *omap_connector_attached_encoder( · 16 unmodified lines | ||
| 171 | 171 | struct drm_connector *connector); |
| 172 | 172 | bool omap_connector_get_hdmi_mode(struct drm_connector *connector); |
| 173 | 173 | |
| 174 | −void copy_timings_omap_to_drm(struct drm_display_mode *mode, | |
| 175 | − struct omap_video_timings *timings); | |
| 176 | −void copy_timings_drm_to_omap(struct omap_video_timings *timings, | |
| 177 | − struct drm_display_mode *mode); | |
| 178 | − | |
| 179 | 174 | uint32_t omap_framebuffer_get_formats(uint32_t *pixel_formats, |
| 180 | 175 | uint32_t max_formats, enum omap_color_mode supported_modes); |
| 181 | 176 | struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev, |
| @@ -102,7 +102,7 @@ static void omap_encoder_disable(struct drm_encoder *encoder) · 101 unmodified lines | ||
| 102 | 102 | |
| 103 | 103 | static int omap_encoder_update(struct drm_encoder *encoder, |
| 104 | 104 | enum omap_channel channel, |
| 105 | − struct omap_video_timings *timings) | |
| 105 | + struct videomode *vm) | |
| 106 | 106 | { |
| 107 | 107 | struct drm_device *dev = encoder->dev; |
| 108 | 108 | struct omap_encoder *omap_encoder = to_omap_encoder(encoder); |
| @@ -111,13 +111,13 @@ static int omap_encoder_update(struct drm_encoder *encoder, · 2 unmodified lines | ||
| 111 | 111 | int ret; |
| 112 | 112 | |
| 113 | 113 | if (dssdrv->check_timings) { |
| 114 | − ret = dssdrv->check_timings(dssdev, timings); | |
| 114 | + ret = dssdrv->check_timings(dssdev, vm); | |
| 115 | 115 | } else { |
| 116 | − struct omap_video_timings t = {0}; | |
| 116 | + struct videomode t = {0}; | |
| 117 | 117 | |
| 118 | 118 | dssdrv->get_timings(dssdev, &t); |
| 119 | 119 | |
| 120 | − if (memcmp(timings, &t, sizeof(struct omap_video_timings))) | |
| 120 | + if (memcmp(vm, &t, sizeof(struct videomode))) | |
| 121 | 121 | ret = -EINVAL; |
| 122 | 122 | else |
| 123 | 123 | ret = 0; |
| @@ -129,7 +129,7 @@ static int omap_encoder_update(struct drm_encoder *encoder, · 5 unmodified lines | ||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (dssdrv->set_timings) |
| 132 | − dssdrv->set_timings(dssdev, timings); | |
| 132 | + dssdrv->set_timings(dssdev, vm); | |
| 133 | 133 | |
| 134 | 134 | return 0; |
| 135 | 135 | } |
| @@ -336,8 +336,10 @@ static void omap_gem_detach_pages(struct drm_gem_object *obj) · 335 unmodified lines | ||
| 336 | 336 | if (omap_obj->flags & (OMAP_BO_WC|OMAP_BO_UNCACHED)) { |
| 337 | 337 | int i, npages = obj->size >> PAGE_SHIFT; |
| 338 | 338 | for (i = 0; i < npages; i++) { |
| 339 | − dma_unmap_page(obj->dev->dev, omap_obj->addrs[i], | |
| 340 | − PAGE_SIZE, DMA_BIDIRECTIONAL); | |
| 339 | + if (omap_obj->addrs[i]) | |
| 340 | + dma_unmap_page(obj->dev->dev, | |
| 341 | + omap_obj->addrs[i], | |
| 342 | + PAGE_SIZE, DMA_BIDIRECTIONAL); | |
| 341 | 343 | } |
| 342 | 344 | } |
| 343 | 345 | |
| @@ -131,7 +131,9 @@ static void omap_plane_atomic_update(struct drm_plane *plane, · 130 unmodified lines | ||
| 131 | 131 | /* and finally, update omapdss: */ |
| 132 | 132 | ret = dispc_ovl_setup(omap_plane->id, &info, false, |
| 133 | 133 | omap_crtc_timings(state->crtc), false); |
| 134 | − if (WARN_ON(ret)) { | |
| 134 | + if (ret) { | |
| 135 | + dev_err(plane->dev->dev, "Failed to setup plane %s\n", | |
| 136 | + omap_plane->name); | |
| 135 | 137 | dispc_ovl_enable(omap_plane->id, false); |
| 136 | 138 | return; |
| 137 | 139 | } |
| @@ -157,12 +159,20 @@ static int omap_plane_atomic_check(struct drm_plane *plane, · 19 unmodified lines | ||
| 157 | 159 | { |
| 158 | 160 | struct drm_crtc_state *crtc_state; |
| 159 | 161 | |
| 160 | − if (!state->crtc) | |
| 162 | + if (!state->fb) | |
| 161 | 163 | return 0; |
| 162 | 164 | |
| 163 | − crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc); | |
| 164 | − if (IS_ERR(crtc_state)) | |
| 165 | − return PTR_ERR(crtc_state); | |
| 165 | + /* crtc should only be NULL when disabling (i.e., !state->fb) */ | |
| 166 | + if (WARN_ON(!state->crtc)) | |
| 167 | + return 0; | |
| 168 | + | |
| 169 | + crtc_state = drm_atomic_get_existing_crtc_state(state->state, state->crtc); | |
| 170 | + /* we should have a crtc state if the plane is attached to a crtc */ | |
| 171 | + if (WARN_ON(!crtc_state)) | |
| 172 | + return 0; | |
| 173 | + | |
| 174 | + if (!crtc_state->enable) | |
| 175 | + return 0; | |
| 166 | 176 | |
| 167 | 177 | if (state->crtc_x < 0 || state->crtc_y < 0) |
| 168 | 178 | return -EINVAL; |
| @@ -173,11 +183,9 @@ static int omap_plane_atomic_check(struct drm_plane *plane, · 4 unmodified lines | ||
| 173 | 183 | if (state->crtc_y + state->crtc_h > crtc_state->adjusted_mode.vdisplay) |
| 174 | 184 | return -EINVAL; |
| 175 | 185 | |
| 176 | − if (state->fb) { | |
| 177 | − if (state->rotation != DRM_ROTATE_0 && | |
| 178 | − !omap_framebuffer_supports_rotation(state->fb)) | |
| 179 | − return -EINVAL; | |
| 180 | − } | |
| 186 | + if (state->rotation != DRM_ROTATE_0 && | |
| 187 | + !omap_framebuffer_supports_rotation(state->fb)) | |
| 188 | + return -EINVAL; | |
| 181 | 189 | |
| 182 | 190 | return 0; |
| 183 | 191 | } |
| @@ -88,6 +88,15 @@ static int of_parse_display_timing(const struct device_node *np, · 87 unmodified lines | ||
| 88 | 88 | dt->flags |= val ? DISPLAY_FLAGS_PIXDATA_POSEDGE : |
| 89 | 89 | DISPLAY_FLAGS_PIXDATA_NEGEDGE; |
| 90 | 90 | |
| 91 | + if (!of_property_read_u32(np, "syncclk-active", &val)) | |
| 92 | + dt->flags |= val ? DISPLAY_FLAGS_SYNC_POSEDGE : | |
| 93 | + DISPLAY_FLAGS_SYNC_NEGEDGE; | |
| 94 | + else if (dt->flags & (DISPLAY_FLAGS_PIXDATA_POSEDGE | | |
| 95 | + DISPLAY_FLAGS_PIXDATA_NEGEDGE)) | |
| 96 | + dt->flags |= dt->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE ? | |
| 97 | + DISPLAY_FLAGS_SYNC_POSEDGE : | |
| 98 | + DISPLAY_FLAGS_SYNC_NEGEDGE; | |
| 99 | + | |
| 91 | 100 | if (of_property_read_bool(np, "interlaced")) |
| 92 | 101 | dt->flags |= DISPLAY_FLAGS_INTERLACED; |
| 93 | 102 | if (of_property_read_bool(np, "doublescan")) |
| @@ -28,6 +28,10 @@ enum display_flags { · 27 unmodified lines | ||
| 28 | 28 | DISPLAY_FLAGS_INTERLACED = BIT(8), |
| 29 | 29 | DISPLAY_FLAGS_DOUBLESCAN = BIT(9), |
| 30 | 30 | DISPLAY_FLAGS_DOUBLECLK = BIT(10), |
| 31 | + /* drive sync on pos. edge */ | |
| 32 | + DISPLAY_FLAGS_SYNC_POSEDGE = BIT(11), | |
| 33 | + /* drive sync on neg. edge */ | |
| 34 | + DISPLAY_FLAGS_SYNC_NEGEDGE = BIT(12), | |
| 31 | 35 | }; |
| 32 | 36 | |
| 33 | 37 | /* |