History

Merge tag 'omapdrm-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next

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.

Dave Airlie committed 10 years ago

Commit dc345c42 parents fb42295 d7b56e639 files · +807 −1016Browse files

Unified · Split

39 files
  1. Documentation/devicetree/bindings/display/panel/display-timing.txt +8 −0
  2. drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +24 −23
  3. drivers/gpu/drm/omapdrm/displays/connector-dvi.c +24 −26
  4. drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +23 −26
  5. drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +10 −10
  6. drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +15 −16
  7. drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +10 −10
  8. drivers/gpu/drm/omapdrm/displays/panel-dpi.c +13 −17
  9. drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +12 −13
  10. drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +31 −28
  11. drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +25 −27
  12. drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +30 −28
  13. drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +25 −28
  14. drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +29 −28
  15. drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +28 −26
  16. drivers/gpu/drm/omapdrm/dss/dispc.c +97 −131
  17. drivers/gpu/drm/omapdrm/dss/display.c +4 −74
  18. drivers/gpu/drm/omapdrm/dss/dpi.c +20 −20
  19. drivers/gpu/drm/omapdrm/dss/dsi.c +83 −77
  20. drivers/gpu/drm/omapdrm/dss/dss.h +2 −3
  21. drivers/gpu/drm/omapdrm/dss/hdmi.h +4 −4
  22. drivers/gpu/drm/omapdrm/dss/hdmi4.c +16 −15
  23. drivers/gpu/drm/omapdrm/dss/hdmi4_core.c +4 −4
  24. drivers/gpu/drm/omapdrm/dss/hdmi5.c +16 −15
  25. drivers/gpu/drm/omapdrm/dss/hdmi5_core.c +39 −46
  26. drivers/gpu/drm/omapdrm/dss/hdmi_wp.c +35 −38
  27. drivers/gpu/drm/omapdrm/dss/omapdss.h +28 −70
  28. drivers/gpu/drm/omapdrm/dss/output.c +2 −3
  29. drivers/gpu/drm/omapdrm/dss/rfbi.c +27 −22
  30. drivers/gpu/drm/omapdrm/dss/sdi.c +16 −17
  31. drivers/gpu/drm/omapdrm/dss/venc.c +45 −52
  32. drivers/gpu/drm/omapdrm/omap_connector.c +11 −76
  33. drivers/gpu/drm/omapdrm/omap_crtc.c +10 −20
  34. drivers/gpu/drm/omapdrm/omap_drv.h +1 −6
  35. drivers/gpu/drm/omapdrm/omap_encoder.c +5 −5
  36. drivers/gpu/drm/omapdrm/omap_gem.c +4 −2
  37. drivers/gpu/drm/omapdrm/omap_plane.c +18 −10
  38. drivers/video/of_display_timing.c +9 −0
  39. include/video/display_timing.h +4 −0
Documentation/devicetree/bindings/display/panel/display-timing.txt+8−0
@@ -32,6 +32,14 @@ optional properties: · 31 unmodified lines
3232 - active low = drive pixel data on falling edge/
3333 sample data on rising edge
3434 - 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
3543 - interlaced (bool): boolean to enable interlaced mode
3644 - doublescan (bool): boolean to enable doublescan mode
3745 - doubleclk (bool): boolean to enable doubleclock mode
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c+24−23
@@ -24,23 +24,24 @@ struct panel_drv_data { · 23 unmodified lines
2424
2525 struct device *dev;
2626
27− struct omap_video_timings timings;
27+ struct videomode vm;
2828
2929 bool invert_polarity;
3030 };
3131
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,
3535 .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,
4445 };
4546
4647 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
9293 if (omapdss_device_is_enabled(dssdev))
9394 return 0;
9495
95− in->ops.atv->set_timings(in, &ddata->timings);
96+ in->ops.atv->set_timings(in, &ddata->vm);
9697
9798 if (!ddata->dev->of_node) {
9899 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
126127 }
127128
128129 static void tvc_set_timings(struct omap_dss_device *dssdev,
129− struct omap_video_timings *timings)
130+ struct videomode *vm)
130131 {
131132 struct panel_drv_data *ddata = to_panel_data(dssdev);
132133 struct omap_dss_device *in = ddata->in;
133134
134− ddata->timings = *timings;
135− dssdev->panel.timings = *timings;
135+ ddata->vm = *vm;
136+ dssdev->panel.vm = *vm;
136137
137− in->ops.atv->set_timings(in, timings);
138+ in->ops.atv->set_timings(in, vm);
138139 }
139140
140141 static void tvc_get_timings(struct omap_dss_device *dssdev,
141− struct omap_video_timings *timings)
142+ struct videomode *vm)
142143 {
143144 struct panel_drv_data *ddata = to_panel_data(dssdev);
144145
145− *timings = ddata->timings;
146+ *vm = ddata->vm;
146147 }
147148
148149 static int tvc_check_timings(struct omap_dss_device *dssdev,
149− struct omap_video_timings *timings)
150+ struct videomode *vm)
150151 {
151152 struct panel_drv_data *ddata = to_panel_data(dssdev);
152153 struct omap_dss_device *in = ddata->in;
153154
154− return in->ops.atv->check_timings(in, timings);
155+ return in->ops.atv->check_timings(in, vm);
155156 }
156157
157158 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
253254 return -ENODEV;
254255 }
255256
256− ddata->timings = tvc_pal_timings;
257+ ddata->vm = tvc_pal_vm;
257258
258259 dssdev = &ddata->dssdev;
259260 dssdev->driver = &tvc_driver;
260261 dssdev->dev = &pdev->dev;
261262 dssdev->type = OMAP_DISPLAY_TYPE_VENC;
262263 dssdev->owner = THIS_MODULE;
263− dssdev->panel.timings = tvc_pal_timings;
264+ dssdev->panel.vm = tvc_pal_vm;
264265
265266 r = omapdss_register_display(dssdev);
266267 if (r) {
drivers/gpu/drm/omapdrm/displays/connector-dvi.c+24−26
@@ -19,32 +19,30 @@ · 18 unmodified lines
1919
2020 #include "../dss/omapdss.h"
2121
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,
2525
2626 .pixelclock = 23500000,
2727
28− .hfp = 48,
29− .hsw = 32,
30− .hbp = 80,
28+ .hfront_porch = 48,
29+ .hsync_len = 32,
30+ .hback_porch = 80,
3131
32− .vfp = 3,
33− .vsw = 4,
34− .vbp = 7,
32+ .vfront_porch = 3,
33+ .vsync_len = 4,
34+ .vback_porch = 7,
3535
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,
4139 };
4240
4341 struct panel_drv_data {
4442 struct omap_dss_device dssdev;
4543 struct omap_dss_device *in;
4644
47− struct omap_video_timings timings;
45+ struct videomode vm;
4846
4947 struct i2c_adapter *i2c_adapter;
5048 };
@@ -90,7 +88,7 @@ static int dvic_enable(struct omap_dss_device *dssdev) · 39 unmodified lines
9088 if (omapdss_device_is_enabled(dssdev))
9189 return 0;
9290
93− in->ops.dvi->set_timings(in, &ddata->timings);
91+ in->ops.dvi->set_timings(in, &ddata->vm);
9492
9593 r = in->ops.dvi->enable(in);
9694 if (r)
@@ -115,32 +113,32 @@ static void dvic_disable(struct omap_dss_device *dssdev) · 18 unmodified lines
115113 }
116114
117115 static void dvic_set_timings(struct omap_dss_device *dssdev,
118− struct omap_video_timings *timings)
116+ struct videomode *vm)
119117 {
120118 struct panel_drv_data *ddata = to_panel_data(dssdev);
121119 struct omap_dss_device *in = ddata->in;
122120
123− ddata->timings = *timings;
124− dssdev->panel.timings = *timings;
121+ ddata->vm = *vm;
122+ dssdev->panel.vm = *vm;
125123
126− in->ops.dvi->set_timings(in, timings);
124+ in->ops.dvi->set_timings(in, vm);
127125 }
128126
129127 static void dvic_get_timings(struct omap_dss_device *dssdev,
130− struct omap_video_timings *timings)
128+ struct videomode *vm)
131129 {
132130 struct panel_drv_data *ddata = to_panel_data(dssdev);
133131
134− *timings = ddata->timings;
132+ *vm = ddata->vm;
135133 }
136134
137135 static int dvic_check_timings(struct omap_dss_device *dssdev,
138− struct omap_video_timings *timings)
136+ struct videomode *vm)
139137 {
140138 struct panel_drv_data *ddata = to_panel_data(dssdev);
141139 struct omap_dss_device *in = ddata->in;
142140
143− return in->ops.dvi->check_timings(in, timings);
141+ return in->ops.dvi->check_timings(in, vm);
144142 }
145143
146144 static int dvic_ddc_read(struct i2c_adapter *adapter,
@@ -287,14 +285,14 @@ static int dvic_probe(struct platform_device *pdev) · 140 unmodified lines
287285 if (r)
288286 return r;
289287
290− ddata->timings = dvic_default_timings;
288+ ddata->vm = dvic_default_vm;
291289
292290 dssdev = &ddata->dssdev;
293291 dssdev->driver = &dvic_driver;
294292 dssdev->dev = &pdev->dev;
295293 dssdev->type = OMAP_DISPLAY_TYPE_DVI;
296294 dssdev->owner = THIS_MODULE;
297− dssdev->panel.timings = dvic_default_timings;
295+ dssdev->panel.vm = dvic_default_vm;
298296
299297 r = omapdss_register_display(dssdev);
300298 if (r) {
drivers/gpu/drm/omapdrm/displays/connector-hdmi.c+23−26
@@ -21,21 +21,18 @@ · 20 unmodified lines
2121
2222 #include "../dss/omapdss.h"
2323
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,
2727 .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,
3936 };
4037
4138 struct panel_drv_data {
@@ -44,7 +41,7 @@ struct panel_drv_data { · 2 unmodified lines
4441
4542 struct device *dev;
4643
47− struct omap_video_timings timings;
44+ struct videomode vm;
4845
4946 int hpd_gpio;
5047 };
@@ -96,7 +93,7 @@ static int hdmic_enable(struct omap_dss_device *dssdev) · 45 unmodified lines
9693 if (omapdss_device_is_enabled(dssdev))
9794 return 0;
9895
99− in->ops.hdmi->set_timings(in, &ddata->timings);
96+ in->ops.hdmi->set_timings(in, &ddata->vm);
10097
10198 r = in->ops.hdmi->enable(in);
10299 if (r)
@@ -123,32 +120,32 @@ static void hdmic_disable(struct omap_dss_device *dssdev) · 20 unmodified lines
123120 }
124121
125122 static void hdmic_set_timings(struct omap_dss_device *dssdev,
126− struct omap_video_timings *timings)
123+ struct videomode *vm)
127124 {
128125 struct panel_drv_data *ddata = to_panel_data(dssdev);
129126 struct omap_dss_device *in = ddata->in;
130127
131− ddata->timings = *timings;
132− dssdev->panel.timings = *timings;
128+ ddata->vm = *vm;
129+ dssdev->panel.vm = *vm;
133130
134− in->ops.hdmi->set_timings(in, timings);
131+ in->ops.hdmi->set_timings(in, vm);
135132 }
136133
137134 static void hdmic_get_timings(struct omap_dss_device *dssdev,
138− struct omap_video_timings *timings)
135+ struct videomode *vm)
139136 {
140137 struct panel_drv_data *ddata = to_panel_data(dssdev);
141138
142− *timings = ddata->timings;
139+ *vm = ddata->vm;
143140 }
144141
145142 static int hdmic_check_timings(struct omap_dss_device *dssdev,
146− struct omap_video_timings *timings)
143+ struct videomode *vm)
147144 {
148145 struct panel_drv_data *ddata = to_panel_data(dssdev);
149146 struct omap_dss_device *in = ddata->in;
150147
151− return in->ops.hdmi->check_timings(in, timings);
148+ return in->ops.hdmi->check_timings(in, vm);
152149 }
153150
154151 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
259256 goto err_reg;
260257 }
261258
262− ddata->timings = hdmic_default_timings;
259+ ddata->vm = hdmic_default_vm;
263260
264261 dssdev = &ddata->dssdev;
265262 dssdev->driver = &hdmic_driver;
266263 dssdev->dev = &pdev->dev;
267264 dssdev->type = OMAP_DISPLAY_TYPE_HDMI;
268265 dssdev->owner = THIS_MODULE;
269− dssdev->panel.timings = hdmic_default_timings;
266+ dssdev->panel.vm = hdmic_default_vm;
270267
271268 r = omapdss_register_display(dssdev);
272269 if (r) {
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c+10−10
@@ -27,7 +27,7 @@ struct panel_drv_data { · 26 unmodified lines
2727
2828 struct gpio_desc *enable_gpio;
2929
30− struct omap_video_timings timings;
30+ struct videomode vm;
3131 };
3232
3333 #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
9090 if (omapdss_device_is_enabled(dssdev))
9191 return 0;
9292
93− in->ops.atv->set_timings(in, &ddata->timings);
93+ in->ops.atv->set_timings(in, &ddata->vm);
9494
9595 r = in->ops.atv->enable(in);
9696 if (r)
@@ -123,38 +123,38 @@ static void opa362_disable(struct omap_dss_device *dssdev) · 26 unmodified lines
123123 }
124124
125125 static void opa362_set_timings(struct omap_dss_device *dssdev,
126− struct omap_video_timings *timings)
126+ struct videomode *vm)
127127 {
128128 struct panel_drv_data *ddata = to_panel_data(dssdev);
129129 struct omap_dss_device *in = ddata->in;
130130
131131 dev_dbg(dssdev->dev, "set_timings\n");
132132
133− ddata->timings = *timings;
134− dssdev->panel.timings = *timings;
133+ ddata->vm = *vm;
134+ dssdev->panel.vm = *vm;
135135
136− in->ops.atv->set_timings(in, timings);
136+ in->ops.atv->set_timings(in, vm);
137137 }
138138
139139 static void opa362_get_timings(struct omap_dss_device *dssdev,
140− struct omap_video_timings *timings)
140+ struct videomode *vm)
141141 {
142142 struct panel_drv_data *ddata = to_panel_data(dssdev);
143143
144144 dev_dbg(dssdev->dev, "get_timings\n");
145145
146− *timings = ddata->timings;
146+ *vm = ddata->vm;
147147 }
148148
149149 static int opa362_check_timings(struct omap_dss_device *dssdev,
150− struct omap_video_timings *timings)
150+ struct videomode *vm)
151151 {
152152 struct panel_drv_data *ddata = to_panel_data(dssdev);
153153 struct omap_dss_device *in = ddata->in;
154154
155155 dev_dbg(dssdev->dev, "check_timings\n");
156156
157− return in->ops.atv->check_timings(in, timings);
157+ return in->ops.atv->check_timings(in, vm);
158158 }
159159
160160 static void opa362_set_type(struct omap_dss_device *dssdev,
drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c+15−16
@@ -24,7 +24,7 @@ struct panel_drv_data { · 23 unmodified lines
2424 int pd_gpio;
2525 int data_lines;
2626
27− struct omap_video_timings timings;
27+ struct videomode vm;
2828 };
2929
3030 #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
8181 if (omapdss_device_is_enabled(dssdev))
8282 return 0;
8383
84− in->ops.dpi->set_timings(in, &ddata->timings);
84+ in->ops.dpi->set_timings(in, &ddata->vm);
8585 if (ddata->data_lines)
8686 in->ops.dpi->set_data_lines(in, ddata->data_lines);
8787
@@ -113,44 +113,43 @@ static void tfp410_disable(struct omap_dss_device *dssdev) · 25 unmodified lines
113113 dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
114114 }
115115
116−static void tfp410_fix_timings(struct omap_video_timings *timings)
116+static void tfp410_fix_timings(struct videomode *vm)
117117 {
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;
121120 }
122121
123122 static void tfp410_set_timings(struct omap_dss_device *dssdev,
124− struct omap_video_timings *timings)
123+ struct videomode *vm)
125124 {
126125 struct panel_drv_data *ddata = to_panel_data(dssdev);
127126 struct omap_dss_device *in = ddata->in;
128127
129− tfp410_fix_timings(timings);
128+ tfp410_fix_timings(vm);
130129
131− ddata->timings = *timings;
132− dssdev->panel.timings = *timings;
130+ ddata->vm = *vm;
131+ dssdev->panel.vm = *vm;
133132
134− in->ops.dpi->set_timings(in, timings);
133+ in->ops.dpi->set_timings(in, vm);
135134 }
136135
137136 static void tfp410_get_timings(struct omap_dss_device *dssdev,
138− struct omap_video_timings *timings)
137+ struct videomode *vm)
139138 {
140139 struct panel_drv_data *ddata = to_panel_data(dssdev);
141140
142− *timings = ddata->timings;
141+ *vm = ddata->vm;
143142 }
144143
145144 static int tfp410_check_timings(struct omap_dss_device *dssdev,
146− struct omap_video_timings *timings)
145+ struct videomode *vm)
147146 {
148147 struct panel_drv_data *ddata = to_panel_data(dssdev);
149148 struct omap_dss_device *in = ddata->in;
150149
151− tfp410_fix_timings(timings);
150+ tfp410_fix_timings(vm);
152151
153− return in->ops.dpi->check_timings(in, timings);
152+ return in->ops.dpi->check_timings(in, vm);
154153 }
155154
156155 static const struct omapdss_dvi_ops tfp410_dvi_ops = {
drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c+10−10
@@ -26,7 +26,7 @@ struct panel_drv_data { · 25 unmodified lines
2626 struct gpio_desc *ls_oe_gpio;
2727 struct gpio_desc *hpd_gpio;
2828
29− struct omap_video_timings timings;
29+ struct videomode vm;
3030 };
3131
3232 #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
8080 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
8181 return 0;
8282
83− in->ops.hdmi->set_timings(in, &ddata->timings);
83+ in->ops.hdmi->set_timings(in, &ddata->vm);
8484
8585 r = in->ops.hdmi->enable(in);
8686 if (r)
@@ -105,33 +105,33 @@ static void tpd_disable(struct omap_dss_device *dssdev) · 18 unmodified lines
105105 }
106106
107107 static void tpd_set_timings(struct omap_dss_device *dssdev,
108− struct omap_video_timings *timings)
108+ struct videomode *vm)
109109 {
110110 struct panel_drv_data *ddata = to_panel_data(dssdev);
111111 struct omap_dss_device *in = ddata->in;
112112
113− ddata->timings = *timings;
114− dssdev->panel.timings = *timings;
113+ ddata->vm = *vm;
114+ dssdev->panel.vm = *vm;
115115
116− in->ops.hdmi->set_timings(in, timings);
116+ in->ops.hdmi->set_timings(in, vm);
117117 }
118118
119119 static void tpd_get_timings(struct omap_dss_device *dssdev,
120− struct omap_video_timings *timings)
120+ struct videomode *vm)
121121 {
122122 struct panel_drv_data *ddata = to_panel_data(dssdev);
123123
124− *timings = ddata->timings;
124+ *vm = ddata->vm;
125125 }
126126
127127 static int tpd_check_timings(struct omap_dss_device *dssdev,
128− struct omap_video_timings *timings)
128+ struct videomode *vm)
129129 {
130130 struct panel_drv_data *ddata = to_panel_data(dssdev);
131131 struct omap_dss_device *in = ddata->in;
132132 int r;
133133
134− r = in->ops.hdmi->check_timings(in, timings);
134+ r = in->ops.hdmi->check_timings(in, vm);
135135
136136 return r;
137137 }
drivers/gpu/drm/omapdrm/displays/panel-dpi.c+13−17
@@ -28,7 +28,7 @@ struct panel_drv_data { · 27 unmodified lines
2828
2929 int data_lines;
3030
31− struct omap_video_timings videomode;
31+ struct videomode vm;
3232
3333 /* used for non-DT boot, to be removed */
3434 int backlight_gpio;
@@ -80,7 +80,7 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev) · 45 unmodified lines
8080
8181 if (ddata->data_lines)
8282 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);
8484
8585 r = in->ops.dpi->enable(in);
8686 if (r)
@@ -122,32 +122,32 @@ static void panel_dpi_disable(struct omap_dss_device *dssdev) · 35 unmodified lines
122122 }
123123
124124 static void panel_dpi_set_timings(struct omap_dss_device *dssdev,
125− struct omap_video_timings *timings)
125+ struct videomode *vm)
126126 {
127127 struct panel_drv_data *ddata = to_panel_data(dssdev);
128128 struct omap_dss_device *in = ddata->in;
129129
130− ddata->videomode = *timings;
131− dssdev->panel.timings = *timings;
130+ ddata->vm = *vm;
131+ dssdev->panel.vm = *vm;
132132
133− in->ops.dpi->set_timings(in, timings);
133+ in->ops.dpi->set_timings(in, vm);
134134 }
135135
136136 static void panel_dpi_get_timings(struct omap_dss_device *dssdev,
137− struct omap_video_timings *timings)
137+ struct videomode *vm)
138138 {
139139 struct panel_drv_data *ddata = to_panel_data(dssdev);
140140
141− *timings = ddata->videomode;
141+ *vm = ddata->vm;
142142 }
143143
144144 static int panel_dpi_check_timings(struct omap_dss_device *dssdev,
145− struct omap_video_timings *timings)
145+ struct videomode *vm)
146146 {
147147 struct panel_drv_data *ddata = to_panel_data(dssdev);
148148 struct omap_dss_device *in = ddata->in;
149149
150− return in->ops.dpi->check_timings(in, timings);
150+ return in->ops.dpi->check_timings(in, vm);
151151 }
152152
153153 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
169169 const struct panel_dpi_platform_data *pdata;
170170 struct panel_drv_data *ddata = platform_get_drvdata(pdev);
171171 struct omap_dss_device *dssdev, *in;
172− struct videomode vm;
173172 int r;
174173
175174 pdata = dev_get_platdata(&pdev->dev);
@@ -185,8 +184,7 @@ static int panel_dpi_probe_pdata(struct platform_device *pdev) · 9 unmodified lines
185184
186185 ddata->data_lines = pdata->data_lines;
187186
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);
190188
191189 dssdev = &ddata->dssdev;
192190 dssdev->name = pdata->name;
@@ -214,7 +212,6 @@ static int panel_dpi_probe_of(struct platform_device *pdev) · 21 unmodified lines
214212 struct omap_dss_device *in;
215213 int r;
216214 struct display_timing timing;
217− struct videomode vm;
218215 struct gpio_desc *gpio;
219216
220217 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
245242 return r;
246243 }
247244
248− videomode_from_timing(&timing, &vm);
249− videomode_to_omap_video_timings(&vm, &ddata->videomode);
245+ videomode_from_timing(&timing, &ddata->vm);
250246
251247 in = omapdss_of_find_source_for_first_ep(node);
252248 if (IS_ERR(in)) {
@@ -295,7 +291,7 @@ static int panel_dpi_probe(struct platform_device *pdev) · 42 unmodified lines
295291 dssdev->driver = &panel_dpi_ops;
296292 dssdev->type = OMAP_DISPLAY_TYPE_DPI;
297293 dssdev->owner = THIS_MODULE;
298− dssdev->panel.timings = ddata->videomode;
294+ dssdev->panel.vm = ddata->vm;
299295 dssdev->phy.dpi.data_lines = ddata->data_lines;
300296
301297 r = omapdss_register_display(dssdev);
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c+12−13
@@ -42,7 +42,7 @@ struct panel_drv_data { · 41 unmodified lines
4242 struct omap_dss_device dssdev;
4343 struct omap_dss_device *in;
4444
45− struct omap_video_timings timings;
45+ struct videomode vm;
4646
4747 struct platform_device *pdev;
4848
@@ -382,8 +382,8 @@ static const struct backlight_ops dsicm_bl_ops = { · 333 unmodified lines
382382 static void dsicm_get_resolution(struct omap_dss_device *dssdev,
383383 u16 *xres, u16 *yres)
384384 {
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;
387387 }
388388
389389 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
589589 struct omap_dss_dsi_config dsi_config = {
590590 .mode = OMAP_DSS_DSI_CMD_MODE,
591591 .pixel_format = OMAP_DSS_DSI_FMT_RGB888,
592− .timings = &ddata->timings,
592+ .vm = &ddata->vm,
593593 .hs_clk_min = 150000000,
594594 .hs_clk_max = 300000000,
595595 .lp_clk_min = 7000000,
@@ -892,8 +892,8 @@ static int dsicm_update(struct omap_dss_device *dssdev, · 296 unmodified lines
892892
893893 /* XXX no need to send this every frame, but dsi break if not done */
894894 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);
897897 if (r)
898898 goto err;
899899
@@ -1023,9 +1023,8 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, · 123 unmodified lines
10231023 goto err1;
10241024 }
10251025
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);
10291028
10301029 in->ops.dsi->bus_lock(in);
10311030
@@ -1186,14 +1185,14 @@ static int dsicm_probe(struct platform_device *pdev) · 154 unmodified lines
11861185 if (r)
11871186 return r;
11881187
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;
11921191
11931192 dssdev = &ddata->dssdev;
11941193 dssdev->dev = dev;
11951194 dssdev->driver = &dsicm_ops;
1196− dssdev->panel.timings = ddata->timings;
1195+ dssdev->panel.vm = ddata->vm;
11971196 dssdev->type = OMAP_DISPLAY_TYPE_DSI;
11981197 dssdev->owner = THIS_MODULE;
11991198
drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c+31−28
@@ -19,25 +19,28 @@ · 18 unmodified lines
1919
2020 #include "../dss/omapdss.h"
2121
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,
2525
2626 .pixelclock = 6500000,
2727
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+ */
4144 };
4245
4346 struct panel_drv_data {
@@ -48,7 +51,7 @@ struct panel_drv_data { · 4 unmodified lines
4851
4952 int data_lines;
5053
51− struct omap_video_timings videomode;
54+ struct videomode vm;
5255
5356 struct gpio_desc *enable_gpio;
5457 };
@@ -158,7 +161,7 @@ static int lb035q02_enable(struct omap_dss_device *dssdev) · 103 unmodified lines
158161
159162 if (ddata->data_lines)
160163 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);
162165
163166 r = in->ops.dpi->enable(in);
164167 if (r)
@@ -189,32 +192,32 @@ static void lb035q02_disable(struct omap_dss_device *dssdev) · 24 unmodified lines
189192 }
190193
191194 static void lb035q02_set_timings(struct omap_dss_device *dssdev,
192− struct omap_video_timings *timings)
195+ struct videomode *vm)
193196 {
194197 struct panel_drv_data *ddata = to_panel_data(dssdev);
195198 struct omap_dss_device *in = ddata->in;
196199
197− ddata->videomode = *timings;
198− dssdev->panel.timings = *timings;
200+ ddata->vm = *vm;
201+ dssdev->panel.vm = *vm;
199202
200− in->ops.dpi->set_timings(in, timings);
203+ in->ops.dpi->set_timings(in, vm);
201204 }
202205
203206 static void lb035q02_get_timings(struct omap_dss_device *dssdev,
204− struct omap_video_timings *timings)
207+ struct videomode *vm)
205208 {
206209 struct panel_drv_data *ddata = to_panel_data(dssdev);
207210
208− *timings = ddata->videomode;
211+ *vm = ddata->vm;
209212 }
210213
211214 static int lb035q02_check_timings(struct omap_dss_device *dssdev,
212− struct omap_video_timings *timings)
215+ struct videomode *vm)
213216 {
214217 struct panel_drv_data *ddata = to_panel_data(dssdev);
215218 struct omap_dss_device *in = ddata->in;
216219
217− return in->ops.dpi->check_timings(in, timings);
220+ return in->ops.dpi->check_timings(in, vm);
218221 }
219222
220223 static struct omap_dss_driver lb035q02_ops = {
@@ -278,14 +281,14 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi) · 57 unmodified lines
278281 if (r)
279282 return r;
280283
281− ddata->videomode = lb035q02_timings;
284+ ddata->vm = lb035q02_vm;
282285
283286 dssdev = &ddata->dssdev;
284287 dssdev->dev = &spi->dev;
285288 dssdev->driver = &lb035q02_ops;
286289 dssdev->type = OMAP_DISPLAY_TYPE_DPI;
287290 dssdev->owner = THIS_MODULE;
288− dssdev->panel.timings = ddata->videomode;
291+ dssdev->panel.vm = ddata->vm;
289292 dssdev->phy.dpi.data_lines = ddata->data_lines;
290293
291294 r = omapdss_register_display(dssdev);
drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c+25−27
@@ -23,7 +23,7 @@ struct panel_drv_data { · 22 unmodified lines
2323 struct omap_dss_device dssdev;
2424 struct omap_dss_device *in;
2525
26− struct omap_video_timings videomode;
26+ struct videomode vm;
2727
2828 int data_lines;
2929
@@ -65,22 +65,20 @@ static const struct { · 35 unmodified lines
6565 { 156, 0x00 }, { 157, 0x00 }, { 2, 0x00 },
6666 };
6767
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,
7171 .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,
8482 };
8583
8684 #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
157155
158156 if (ddata->data_lines)
159157 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);
161159
162160 r = in->ops.dpi->enable(in);
163161 if (r)
@@ -188,32 +186,32 @@ static void nec_8048_disable(struct omap_dss_device *dssdev) · 24 unmodified lines
188186 }
189187
190188 static void nec_8048_set_timings(struct omap_dss_device *dssdev,
191− struct omap_video_timings *timings)
189+ struct videomode *vm)
192190 {
193191 struct panel_drv_data *ddata = to_panel_data(dssdev);
194192 struct omap_dss_device *in = ddata->in;
195193
196− ddata->videomode = *timings;
197− dssdev->panel.timings = *timings;
194+ ddata->vm = *vm;
195+ dssdev->panel.vm = *vm;
198196
199− in->ops.dpi->set_timings(in, timings);
197+ in->ops.dpi->set_timings(in, vm);
200198 }
201199
202200 static void nec_8048_get_timings(struct omap_dss_device *dssdev,
203− struct omap_video_timings *timings)
201+ struct videomode *vm)
204202 {
205203 struct panel_drv_data *ddata = to_panel_data(dssdev);
206204
207− *timings = ddata->videomode;
205+ *vm = ddata->vm;
208206 }
209207
210208 static int nec_8048_check_timings(struct omap_dss_device *dssdev,
211− struct omap_video_timings *timings)
209+ struct videomode *vm)
212210 {
213211 struct panel_drv_data *ddata = to_panel_data(dssdev);
214212 struct omap_dss_device *in = ddata->in;
215213
216− return in->ops.dpi->check_timings(in, timings);
214+ return in->ops.dpi->check_timings(in, vm);
217215 }
218216
219217 static struct omap_dss_driver nec_8048_ops = {
@@ -306,14 +304,14 @@ static int nec_8048_probe(struct spi_device *spi) · 86 unmodified lines
306304 goto err_gpio;
307305 }
308306
309− ddata->videomode = nec_8048_panel_timings;
307+ ddata->vm = nec_8048_panel_vm;
310308
311309 dssdev = &ddata->dssdev;
312310 dssdev->dev = &spi->dev;
313311 dssdev->driver = &nec_8048_ops;
314312 dssdev->type = OMAP_DISPLAY_TYPE_DPI;
315313 dssdev->owner = THIS_MODULE;
316− dssdev->panel.timings = ddata->videomode;
314+ dssdev->panel.vm = ddata->vm;
317315
318316 r = omapdss_register_display(dssdev);
319317 if (r) {
drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c+30−28
@@ -26,7 +26,7 @@ struct panel_drv_data { · 25 unmodified lines
2626
2727 int data_lines;
2828
29− struct omap_video_timings videomode;
29+ struct videomode vm;
3030
3131 struct gpio_desc *resb_gpio; /* low = reset active min 20 us */
3232 struct gpio_desc *ini_gpio; /* high = power on */
@@ -35,25 +35,27 @@ struct panel_drv_data { · 2 unmodified lines
3535 struct gpio_desc *ud_gpio; /* high = conventional vertical scanning */
3636 };
3737
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,
4141
4242 .pixelclock = 19200000,
4343
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+ */
5759 };
5860
5961 #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
99101
100102 if (ddata->data_lines)
101103 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);
103105
104106 if (ddata->vcc) {
105107 r = regulator_enable(ddata->vcc);
@@ -154,32 +156,32 @@ static void sharp_ls_disable(struct omap_dss_device *dssdev) · 48 unmodified lines
154156 }
155157
156158 static void sharp_ls_set_timings(struct omap_dss_device *dssdev,
157− struct omap_video_timings *timings)
159+ struct videomode *vm)
158160 {
159161 struct panel_drv_data *ddata = to_panel_data(dssdev);
160162 struct omap_dss_device *in = ddata->in;
161163
162− ddata->videomode = *timings;
163− dssdev->panel.timings = *timings;
164+ ddata->vm = *vm;
165+ dssdev->panel.vm = *vm;
164166
165− in->ops.dpi->set_timings(in, timings);
167+ in->ops.dpi->set_timings(in, vm);
166168 }
167169
168170 static void sharp_ls_get_timings(struct omap_dss_device *dssdev,
169− struct omap_video_timings *timings)
171+ struct videomode *vm)
170172 {
171173 struct panel_drv_data *ddata = to_panel_data(dssdev);
172174
173− *timings = ddata->videomode;
175+ *vm = ddata->vm;
174176 }
175177
176178 static int sharp_ls_check_timings(struct omap_dss_device *dssdev,
177− struct omap_video_timings *timings)
179+ struct videomode *vm)
178180 {
179181 struct panel_drv_data *ddata = to_panel_data(dssdev);
180182 struct omap_dss_device *in = ddata->in;
181183
182− return in->ops.dpi->check_timings(in, timings);
184+ return in->ops.dpi->check_timings(in, vm);
183185 }
184186
185187 static struct omap_dss_driver sharp_ls_ops = {
@@ -279,14 +281,14 @@ static int sharp_ls_probe(struct platform_device *pdev) · 93 unmodified lines
279281 if (r)
280282 return r;
281283
282− ddata->videomode = sharp_ls_timings;
284+ ddata->vm = sharp_ls_vm;
283285
284286 dssdev = &ddata->dssdev;
285287 dssdev->dev = &pdev->dev;
286288 dssdev->driver = &sharp_ls_ops;
287289 dssdev->type = OMAP_DISPLAY_TYPE_DPI;
288290 dssdev->owner = THIS_MODULE;
289− dssdev->panel.timings = ddata->videomode;
291+ dssdev->panel.vm = ddata->vm;
290292 dssdev->phy.dpi.data_lines = ddata->data_lines;
291293
292294 r = omapdss_register_display(dssdev);
drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c+25−28
@@ -71,7 +71,7 @@ struct panel_drv_data { · 70 unmodified lines
7171 int reset_gpio;
7272 int datapairs;
7373
74− struct omap_video_timings videomode;
74+ struct videomode vm;
7575
7676 char *name;
7777 int enabled;
@@ -92,23 +92,20 @@ struct panel_drv_data { · 14 unmodified lines
9292 struct backlight_device *bl_dev;
9393 };
9494
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,
9898 .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,
112109 };
113110
114111 #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
548545
549546 dev_dbg(&ddata->spi->dev, "%s\n", __func__);
550547
551− in->ops.sdi->set_timings(in, &ddata->videomode);
548+ in->ops.sdi->set_timings(in, &ddata->vm);
552549
553550 if (ddata->datapairs > 0)
554551 in->ops.sdi->set_datapairs(in, ddata->datapairs);
@@ -662,32 +659,32 @@ static void acx565akm_disable(struct omap_dss_device *dssdev) · 107 unmodified lines
662659 }
663660
664661 static void acx565akm_set_timings(struct omap_dss_device *dssdev,
665− struct omap_video_timings *timings)
662+ struct videomode *vm)
666663 {
667664 struct panel_drv_data *ddata = to_panel_data(dssdev);
668665 struct omap_dss_device *in = ddata->in;
669666
670− ddata->videomode = *timings;
671− dssdev->panel.timings = *timings;
667+ ddata->vm = *vm;
668+ dssdev->panel.vm = *vm;
672669
673− in->ops.sdi->set_timings(in, timings);
670+ in->ops.sdi->set_timings(in, vm);
674671 }
675672
676673 static void acx565akm_get_timings(struct omap_dss_device *dssdev,
677− struct omap_video_timings *timings)
674+ struct videomode *vm)
678675 {
679676 struct panel_drv_data *ddata = to_panel_data(dssdev);
680677
681− *timings = ddata->videomode;
678+ *vm = ddata->vm;
682679 }
683680
684681 static int acx565akm_check_timings(struct omap_dss_device *dssdev,
685− struct omap_video_timings *timings)
682+ struct videomode *vm)
686683 {
687684 struct panel_drv_data *ddata = to_panel_data(dssdev);
688685 struct omap_dss_device *in = ddata->in;
689686
690− return in->ops.sdi->check_timings(in, timings);
687+ return in->ops.sdi->check_timings(in, vm);
691688 }
692689
693690 static struct omap_dss_driver acx565akm_ops = {
@@ -845,14 +842,14 @@ static int acx565akm_probe(struct spi_device *spi) · 151 unmodified lines
845842 acx565akm_bl_update_status(bldev);
846843
847844
848− ddata->videomode = acx565akm_panel_timings;
845+ ddata->vm = acx565akm_panel_vm;
849846
850847 dssdev = &ddata->dssdev;
851848 dssdev->dev = &spi->dev;
852849 dssdev->driver = &acx565akm_ops;
853850 dssdev->type = OMAP_DISPLAY_TYPE_SDI;
854851 dssdev->owner = THIS_MODULE;
855− dssdev->panel.timings = ddata->videomode;
852+ dssdev->panel.vm = ddata->vm;
856853
857854 r = omapdss_register_display(dssdev);
858855 if (r) {
drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c+29−28
@@ -37,28 +37,29 @@ struct panel_drv_data { · 36 unmodified lines
3737
3838 int data_lines;
3939
40− struct omap_video_timings videomode;
40+ struct videomode vm;
4141
4242 struct spi_device *spi_dev;
4343 };
4444
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,
4848 .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+ */
6263 };
6364
6465 #define JBT_COMMAND 0x000
@@ -208,7 +209,7 @@ static int td028ttec1_panel_enable(struct omap_dss_device *dssdev) · 143 unmodified lines
208209
209210 if (ddata->data_lines)
210211 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);
212213
213214 r = in->ops.dpi->enable(in);
214215 if (r)
@@ -325,32 +326,32 @@ static void td028ttec1_panel_disable(struct omap_dss_device *dssdev) · 110 unmodified lines
325326 }
326327
327328 static void td028ttec1_panel_set_timings(struct omap_dss_device *dssdev,
328− struct omap_video_timings *timings)
329+ struct videomode *vm)
329330 {
330331 struct panel_drv_data *ddata = to_panel_data(dssdev);
331332 struct omap_dss_device *in = ddata->in;
332333
333− ddata->videomode = *timings;
334− dssdev->panel.timings = *timings;
334+ ddata->vm = *vm;
335+ dssdev->panel.vm = *vm;
335336
336− in->ops.dpi->set_timings(in, timings);
337+ in->ops.dpi->set_timings(in, vm);
337338 }
338339
339340 static void td028ttec1_panel_get_timings(struct omap_dss_device *dssdev,
340− struct omap_video_timings *timings)
341+ struct videomode *vm)
341342 {
342343 struct panel_drv_data *ddata = to_panel_data(dssdev);
343344
344− *timings = ddata->videomode;
345+ *vm = ddata->vm;
345346 }
346347
347348 static int td028ttec1_panel_check_timings(struct omap_dss_device *dssdev,
348− struct omap_video_timings *timings)
349+ struct videomode *vm)
349350 {
350351 struct panel_drv_data *ddata = to_panel_data(dssdev);
351352 struct omap_dss_device *in = ddata->in;
352353
353− return in->ops.dpi->check_timings(in, timings);
354+ return in->ops.dpi->check_timings(in, vm);
354355 }
355356
356357 static struct omap_dss_driver td028ttec1_ops = {
@@ -414,14 +415,14 @@ static int td028ttec1_panel_probe(struct spi_device *spi) · 57 unmodified lines
414415 if (r)
415416 return r;
416417
417− ddata->videomode = td028ttec1_panel_timings;
418+ ddata->vm = td028ttec1_panel_vm;
418419
419420 dssdev = &ddata->dssdev;
420421 dssdev->dev = &spi->dev;
421422 dssdev->driver = &td028ttec1_ops;
422423 dssdev->type = OMAP_DISPLAY_TYPE_DPI;
423424 dssdev->owner = THIS_MODULE;
424− dssdev->panel.timings = ddata->videomode;
425+ dssdev->panel.vm = ddata->vm;
425426 dssdev->phy.dpi.data_lines = ddata->data_lines;
426427
427428 r = omapdss_register_display(dssdev);
drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c+28−26
@@ -56,7 +56,7 @@ struct panel_drv_data { · 55 unmodified lines
5656 struct omap_dss_device dssdev;
5757 struct omap_dss_device *in;
5858
59− struct omap_video_timings videomode;
59+ struct videomode vm;
6060
6161 int data_lines;
6262
@@ -72,25 +72,27 @@ struct panel_drv_data { · 9 unmodified lines
7272 u32 power_on_resume:1;
7373 };
7474
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,
7878
7979 .pixelclock = 36000000,
8080
81− .hsw = 1,
82− .hfp = 68,
83− .hbp = 214,
81+ .hsync_len = 1,
82+ .hfront_porch = 68,
83+ .hback_porch = 214,
8484
85− .vsw = 1,
86− .vfp = 39,
87− .vbp = 34,
85+ .vsync_len = 1,
86+ .vfront_porch = 39,
87+ .vback_porch = 34,
8888
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+ */
9496 };
9597
9698 #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
378380
379381 if (ddata->data_lines)
380382 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);
382384
383385 r = in->ops.dpi->enable(in);
384386 if (r)
@@ -418,32 +420,32 @@ static void tpo_td043_disable(struct omap_dss_device *dssdev) · 33 unmodified lines
418420 }
419421
420422 static void tpo_td043_set_timings(struct omap_dss_device *dssdev,
421− struct omap_video_timings *timings)
423+ struct videomode *vm)
422424 {
423425 struct panel_drv_data *ddata = to_panel_data(dssdev);
424426 struct omap_dss_device *in = ddata->in;
425427
426− ddata->videomode = *timings;
427− dssdev->panel.timings = *timings;
428+ ddata->vm = *vm;
429+ dssdev->panel.vm = *vm;
428430
429− in->ops.dpi->set_timings(in, timings);
431+ in->ops.dpi->set_timings(in, vm);
430432 }
431433
432434 static void tpo_td043_get_timings(struct omap_dss_device *dssdev,
433− struct omap_video_timings *timings)
435+ struct videomode *vm)
434436 {
435437 struct panel_drv_data *ddata = to_panel_data(dssdev);
436438
437− *timings = ddata->videomode;
439+ *vm = ddata->vm;
438440 }
439441
440442 static int tpo_td043_check_timings(struct omap_dss_device *dssdev,
441− struct omap_video_timings *timings)
443+ struct videomode *vm)
442444 {
443445 struct panel_drv_data *ddata = to_panel_data(dssdev);
444446 struct omap_dss_device *in = ddata->in;
445447
446− return in->ops.dpi->check_timings(in, timings);
448+ return in->ops.dpi->check_timings(in, vm);
447449 }
448450
449451 static struct omap_dss_driver tpo_td043_ops = {
@@ -546,14 +548,14 @@ static int tpo_td043_probe(struct spi_device *spi) · 96 unmodified lines
546548 goto err_sysfs;
547549 }
548550
549− ddata->videomode = tpo_td043_timings;
551+ ddata->vm = tpo_td043_vm;
550552
551553 dssdev = &ddata->dssdev;
552554 dssdev->dev = &spi->dev;
553555 dssdev->driver = &tpo_td043_ops;
554556 dssdev->type = OMAP_DISPLAY_TYPE_DPI;
555557 dssdev->owner = THIS_MODULE;
556− dssdev->panel.timings = ddata->videomode;
558+ dssdev->panel.vm = ddata->vm;
557559
558560 r = omapdss_register_display(dssdev);
559561 if (r) {
drivers/gpu/drm/omapdrm/dss/dispc.c+97−131
@@ -75,7 +75,7 @@ struct dispc_features { · 74 unmodified lines
7575 unsigned long max_lcd_pclk;
7676 unsigned long max_tv_pclk;
7777 int (*calc_scaling) (unsigned long pclk, unsigned long lclk,
78− const struct omap_video_timings *mgr_timings,
78+ const struct videomode *vm,
7979 u16 width, u16 height, u16 out_width, u16 out_height,
8080 enum omap_color_mode color_mode, bool *five_taps,
8181 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
16791679 {
16801680 int scale_x = out_width != orig_width;
16811681 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;
16831683
16841684 if (!dss_has_feature(FEAT_HANDLE_UV_SEPARATE))
16851685 return;
@@ -2179,7 +2179,7 @@ static void calc_tiler_rotation_offset(u16 screen_width, u16 width, · 493 unmodified lines
21792179 * undocumented horizontal position and timing related limitations.
21802180 */
21812181 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,
21832183 u16 width, u16 height, u16 out_width, u16 out_height,
21842184 bool five_taps)
21852185 {
@@ -2189,14 +2189,16 @@ static int check_horiz_timing_omap3(unsigned long pclk, unsigned long lclk, · 3 unmodified lines
21892189 u64 val, blank;
21902190 int i;
21912191
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;
21932194
21942195 i = 0;
21952196 if (out_height < height)
21962197 i++;
21972198 if (out_width < width)
21982199 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);
22002202 DSSDBG("blanking period + ppl = %llu (limit = %u)\n", blank, limits[i]);
22012203 if (blank <= limits[i])
22022204 return -EINVAL;
@@ -2231,7 +2233,7 @@ static int check_horiz_timing_omap3(unsigned long pclk, unsigned long lclk, · 28 unmodified lines
22312233 }
22322234
22332235 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,
22352237 u16 height, u16 out_width, u16 out_height,
22362238 enum omap_color_mode color_mode)
22372239 {
@@ -2242,7 +2244,7 @@ static unsigned long calc_core_clk_five_taps(unsigned long pclk, · 4 unmodified lines
22422244 return (unsigned long) pclk;
22432245
22442246 if (height > out_height) {
2245− unsigned int ppl = mgr_timings->x_res;
2247+ unsigned int ppl = vm->hactive;
22462248
22472249 tmp = (u64)pclk * height * out_width;
22482250 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
23242326 }
23252327
23262328 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,
23282330 u16 width, u16 height, u16 out_width, u16 out_height,
23292331 enum omap_color_mode color_mode, bool *five_taps,
23302332 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
23702372 }
23712373
23722374 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,
23742376 u16 width, u16 height, u16 out_width, u16 out_height,
23752377 enum omap_color_mode color_mode, bool *five_taps,
23762378 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
23922394 *five_taps = false;
23932395 again:
23942396 if (*five_taps)
2395− *core_clk = calc_core_clk_five_taps(pclk, mgr_timings,
2397+ *core_clk = calc_core_clk_five_taps(pclk, vm,
23962398 in_width, in_height, out_width,
23972399 out_height, color_mode);
23982400 else
@@ -2400,7 +2402,7 @@ again: · 1 unmodified line
24002402 in_height, out_width, out_height,
24012403 mem_to_mem);
24022404
2403− error = check_horiz_timing_omap3(pclk, lclk, mgr_timings,
2405+ error = check_horiz_timing_omap3(pclk, lclk, vm,
24042406 pos_x, in_width, in_height, out_width,
24052407 out_height, *five_taps);
24062408 if (error && *five_taps) {
@@ -2435,7 +2437,7 @@ again: · 28 unmodified lines
24352437 return -EINVAL;
24362438 }
24372439
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,
24392441 in_height, out_width, out_height, *five_taps)) {
24402442 DSSERR("horizontal timing too tight\n");
24412443 return -EINVAL;
@@ -2455,7 +2457,7 @@ again: · 13 unmodified lines
24552457 }
24562458
24572459 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,
24592461 u16 width, u16 height, u16 out_width, u16 out_height,
24602462 enum omap_color_mode color_mode, bool *five_taps,
24612463 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
25012503
25022504 static int dispc_ovl_calc_scaling(unsigned long pclk, unsigned long lclk,
25032505 enum omap_overlay_caps caps,
2504− const struct omap_video_timings *mgr_timings,
2506+ const struct videomode *vm,
25052507 u16 width, u16 height, u16 out_width, u16 out_height,
25062508 enum omap_color_mode color_mode, bool *five_taps,
25072509 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
25152517 if (width == out_width && height == out_height)
25162518 return 0;
25172519
2518− if (!mem_to_mem && (pclk == 0 || mgr_timings->pixelclock == 0)) {
2520+ if (!mem_to_mem && (pclk == 0 || vm->pixelclock == 0)) {
25192521 DSSERR("cannot calculate scaling settings: pclk is zero\n");
25202522 return -EINVAL;
25212523 }
@@ -2551,7 +2553,7 @@ static int dispc_ovl_calc_scaling(unsigned long pclk, unsigned long lclk, · 29 unmodified lines
25512553 if (decim_y > *y_predecim || out_height > height * 8)
25522554 return -EINVAL;
25532555
2554− ret = dispc.feat->calc_scaling(pclk, lclk, mgr_timings, width, height,
2556+ ret = dispc.feat->calc_scaling(pclk, lclk, vm, width, height,
25552557 out_width, out_height, color_mode, five_taps,
25562558 x_predecim, y_predecim, &decim_x, &decim_y, pos_x, &core_clk,
25572559 mem_to_mem);
@@ -2591,7 +2593,7 @@ static int dispc_ovl_setup_common(enum omap_plane plane, · 33 unmodified lines
25912593 u16 out_width, u16 out_height, enum omap_color_mode color_mode,
25922594 u8 rotation, bool mirror, u8 zorder, u8 pre_mult_alpha,
25932595 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,
25952597 bool mem_to_mem)
25962598 {
25972599 bool five_taps = true;
@@ -2605,7 +2607,7 @@ static int dispc_ovl_setup_common(enum omap_plane plane, · 7 unmodified lines
26052607 u16 in_height = height;
26062608 u16 in_width = width;
26072609 int x_predecim = 1, y_predecim = 1;
2608− bool ilace = mgr_timings->interlace;
2610+ bool ilace = !!(vm->flags & DISPLAY_FLAGS_INTERLACED);
26092611 unsigned long pclk = dispc_plane_pclk_rate(plane);
26102612 unsigned long lclk = dispc_plane_lclk_rate(plane);
26112613
@@ -2647,7 +2649,7 @@ static int dispc_ovl_setup_common(enum omap_plane plane, · 35 unmodified lines
26472649 if (!dss_feat_color_mode_supported(plane, color_mode))
26482650 return -EINVAL;
26492651
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,
26512653 in_height, out_width, out_height, color_mode,
26522654 &five_taps, &x_predecim, &y_predecim, pos_x,
26532655 rotation_type, mem_to_mem);
@@ -2784,7 +2786,7 @@ static int dispc_ovl_setup_common(enum omap_plane plane, · 130 unmodified lines
27842786 }
27852787
27862788 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,
27882790 bool mem_to_mem)
27892791 {
27902792 int r;
@@ -2803,14 +2805,14 @@ int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi, · 12 unmodified lines
28032805 oi->screen_width, oi->pos_x, oi->pos_y, oi->width, oi->height,
28042806 oi->out_width, oi->out_height, oi->color_mode, oi->rotation,
28052807 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);
28072809
28082810 return r;
28092811 }
28102812 EXPORT_SYMBOL(dispc_ovl_setup);
28112813
28122814 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)
28142816 {
28152817 int r;
28162818 u32 l;
@@ -2819,8 +2821,8 @@ int dispc_wb_setup(const struct omap_dss_writeback_info *wi, · 2 unmodified lines
28192821 const u8 zorder = 0, global_alpha = 0;
28202822 const bool replication = false;
28212823 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;
28242826 enum omap_overlay_caps caps =
28252827 OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA;
28262828
@@ -2833,7 +2835,7 @@ int dispc_wb_setup(const struct omap_dss_writeback_info *wi, · 6 unmodified lines
28332835 wi->buf_width, pos_x, pos_y, in_width, in_height, wi->width,
28342836 wi->height, wi->color_mode, wi->rotation, wi->mirror, zorder,
28352837 wi->pre_mult_alpha, global_alpha, wi->rotation_type,
2836− replication, mgr_timings, mem_to_mem);
2838+ replication, vm, mem_to_mem);
28372839
28382840 switch (wi->color_mode) {
28392841 case OMAP_DSS_COLOR_RGB16:
@@ -2867,8 +2869,8 @@ int dispc_wb_setup(const struct omap_dss_writeback_info *wi, · 27 unmodified lines
28672869 } else {
28682870 int wbdelay;
28692871
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);
28722874
28732875 /* WBDELAYCOUNT */
28742876 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
30933095 height <= dispc.feat->mgr_height_max;
30943096 }
30953097
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,
30973099 int vsw, int vfp, int vbp)
30983100 {
3099− if (hsw < 1 || hsw > dispc.feat->sw_max ||
3101+ if (hsync_len < 1 || hsync_len > dispc.feat->sw_max ||
31003102 hfp < 1 || hfp > dispc.feat->hp_max ||
31013103 hbp < 1 || hbp > dispc.feat->hp_max ||
31023104 vsw < 1 || vsw > dispc.feat->sw_max ||
@@ -3110,113 +3112,77 @@ static bool _dispc_mgr_pclk_ok(enum omap_channel channel, · 7 unmodified lines
31103112 unsigned long pclk)
31113113 {
31123114 if (dss_mgr_is_lcd(channel))
3113− return pclk <= dispc.feat->max_lcd_pclk ? true : false;
3115+ return pclk <= dispc.feat->max_lcd_pclk;
31143116 else
3115− return pclk <= dispc.feat->max_tv_pclk ? true : false;
3117+ return pclk <= dispc.feat->max_tv_pclk;
31163118 }
31173119
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)
31203121 {
3121− if (!_dispc_mgr_size_ok(timings->x_res, timings->y_res))
3122+ if (!_dispc_mgr_size_ok(vm->hactive, vm->vactive))
31223123 return false;
31233124
3124− if (!_dispc_mgr_pclk_ok(channel, timings->pixelclock))
3125+ if (!_dispc_mgr_pclk_ok(channel, vm->pixelclock))
31253126 return false;
31263127
31273128 if (dss_mgr_is_lcd(channel)) {
31283129 /* TODO: OMAP4+ supports interlace for LCD outputs */
3129− if (timings->interlace)
3130+ if (vm->flags & DISPLAY_FLAGS_INTERLACED)
31303131 return false;
31313132
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))
31353137 return false;
31363138 }
31373139
31383140 return true;
31393141 }
31403142
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)
31493145 {
31503146 u32 timing_h, timing_v, l;
31513147 bool onoff, rf, ipc, vs, hs, de;
31523148
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);
31593155
31603156 dispc_write_reg(DISPC_TIMING_H(channel), timing_h);
31613157 dispc_write_reg(DISPC_TIMING_V(channel), timing_v);
31623158
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)
31683160 vs = false;
3169− break;
3170− default:
3171− BUG();
3172− }
3161+ else
3162+ vs = true;
31733163
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)
31793165 hs = false;
3180− break;
3181− default:
3182− BUG();
3183− }
3166+ else
3167+ hs = true;
31843168
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)
31903170 de = false;
3191− break;
3192− default:
3193− BUG();
3194− }
3171+ else
3172+ de = true;
31953173
3196− switch (data_pclk_edge) {
3197− case OMAPDSS_DRIVE_SIG_RISING_EDGE:
3174+ if (vm->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE)
31983175 ipc = false;
3199− break;
3200− case OMAPDSS_DRIVE_SIG_FALLING_EDGE:
3176+ else
32013177 ipc = true;
3202− break;
3203− default:
3204− BUG();
3205− }
32063178
32073179 /* always use the 'rf' setting */
32083180 onoff = true;
32093181
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)
32153183 rf = true;
3216− break;
3217− default:
3218− BUG();
3219− }
3184+ else
3185+ rf = false;
32203186
32213187 l = FLD_VAL(onoff, 17, 17) |
32223188 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
32533219
32543220 /* change name to mode? */
32553221 void dispc_mgr_set_timings(enum omap_channel channel,
3256− const struct omap_video_timings *timings)
3222+ const struct videomode *vm)
32573223 {
32583224 unsigned xtot, ytot;
32593225 unsigned long ht, vt;
3260− struct omap_video_timings t = *timings;
3226+ struct videomode t = *vm;
32613227
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);
32633229
32643230 if (!dispc_mgr_timings_ok(channel, &t)) {
32653231 BUG();
@@ -3267,34 +3233,37 @@ void dispc_mgr_set_timings(enum omap_channel channel, · 1 unmodified line
32673233 }
32683234
32693235 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);
32733237
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;
32763240
3277− ht = timings->pixelclock / xtot;
3278− vt = timings->pixelclock / xtot / ytot;
3241+ ht = vm->pixelclock / xtot;
3242+ vt = vm->pixelclock / xtot / ytot;
32793243
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);
32833248 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));
32863254
32873255 DSSDBG("hsync %luHz, vsync %luHz\n", ht, vt);
32883256 } else {
3289− if (t.interlace)
3290− t.y_res /= 2;
3257+ if (t.flags & DISPLAY_FLAGS_INTERLACED)
3258+ t.vactive /= 2;
32913259
32923260 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);
32953264 }
32963265
3297− dispc_mgr_set_size(channel, t.x_res, t.y_res);
3266+ dispc_mgr_set_size(channel, t.hactive, t.vactive);
32983267 }
32993268 EXPORT_SYMBOL(dispc_mgr_set_timings);
33003269
@@ -4214,23 +4183,20 @@ EXPORT_SYMBOL(dispc_free_irq); · 913 unmodified lines
42144183 */
42154184
42164185 static const struct dispc_errata_i734_data {
4217− struct omap_video_timings timings;
4186+ struct videomode vm;
42184187 struct omap_overlay_info ovli;
42194188 struct omap_overlay_manager_info mgri;
42204189 struct dss_lcd_mgr_config lcd_conf;
42214190 } i734 = {
4222− .timings = {
4223− .x_res = 8, .y_res = 1,
4191+ .vm = {
4192+ .hactive = 8, .vactive = 1,
42244193 .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,
42344200 },
42354201 .ovli = {
42364202 .screen_width = 1,
@@ -4320,7 +4286,7 @@ static void dispc_errata_i734_wa(void) · 83 unmodified lines
43204286
43214287 /* Setup and enable GFX plane */
43224288 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);
43244290 dispc_ovl_enable(OMAP_DSS_GFX, true);
43254291
43264292 /* Set up and enable display manager for LCD1 */
@@ -4328,7 +4294,7 @@ static void dispc_errata_i734_wa(void) · 1 unmodified line
43284294 dispc_calc_clock_rates(dss_get_dispc_clk_rate(),
43294295 &lcd_conf.clock_info);
43304296 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);
43324298
43334299 dispc_clear_irqstatus(framedone_irq);
43344300
drivers/gpu/drm/omapdrm/dss/display.c+4−74
@@ -35,8 +35,8 @@ · 34 unmodified lines
3535 void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
3636 u16 *xres, u16 *yres)
3737 {
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;
4040 }
4141 EXPORT_SYMBOL(omapdss_default_get_resolution);
4242
@@ -72,9 +72,9 @@ int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev) · 29 unmodified lines
7272 EXPORT_SYMBOL(omapdss_default_get_recommended_bpp);
7373
7474 void omapdss_default_get_timings(struct omap_dss_device *dssdev,
75− struct omap_video_timings *timings)
75+ struct videomode *vm)
7676 {
77− *timings = dssdev->panel.timings;
77+ *vm = dssdev->panel.vm;
7878 }
7979 EXPORT_SYMBOL(omapdss_default_get_timings);
8080
@@ -217,73 +217,3 @@ struct omap_dss_device *omap_dss_find_device(void *data, · 136 unmodified lines
217217 return NULL;
218218 }
219219 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);
drivers/gpu/drm/omapdrm/dss/dpi.c+20−20
@@ -47,7 +47,7 @@ struct dpi_data { · 46 unmodified lines
4747
4848 struct mutex lock;
4949
50− struct omap_video_timings timings;
50+ struct videomode vm;
5151 struct dss_lcd_mgr_config mgr_config;
5252 int data_lines;
5353
@@ -333,31 +333,31 @@ static int dpi_set_mode(struct dpi_data *dpi) · 279 unmodified lines
333333 {
334334 struct omap_dss_device *out = &dpi->output;
335335 enum omap_channel channel = out->dispc_channel;
336− struct omap_video_timings *t = &dpi->timings;
336+ struct videomode *vm = &dpi->vm;
337337 int lck_div = 0, pck_div = 0;
338338 unsigned long fck = 0;
339339 unsigned long pck;
340340 int r = 0;
341341
342342 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,
344344 &lck_div, &pck_div);
345345 else
346− r = dpi_set_dispc_clk(dpi, t->pixelclock, &fck,
346+ r = dpi_set_dispc_clk(dpi, vm->pixelclock, &fck,
347347 &lck_div, &pck_div);
348348 if (r)
349349 return r;
350350
351351 pck = fck / lck_div / pck_div;
352352
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);
356356
357− t->pixelclock = pck;
357+ vm->pixelclock = pck;
358358 }
359359
360− dss_mgr_set_timings(channel, t);
360+ dss_mgr_set_timings(channel, vm);
361361
362362 return 0;
363363 }
@@ -476,7 +476,7 @@ static void dpi_display_disable(struct omap_dss_device *dssdev) · 112 unmodified lines
476476 }
477477
478478 static void dpi_set_timings(struct omap_dss_device *dssdev,
479− struct omap_video_timings *timings)
479+ struct videomode *vm)
480480 {
481481 struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
482482
@@ -484,25 +484,25 @@ static void dpi_set_timings(struct omap_dss_device *dssdev, · 1 unmodified line
484484
485485 mutex_lock(&dpi->lock);
486486
487− dpi->timings = *timings;
487+ dpi->vm = *vm;
488488
489489 mutex_unlock(&dpi->lock);
490490 }
491491
492492 static void dpi_get_timings(struct omap_dss_device *dssdev,
493− struct omap_video_timings *timings)
493+ struct videomode *vm)
494494 {
495495 struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
496496
497497 mutex_lock(&dpi->lock);
498498
499− *timings = dpi->timings;
499+ *vm = dpi->vm;
500500
501501 mutex_unlock(&dpi->lock);
502502 }
503503
504504 static int dpi_check_timings(struct omap_dss_device *dssdev,
505− struct omap_video_timings *timings)
505+ struct videomode *vm)
506506 {
507507 struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
508508 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
512512 struct dpi_clk_calc_ctx ctx;
513513 bool ok;
514514
515− if (timings->x_res % 8 != 0)
515+ if (vm->hactive % 8 != 0)
516516 return -EINVAL;
517517
518− if (!dispc_mgr_timings_ok(channel, timings))
518+ if (!dispc_mgr_timings_ok(channel, vm))
519519 return -EINVAL;
520520
521− if (timings->pixelclock == 0)
521+ if (vm->pixelclock == 0)
522522 return -EINVAL;
523523
524524 if (dpi->pll) {
525− ok = dpi_pll_clk_calc(dpi, timings->pixelclock, &ctx);
525+ ok = dpi_pll_clk_calc(dpi, vm->pixelclock, &ctx);
526526 if (!ok)
527527 return -EINVAL;
528528
529529 fck = ctx.pll_cinfo.clkout[ctx.clkout_idx];
530530 } else {
531− ok = dpi_dss_clk_calc(timings->pixelclock, &ctx);
531+ ok = dpi_dss_clk_calc(vm->pixelclock, &ctx);
532532 if (!ok)
533533 return -EINVAL;
534534
@@ -540,7 +540,7 @@ static int dpi_check_timings(struct omap_dss_device *dssdev, · 5 unmodified lines
540540
541541 pck = fck / lck_div / pck_div;
542542
543− timings->pixelclock = pck;
543+ vm->pixelclock = pck;
544544
545545 return 0;
546546 }
drivers/gpu/drm/omapdrm/dss/dsi.c+83−77
@@ -289,7 +289,7 @@ struct dsi_clk_calc_ctx { · 288 unmodified lines
289289 struct dss_pll_clock_info dsi_cinfo;
290290 struct dispc_clock_info dispc_cinfo;
291291
292− struct omap_video_timings dispc_vm;
292+ struct videomode vm;
293293 struct omap_dss_dsi_videomode_timings dsi_vm;
294294 };
295295
@@ -383,7 +383,7 @@ struct dsi_data { · 87 unmodified lines
383383 unsigned scp_clk_refcount;
384384
385385 struct dss_lcd_mgr_config mgr_config;
386− struct omap_video_timings timings;
386+ struct videomode vm;
387387 enum omap_dss_dsi_pixel_format pix_fmt;
388388 enum omap_dss_dsi_mode mode;
389389 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
33213321
33223322 if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) {
33233323 int bpp = dsi_get_pixel_size(dsi->pix_fmt);
3324− struct omap_video_timings *timings = &dsi->timings;
3324+ struct videomode *vm = &dsi->vm;
33253325 /*
33263326 * Don't use line buffers if width is greater than the video
33273327 * port's line buffer size
33283328 */
3329− if (dsi->line_buffer_size <= timings->x_res * bpp / 8)
3329+ if (dsi->line_buffer_size <= vm->hactive * bpp / 8)
33303330 num_line_buffers = 0;
33313331 else
33323332 num_line_buffers = 2;
@@ -3453,7 +3453,7 @@ static void dsi_config_cmd_mode_interleaving(struct platform_device *dsidev) · 120 unmodified lines
34533453 int ddr_clk_pre, ddr_clk_post, enter_hs_mode_lat, exit_hs_mode_lat;
34543454 int tclk_trail, ths_exit, exiths_clk;
34553455 bool ddr_alwon;
3456− struct omap_video_timings *timings = &dsi->timings;
3456+ struct videomode *vm = &dsi->vm;
34573457 int bpp = dsi_get_pixel_size(dsi->pix_fmt);
34583458 int ndl = dsi->num_lanes_used - 1;
34593459 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
34943494
34953495 exiths_clk = ths_exit + tclk_trail;
34963496
3497− width_bytes = DIV_ROUND_UP(timings->x_res * bpp, 8);
3497+ width_bytes = DIV_ROUND_UP(vm->hactive * bpp, 8);
34983498 bllp = hbp + hfp + hsa + DIV_ROUND_UP(width_bytes + 6, ndl);
34993499
35003500 if (!hsa_blanking_mode) {
@@ -3705,7 +3705,7 @@ static void dsi_proto_timings(struct platform_device *dsidev) · 204 unmodified lines
37053705 int vbp = dsi->vm_timings.vbp;
37063706 int window_sync = dsi->vm_timings.window_sync;
37073707 bool hsync_end;
3708− struct omap_video_timings *timings = &dsi->timings;
3708+ struct videomode *vm = &dsi->vm;
37093709 int bpp = dsi_get_pixel_size(dsi->pix_fmt);
37103710 int tl, t_he, width_bytes;
37113711
@@ -3713,7 +3713,7 @@ static void dsi_proto_timings(struct platform_device *dsidev) · 1 unmodified line
37133713 t_he = hsync_end ?
37143714 ((hsa == 0 && ndl == 3) ? 1 : DIV_ROUND_UP(4, ndl)) : 0;
37153715
3716− width_bytes = DIV_ROUND_UP(timings->x_res * bpp, 8);
3716+ width_bytes = DIV_ROUND_UP(vm->hactive * bpp, 8);
37173717
37183718 /* TL = t_HS + HSA + t_HE + HFP + ceil((WC + 6) / NDL) + HBP */
37193719 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
37223722 DSSDBG("HBP: %d, HFP: %d, HSA: %d, TL: %d TXBYTECLKHS\n", hbp,
37233723 hfp, hsync_end ? hsa : 0, tl);
37243724 DSSDBG("VBP: %d, VFP: %d, VSA: %d, VACT: %d lines\n", vbp, vfp,
3725− vsa, timings->y_res);
3725+ vsa, vm->vactive);
37263726
37273727 r = dsi_read_reg(dsidev, DSI_VM_TIMING1);
37283728 r = FLD_MOD(r, hbp, 11, 0); /* HBP */
@@ -3738,7 +3738,7 @@ static void dsi_proto_timings(struct platform_device *dsidev) · 9 unmodified lines
37383738 dsi_write_reg(dsidev, DSI_VM_TIMING2, r);
37393739
37403740 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 */
37423742 r = FLD_MOD(r, tl, 31, 16); /* TL */
37433743 dsi_write_reg(dsidev, DSI_VM_TIMING3, r);
37443744 }
@@ -3856,7 +3856,7 @@ static int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel) · 111 unmodified lines
38563856 /* MODE, 1 = video mode */
38573857 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), 1, 4, 4);
38583858
3859− word_count = DIV_ROUND_UP(dsi->timings.x_res * bpp, 8);
3859+ word_count = DIV_ROUND_UP(dsi->vm.hactive * bpp, 8);
38603860
38613861 dsi_vc_write_long_header(dsidev, channel, data_type,
38623862 word_count, 0);
@@ -3918,8 +3918,8 @@ static void dsi_update_screen_dispc(struct platform_device *dsidev) · 55 unmodified lines
39183918 int r;
39193919 const unsigned channel = dsi->update_channel;
39203920 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;
39233923
39243924 DSSDBG("dsi_update_screen_dispc(%dx%d)\n", w, h);
39253925
@@ -3969,7 +3969,7 @@ static void dsi_update_screen_dispc(struct platform_device *dsidev) · 43 unmodified lines
39693969 msecs_to_jiffies(250));
39703970 BUG_ON(r == 0);
39713971
3972− dss_mgr_set_timings(dispc_channel, &dsi->timings);
3972+ dss_mgr_set_timings(dispc_channel, &dsi->vm);
39733973
39743974 dss_mgr_start_update(dispc_channel);
39753975
@@ -4056,8 +4056,8 @@ static int dsi_update(struct omap_dss_device *dssdev, int channel, · 80 unmodified lines
40564056 dsi->framedone_callback = callback;
40574057 dsi->framedone_data = data;
40584058
4059− dw = dsi->timings.x_res;
4060− dh = dsi->timings.y_res;
4059+ dw = dsi->vm.hactive;
4060+ dh = dsi->vm.vactive;
40614061
40624062 #ifdef DSI_PERF_MEASURE
40634063 dsi->update_bytes = dw * dh *
@@ -4120,16 +4120,21 @@ static int dsi_display_init_dispc(struct platform_device *dsidev, · 56 unmodified lines
41204120
41214121 /*
41224122 * override interlace, logic level and edge related parameters in
4123− * omap_video_timings with default values
4123+ * videomode with default values
41244124 */
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);
41334138
41344139 r = dsi_configure_dispc_clocks(dsidev);
41354140 if (r)
@@ -4331,7 +4336,7 @@ static void print_dsi_vm(const char *str, · 195 unmodified lines
43314336
43324337 wc = DIV_ROUND_UP(t->hact * t->bitspp, 8);
43334338 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;
43354340 tot = bl + pps;
43364341
43374342 #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
43404345 "%u/%u/%u/%u/%u/%u = %u + %u = %u\n",
43414346 str,
43424347 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,
43444349 bl, pps, tot,
43454350 TO_DSI_T(t->hss),
43464351 TO_DSI_T(t->hsa),
43474352 TO_DSI_T(t->hse),
43484353 TO_DSI_T(t->hbp),
43494354 TO_DSI_T(pps),
4350− TO_DSI_T(t->hfp),
4355+ TO_DSI_T(t->hfront_porch),
43514356
43524357 TO_DSI_T(bl),
43534358 TO_DSI_T(pps),
@@ -4356,13 +4361,13 @@ static void print_dsi_vm(const char *str, · 2 unmodified lines
43564361 #undef TO_DSI_T
43574362 }
43584363
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)
43604365 {
4361− unsigned long pck = t->pixelclock;
4366+ unsigned long pck = vm->pixelclock;
43624367 int hact, bl, tot;
43634368
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;
43664371 tot = hact + bl;
43674372
43684373 #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
43714376 "%u/%u/%u/%u = %u + %u = %u\n",
43724377 str,
43734378 pck,
4374− t->hsw, t->hbp, hact, t->hfp,
4379+ vm->hsync_len, vm->hbp, hact, vm->hfront_porch,
43754380 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),
43784383 TO_DISPC_T(hact),
4379− TO_DISPC_T(t->hfp),
4384+ TO_DISPC_T(vm->hfront_porch),
43804385 TO_DISPC_T(bl),
43814386 TO_DISPC_T(hact),
43824387 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
43874392 static void print_dsi_dispc_vm(const char *str,
43884393 const struct omap_dss_dsi_videomode_timings *t)
43894394 {
4390− struct omap_video_timings vm = { 0 };
4395+ struct videomode vm = { 0 };
43914396 unsigned long byteclk = t->hsclk / 4;
43924397 unsigned long pck;
43934398 u64 dsi_tput;
@@ -4396,13 +4401,13 @@ static void print_dsi_dispc_vm(const char *str, · 2 unmodified lines
43964401 dsi_tput = (u64)byteclk * t->ndl * 8;
43974402 pck = (u32)div64_u64(dsi_tput, t->bitspp);
43984403 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;
44004405
44014406 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);
44034408 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;
44064411
44074412 print_dispc_vm(str, &vm);
44084413 }
@@ -4412,19 +4417,19 @@ static bool dsi_cm_calc_dispc_cb(int lckd, int pckd, unsigned long lck, · 3 unmodified lines
44124417 unsigned long pck, void *data)
44134418 {
44144419 struct dsi_clk_calc_ctx *ctx = data;
4415− struct omap_video_timings *t = &ctx->dispc_vm;
4420+ struct videomode *vm = &ctx->vm;
44164421
44174422 ctx->dispc_cinfo.lck_div = lckd;
44184423 ctx->dispc_cinfo.pck_div = pckd;
44194424 ctx->dispc_cinfo.lck = lck;
44204425 ctx->dispc_cinfo.pck = pck;
44214426
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;
44284433
44294434 return true;
44304435 }
@@ -4475,7 +4480,7 @@ static bool dsi_cm_calc(struct dsi_data *dsi, · 44 unmodified lines
44754480 * especially as we go to LP between each pixel packet due to HW
44764481 * "feature". So let's just estimate very roughly and multiply by 1.5.
44774482 */
4478− pck = cfg->timings->pixelclock;
4483+ pck = cfg->vm->pixelclock;
44794484 pck = pck * 3 / 2;
44804485 txbyteclk = pck * bitspp / 8 / ndl;
44814486
@@ -4510,14 +4515,14 @@ static bool dsi_vm_calc_blanking(struct dsi_clk_calc_ctx *ctx) · 28 unmodified lines
45104515 int dispc_htot, dispc_hbl; /* pixels */
45114516 int dsi_htot, dsi_hact, dsi_hbl, hss, hse; /* byteclks */
45124517 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;
45154520 struct omap_dss_dsi_videomode_timings *dsi_vm;
45164521 u64 dsi_tput, dispc_tput;
45174522
45184523 dsi_tput = (u64)byteclk * ndl * 8;
45194524
4520− req_vm = cfg->timings;
4525+ req_vm = cfg->vm;
45214526 req_pck_min = ctx->req_pck_min;
45224527 req_pck_max = ctx->req_pck_max;
45234528 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
45254530 dispc_pck = ctx->dispc_cinfo.pck;
45264531 dispc_tput = (u64)dispc_pck * bitspp;
45274532
4528− xres = req_vm->x_res;
4533+ xres = req_vm->hactive;
45294534
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;
45314537 panel_htot = xres + panel_hbl;
45324538
45334539 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
45574563 hss = DIV_ROUND_UP(4, ndl);
45584564
45594565 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)
45614567 hse = 1;
45624568 else
45634569 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
45964602
45974603 if (cfg->trans_mode != OMAP_DSS_DSI_PULSE_MODE) {
45984604 hsa = 0;
4599− } else if (ndl == 3 && req_vm->hsw == 0) {
4605+ } else if (ndl == 3 && req_vm->hsync_len == 0) {
46004606 hsa = 0;
46014607 } 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);
46034609 hsa = max(hsa - hse, 1);
46044610 }
46054611
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);
46074613 hbp = max(hbp, 1);
46084614
46094615 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
46334639 dsi_vm->hact = xres;
46344640 dsi_vm->hfp = hfp;
46354641
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;
46404646
46414647 dsi_vm->trans_mode = cfg->trans_mode;
46424648
@@ -4650,19 +4656,19 @@ static bool dsi_vm_calc_blanking(struct dsi_clk_calc_ctx *ctx) · 7 unmodified lines
46504656
46514657 /* setup DISPC videomode */
46524658
4653− dispc_vm = &ctx->dispc_vm;
4659+ dispc_vm = &ctx->vm;
46544660 *dispc_vm = *req_vm;
46554661 dispc_vm->pixelclock = dispc_pck;
46564662
46574663 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,
46594665 req_pck_nom);
46604666 hsa = max(hsa, 1);
46614667 } else {
46624668 hsa = 1;
46634669 }
46644670
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);
46664672 hbp = max(hbp, 1);
46674673
46684674 hfp = dispc_hbl - hsa - hbp;
@@ -4685,9 +4691,9 @@ static bool dsi_vm_calc_blanking(struct dsi_clk_calc_ctx *ctx) · 16 unmodified lines
46854691 if (hfp < 1)
46864692 return false;
46874693
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;
46914697
46924698 return true;
46934699 }
@@ -4707,9 +4713,9 @@ static bool dsi_vm_calc_dispc_cb(int lckd, int pckd, unsigned long lck, · 13 unmodified lines
47074713 return false;
47084714
47094715 #ifdef PRINT_VERBOSE_VM_TIMINGS
4710− print_dispc_vm("dispc", &ctx->dispc_vm);
4716+ print_dispc_vm("dispc", &ctx->vm);
47114717 print_dsi_vm("dsi ", &ctx->dsi_vm);
4712− print_dispc_vm("req ", ctx->config->timings);
4718+ print_dispc_vm("req ", ctx->config->vm);
47134719 print_dsi_dispc_vm("act ", &ctx->dsi_vm);
47144720 #endif
47154721
@@ -4758,7 +4764,7 @@ static bool dsi_vm_calc(struct dsi_data *dsi, · 42 unmodified lines
47584764 const struct omap_dss_dsi_config *cfg,
47594765 struct dsi_clk_calc_ctx *ctx)
47604766 {
4761− const struct omap_video_timings *t = cfg->timings;
4767+ const struct videomode *vm = cfg->vm;
47624768 unsigned long clkin;
47634769 unsigned long pll_min;
47644770 unsigned long pll_max;
@@ -4774,9 +4780,9 @@ static bool dsi_vm_calc(struct dsi_data *dsi, · 9 unmodified lines
47744780 ctx->config = cfg;
47754781
47764782 /* 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;
47804786
47814787 byteclk_min = div64_u64((u64)ctx->req_pck_min * bitspp, ndl * 8);
47824788 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
48334839 dsi->user_dsi_cinfo = ctx.dsi_cinfo;
48344840 dsi->user_dispc_cinfo = ctx.dispc_cinfo;
48354841
4836− dsi->timings = ctx.dispc_vm;
4842+ dsi->vm = ctx.vm;
48374843 dsi->vm_timings = ctx.dsi_vm;
48384844
48394845 mutex_unlock(&dsi->lock);
@@ -5342,7 +5348,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data) · 502 unmodified lines
53425348
53435349 dsi->phy_base = devm_ioremap(&dsidev->dev, res->start,
53445350 resource_size(res));
5345− if (!dsi->proto_base) {
5351+ if (!dsi->phy_base) {
53465352 DSSERR("can't ioremap DSI PHY\n");
53475353 return -ENOMEM;
53485354 }
@@ -5362,7 +5368,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data) · 13 unmodified lines
53625368
53635369 dsi->pll_base = devm_ioremap(&dsidev->dev, res->start,
53645370 resource_size(res));
5365− if (!dsi->proto_base) {
5371+ if (!dsi->pll_base) {
53665372 DSSERR("can't ioremap DSI PLL\n");
53675373 return -ENOMEM;
53685374 }
drivers/gpu/drm/omapdrm/dss/dss.h+2−3
@@ -366,8 +366,7 @@ bool dispc_div_calc(unsigned long dispc, · 365 unmodified lines
366366 unsigned long pck_min, unsigned long pck_max,
367367 dispc_div_calc_func func, void *data);
368368
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);
371370 int dispc_calc_clock_rates(unsigned long dispc_fclk_rate,
372371 struct dispc_clock_info *cinfo);
373372
@@ -390,7 +389,7 @@ void dispc_wb_enable(bool enable); · 16 unmodified lines
390389 bool dispc_wb_is_enabled(void);
391390 void dispc_wb_set_channel_in(enum dss_writeback_channel channel);
392391 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);
394393
395394 /* VENC */
396395 int venc_init_platform_driver(void) __init;
drivers/gpu/drm/omapdrm/dss/hdmi.h+4−4
@@ -181,7 +181,7 @@ struct hdmi_video_format { · 180 unmodified lines
181181 };
182182
183183 struct hdmi_config {
184− struct omap_video_timings timings;
184+ struct videomode vm;
185185 struct hdmi_avi_infoframe infoframe;
186186 enum hdmi_core_hdmi_dvi hdmi_dvi_mode;
187187 };
@@ -298,11 +298,11 @@ int hdmi_wp_set_pll_pwr(struct hdmi_wp_data *wp, enum hdmi_pll_pwr val); · 110 unmodified lines
298298 void hdmi_wp_video_config_format(struct hdmi_wp_data *wp,
299299 struct hdmi_video_format *video_fmt);
300300 void hdmi_wp_video_config_interface(struct hdmi_wp_data *wp,
301− struct omap_video_timings *timings);
301+ struct videomode *vm);
302302 void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp,
303− struct omap_video_timings *timings);
303+ struct videomode *vm);
304304 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);
306306 int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp);
307307 phys_addr_t hdmi_wp_get_audio_dma_addr(struct hdmi_wp_data *wp);
308308
drivers/gpu/drm/omapdrm/dss/hdmi4.c+16−15
@@ -155,7 +155,7 @@ static void hdmi_power_off_core(struct omap_dss_device *dssdev) · 154 unmodified lines
155155 static int hdmi_power_on_full(struct omap_dss_device *dssdev)
156156 {
157157 int r;
158− struct omap_video_timings *p;
158+ struct videomode *vm;
159159 enum omap_channel channel = dssdev->dispc_channel;
160160 struct hdmi_wp_data *wp = &hdmi.wp;
161161 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
169169 hdmi_wp_clear_irqenable(wp, 0xffffffff);
170170 hdmi_wp_set_irqstatus(wp, 0xffffffff);
171171
172− p = &hdmi.cfg.timings;
172+ vm = &hdmi.cfg.vm;
173173
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);
175176
176− pc = p->pixelclock;
177− if (p->double_pixel)
177+ pc = vm->pixelclock;
178+ if (vm->flags & DISPLAY_FLAGS_DOUBLECLK)
178179 pc *= 2;
179180
180181 /* DSS_HDMI_TCLK is bitclk / 10 */
@@ -209,7 +210,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev) · 28 unmodified lines
209210 hdmi4_configure(&hdmi.core, &hdmi.wp, &hdmi.cfg);
210211
211212 /* tv size */
212− dss_mgr_set_timings(channel, p);
213+ dss_mgr_set_timings(channel, vm);
213214
214215 r = dss_mgr_enable(channel);
215216 if (r)
@@ -255,30 +256,30 @@ static void hdmi_power_off_full(struct omap_dss_device *dssdev) · 39 unmodified lines
255256 }
256257
257258 static int hdmi_display_check_timing(struct omap_dss_device *dssdev,
258− struct omap_video_timings *timings)
259+ struct videomode *vm)
259260 {
260− if (!dispc_mgr_timings_ok(dssdev->dispc_channel, timings))
261+ if (!dispc_mgr_timings_ok(dssdev->dispc_channel, vm))
261262 return -EINVAL;
262263
263264 return 0;
264265 }
265266
266267 static void hdmi_display_set_timing(struct omap_dss_device *dssdev,
267− struct omap_video_timings *timings)
268+ struct videomode *vm)
268269 {
269270 mutex_lock(&hdmi.lock);
270271
271− hdmi.cfg.timings = *timings;
272+ hdmi.cfg.vm = *vm;
272273
273− dispc_set_tv_pclk(timings->pixelclock);
274+ dispc_set_tv_pclk(vm->pixelclock);
274275
275276 mutex_unlock(&hdmi.lock);
276277 }
277278
278279 static void hdmi_display_get_timings(struct omap_dss_device *dssdev,
279− struct omap_video_timings *timings)
280+ struct videomode *vm)
280281 {
281− *timings = hdmi.cfg.timings;
282+ *vm = hdmi.cfg.vm;
282283 }
283284
284285 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
352353
353354 if (hdmi.audio_configured) {
354355 r = hdmi4_audio_config(&hdmi.core, &hdmi.wp, &hdmi.audio_config,
355− hdmi.cfg.timings.pixelclock);
356+ hdmi.cfg.vm.pixelclock);
356357 if (r) {
357358 DSSERR("Error restoring audio configuration: %d", r);
358359 hdmi.audio_abort_cb(&hdmi.pdev->dev);
@@ -643,7 +644,7 @@ static int hdmi_audio_config(struct device *dev, · 284 unmodified lines
643644 }
644645
645646 ret = hdmi4_audio_config(&hd->core, &hd->wp, dss_audio,
646− hd->cfg.timings.pixelclock);
647+ hd->cfg.vm.pixelclock);
647648 if (!ret) {
648649 hd->audio_configured = true;
649650 hd->audio_config = *dss_audio;
drivers/gpu/drm/omapdrm/dss/hdmi4_core.c+4−4
@@ -310,7 +310,7 @@ void hdmi4_configure(struct hdmi_core_data *core, · 309 unmodified lines
310310 struct hdmi_wp_data *wp, struct hdmi_config *cfg)
311311 {
312312 /* HDMI */
313− struct omap_video_timings video_timing;
313+ struct videomode vm;
314314 struct hdmi_video_format video_format;
315315 /* HDMI core */
316316 struct hdmi_core_video_config v_core_cfg;
@@ -318,16 +318,16 @@ void hdmi4_configure(struct hdmi_core_data *core, · 1 unmodified line
318318
319319 hdmi_core_init(&v_core_cfg);
320320
321− hdmi_wp_init_vid_fmt_timings(&video_format, &video_timing, cfg);
321+ hdmi_wp_init_vid_fmt_timings(&video_format, &vm, cfg);
322322
323− hdmi_wp_video_config_timing(wp, &video_timing);
323+ hdmi_wp_video_config_timing(wp, &vm);
324324
325325 /* video config */
326326 video_format.packing_mode = HDMI_PACK_24b_RGB_YUV444_YUV422;
327327
328328 hdmi_wp_video_config_format(wp, &video_format);
329329
330− hdmi_wp_video_config_interface(wp, &video_timing);
330+ hdmi_wp_video_config_interface(wp, &vm);
331331
332332 /*
333333 * configure core video part
drivers/gpu/drm/omapdrm/dss/hdmi5.c+16−15
@@ -172,7 +172,7 @@ static void hdmi_power_off_core(struct omap_dss_device *dssdev) · 171 unmodified lines
172172 static int hdmi_power_on_full(struct omap_dss_device *dssdev)
173173 {
174174 int r;
175− struct omap_video_timings *p;
175+ struct videomode *vm;
176176 enum omap_channel channel = dssdev->dispc_channel;
177177 struct dss_pll_clock_info hdmi_cinfo = { 0 };
178178 unsigned pc;
@@ -181,12 +181,13 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev) · 2 unmodified lines
181181 if (r)
182182 return r;
183183
184− p = &hdmi.cfg.timings;
184+ vm = &hdmi.cfg.vm;
185185
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);
187188
188− pc = p->pixelclock;
189− if (p->double_pixel)
189+ pc = vm->pixelclock;
190+ if (vm->flags & DISPLAY_FLAGS_DOUBLECLK)
190191 pc *= 2;
191192
192193 /* DSS_HDMI_TCLK is bitclk / 10 */
@@ -226,7 +227,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev) · 33 unmodified lines
226227 hdmi5_configure(&hdmi.core, &hdmi.wp, &hdmi.cfg);
227228
228229 /* tv size */
229− dss_mgr_set_timings(channel, p);
230+ dss_mgr_set_timings(channel, vm);
230231
231232 r = dss_mgr_enable(channel);
232233 if (r)
@@ -272,30 +273,30 @@ static void hdmi_power_off_full(struct omap_dss_device *dssdev) · 39 unmodified lines
272273 }
273274
274275 static int hdmi_display_check_timing(struct omap_dss_device *dssdev,
275− struct omap_video_timings *timings)
276+ struct videomode *vm)
276277 {
277− if (!dispc_mgr_timings_ok(dssdev->dispc_channel, timings))
278+ if (!dispc_mgr_timings_ok(dssdev->dispc_channel, vm))
278279 return -EINVAL;
279280
280281 return 0;
281282 }
282283
283284 static void hdmi_display_set_timing(struct omap_dss_device *dssdev,
284− struct omap_video_timings *timings)
285+ struct videomode *vm)
285286 {
286287 mutex_lock(&hdmi.lock);
287288
288− hdmi.cfg.timings = *timings;
289+ hdmi.cfg.vm = *vm;
289290
290− dispc_set_tv_pclk(timings->pixelclock);
291+ dispc_set_tv_pclk(vm->pixelclock);
291292
292293 mutex_unlock(&hdmi.lock);
293294 }
294295
295296 static void hdmi_display_get_timings(struct omap_dss_device *dssdev,
296− struct omap_video_timings *timings)
297+ struct videomode *vm)
297298 {
298− *timings = hdmi.cfg.timings;
299+ *vm = hdmi.cfg.vm;
299300 }
300301
301302 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
378379
379380 if (hdmi.audio_configured) {
380381 r = hdmi5_audio_config(&hdmi.core, &hdmi.wp, &hdmi.audio_config,
381− hdmi.cfg.timings.pixelclock);
382+ hdmi.cfg.vm.pixelclock);
382383 if (r) {
383384 DSSERR("Error restoring audio configuration: %d", r);
384385 hdmi.audio_abort_cb(&hdmi.pdev->dev);
@@ -669,7 +670,7 @@ static int hdmi_audio_config(struct device *dev, · 284 unmodified lines
669670 }
670671
671672 ret = hdmi5_audio_config(&hd->core, &hd->wp, dss_audio,
672− hd->cfg.timings.pixelclock);
673+ hd->cfg.vm.pixelclock);
673674
674675 if (!ret) {
675676 hd->audio_configured = true;
drivers/gpu/drm/omapdrm/dss/hdmi5_core.c+39−46
@@ -292,35 +292,35 @@ static void hdmi_core_init(struct hdmi_core_vid_config *video_cfg, · 291 unmodified lines
292292 {
293293 DSSDBG("hdmi_core_init\n");
294294
295− video_cfg->v_fc_config.timings = cfg->timings;
295+ video_cfg->v_fc_config.vm = cfg->vm;
296296
297297 /* video core */
298298 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;
301301 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;
304304 video_cfg->v_fc_config.hdmi_dvi_mode = cfg->hdmi_dvi_mode;
305305
306− if (cfg->timings.interlace) {
306+ if (cfg->vm.flags & DISPLAY_FLAGS_INTERLACED) {
307307 /* set vblank_osc if vblank is fractional */
308308 if (video_cfg->vblank % 2 != 0)
309309 video_cfg->vblank_osc = 1;
310310
311− video_cfg->v_fc_config.timings.y_res /= 2;
311+ video_cfg->v_fc_config.vm.vactive /= 2;
312312 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;
316316 }
317317
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;
320320 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;
324324 }
325325 }
326326
@@ -329,13 +329,12 @@ static void hdmi_core_video_config(struct hdmi_core_data *core, · 2 unmodified lines
329329 struct hdmi_core_vid_config *cfg)
330330 {
331331 void __iomem *base = core->base;
332+ struct videomode *vm = &cfg->v_fc_config.vm;
332333 unsigned char r = 0;
333334 bool vsync_pol, hsync_pol;
334335
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);
339338
340339 /* Set hsync, vsync and data-enable polarity */
341340 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
343342 r = FLD_MOD(r, hsync_pol, 5, 5);
344343 r = FLD_MOD(r, cfg->data_enable_pol, 4, 4);
345344 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);
347346 hdmi_write_reg(base, HDMI_CORE_FC_INVIDCONF, r);
348347
349348 /* 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);
354351
355352 /* 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);
360355
361356 /* set horizontal blanking pixels */
362357 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
366361 REG_FLD_MOD(base, HDMI_CORE_FC_INVBLANK, cfg->vblank, 7, 0);
367362
368363 /* 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);
373368
374369 /* 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);
377371
378372 /* 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);
383377
384378 /* 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);
387380
388381 /* select DVI mode */
389382 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);
391384
392− if (cfg->v_fc_config.timings.double_pixel)
385+ if (vm->flags & DISPLAY_FLAGS_DOUBLECLK)
393386 REG_FLD_MOD(base, HDMI_CORE_FC_PRCONF, 2, 7, 4);
394387 else
395388 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
616609 void hdmi5_configure(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
617610 struct hdmi_config *cfg)
618611 {
619− struct omap_video_timings video_timing;
612+ struct videomode vm;
620613 struct hdmi_video_format video_format;
621614 struct hdmi_core_vid_config v_core_cfg;
622615
@@ -624,16 +617,16 @@ void hdmi5_configure(struct hdmi_core_data *core, struct hdmi_wp_data *wp, · 1 unmodified line
624617
625618 hdmi_core_init(&v_core_cfg, cfg);
626619
627− hdmi_wp_init_vid_fmt_timings(&video_format, &video_timing, cfg);
620+ hdmi_wp_init_vid_fmt_timings(&video_format, &vm, cfg);
628621
629− hdmi_wp_video_config_timing(wp, &video_timing);
622+ hdmi_wp_video_config_timing(wp, &vm);
630623
631624 /* video config */
632625 video_format.packing_mode = HDMI_PACK_24b_RGB_YUV444_YUV422;
633626
634627 hdmi_wp_video_config_format(wp, &video_format);
635628
636− hdmi_wp_video_config_interface(wp, &video_timing);
629+ hdmi_wp_video_config_interface(wp, &vm);
637630
638631 /* support limited range with 24 bit color depth for now */
639632 hdmi_core_configure_range(core);
drivers/gpu/drm/omapdrm/dss/hdmi_wp.c+35−38
@@ -144,87 +144,84 @@ void hdmi_wp_video_config_format(struct hdmi_wp_data *wp, · 143 unmodified lines
144144 }
145145
146146 void hdmi_wp_video_config_interface(struct hdmi_wp_data *wp,
147− struct omap_video_timings *timings)
147+ struct videomode *vm)
148148 {
149149 u32 r;
150150 bool vsync_pol, hsync_pol;
151151 DSSDBG("Enter hdmi_wp_video_config_interface\n");
152152
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);
155155
156156 r = hdmi_read_reg(wp->base, HDMI_WP_VIDEO_CFG);
157157 r = FLD_MOD(r, vsync_pol, 7, 7);
158158 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);
160160 r = FLD_MOD(r, 1, 1, 0); /* HDMI_TIMING_MASTER_24BIT */
161161 hdmi_write_reg(wp->base, HDMI_WP_VIDEO_CFG, r);
162162 }
163163
164164 void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp,
165− struct omap_video_timings *timings)
165+ struct videomode *vm)
166166 {
167167 u32 timing_h = 0;
168168 u32 timing_v = 0;
169− unsigned hsw_offset = 1;
169+ unsigned hsync_len_offset = 1;
170170
171171 DSSDBG("Enter hdmi_wp_video_config_timing\n");
172172
173173 /*
174174 * 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.
176176 * However, we don't support OMAP5 ES1 at all, so we can just check for
177177 * OMAP4 here.
178178 */
179179 if (omapdss_get_version() == OMAPDSS_VER_OMAP4430_ES1 ||
180180 omapdss_get_version() == OMAPDSS_VER_OMAP4430_ES2 ||
181181 omapdss_get_version() == OMAPDSS_VER_OMAP4)
182− hsw_offset = 0;
182+ hsync_len_offset = 0;
183183
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);
187187 hdmi_write_reg(wp->base, HDMI_WP_VIDEO_TIMING_H, timing_h);
188188
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);
192192 hdmi_write_reg(wp->base, HDMI_WP_VIDEO_TIMING_V, timing_v);
193193 }
194194
195195 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)
197197 {
198198 DSSDBG("Enter hdmi_wp_video_init_format\n");
199199
200200 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) {
217214 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;
221218 }
222219
223− if (param->timings.double_pixel) {
220+ if (param->vm.flags & DISPLAY_FLAGS_DOUBLECLK) {
224221 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;
228225 }
229226 }
230227
drivers/gpu/drm/omapdrm/dss/omapdss.h+28−70
@@ -290,7 +290,7 @@ struct omap_dss_dsi_videomode_timings { · 289 unmodified lines
290290 struct omap_dss_dsi_config {
291291 enum omap_dss_dsi_mode mode;
292292 enum omap_dss_dsi_pixel_format pixel_format;
293− const struct omap_video_timings *timings;
293+ const struct videomode *vm;
294294
295295 unsigned long hs_clk_min, hs_clk_max;
296296 unsigned long lp_clk_min, lp_clk_max;
@@ -299,48 +299,12 @@ struct omap_dss_dsi_config { · 2 unmodified lines
299299 enum omap_dss_dsi_trans_mode trans_mode;
300300 };
301301
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
339303 * identify the mode, and does not actually use the configs
340304 * itself. However, the configs should be something that
341305 * 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;
344308
345309 struct omap_dss_cpr_coefs {
346310 s16 rr, rg, rb;
@@ -502,11 +466,11 @@ struct omapdss_dpi_ops { · 155 unmodified lines
502466 void (*disable)(struct omap_dss_device *dssdev);
503467
504468 int (*check_timings)(struct omap_dss_device *dssdev,
505− struct omap_video_timings *timings);
469+ struct videomode *vm);
506470 void (*set_timings)(struct omap_dss_device *dssdev,
507− struct omap_video_timings *timings);
471+ struct videomode *vm);
508472 void (*get_timings)(struct omap_dss_device *dssdev,
509− struct omap_video_timings *timings);
473+ struct videomode *vm);
510474
511475 void (*set_data_lines)(struct omap_dss_device *dssdev, int data_lines);
512476 };
@@ -521,11 +485,11 @@ struct omapdss_sdi_ops { · 8 unmodified lines
521485 void (*disable)(struct omap_dss_device *dssdev);
522486
523487 int (*check_timings)(struct omap_dss_device *dssdev,
524− struct omap_video_timings *timings);
488+ struct videomode *vm);
525489 void (*set_timings)(struct omap_dss_device *dssdev,
526− struct omap_video_timings *timings);
490+ struct videomode *vm);
527491 void (*get_timings)(struct omap_dss_device *dssdev,
528− struct omap_video_timings *timings);
492+ struct videomode *vm);
529493
530494 void (*set_datapairs)(struct omap_dss_device *dssdev, int datapairs);
531495 };
@@ -540,11 +504,11 @@ struct omapdss_dvi_ops { · 8 unmodified lines
540504 void (*disable)(struct omap_dss_device *dssdev);
541505
542506 int (*check_timings)(struct omap_dss_device *dssdev,
543− struct omap_video_timings *timings);
507+ struct videomode *vm);
544508 void (*set_timings)(struct omap_dss_device *dssdev,
545− struct omap_video_timings *timings);
509+ struct videomode *vm);
546510 void (*get_timings)(struct omap_dss_device *dssdev,
547− struct omap_video_timings *timings);
511+ struct videomode *vm);
548512 };
549513
550514 struct omapdss_atv_ops {
@@ -557,11 +521,11 @@ struct omapdss_atv_ops { · 6 unmodified lines
557521 void (*disable)(struct omap_dss_device *dssdev);
558522
559523 int (*check_timings)(struct omap_dss_device *dssdev,
560− struct omap_video_timings *timings);
524+ struct videomode *vm);
561525 void (*set_timings)(struct omap_dss_device *dssdev,
562− struct omap_video_timings *timings);
526+ struct videomode *vm);
563527 void (*get_timings)(struct omap_dss_device *dssdev,
564− struct omap_video_timings *timings);
528+ struct videomode *vm);
565529
566530 void (*set_type)(struct omap_dss_device *dssdev,
567531 enum omap_dss_venc_type type);
@@ -582,11 +546,11 @@ struct omapdss_hdmi_ops { · 14 unmodified lines
582546 void (*disable)(struct omap_dss_device *dssdev);
583547
584548 int (*check_timings)(struct omap_dss_device *dssdev,
585− struct omap_video_timings *timings);
549+ struct videomode *vm);
586550 void (*set_timings)(struct omap_dss_device *dssdev,
587− struct omap_video_timings *timings);
551+ struct videomode *vm);
588552 void (*get_timings)(struct omap_dss_device *dssdev,
589− struct omap_video_timings *timings);
553+ struct videomode *vm);
590554
591555 int (*read_edid)(struct omap_dss_device *dssdev, u8 *buf, int len);
592556 bool (*detect)(struct omap_dss_device *dssdev);
@@ -692,7 +656,7 @@ struct omap_dss_device { · 99 unmodified lines
692656 } phy;
693657
694658 struct {
695− struct omap_video_timings timings;
659+ struct videomode vm;
696660
697661 enum omap_dss_dsi_pixel_format dsi_pix_fmt;
698662 enum omap_dss_dsi_mode dsi_mode;
@@ -785,11 +749,11 @@ struct omap_dss_driver { · 86 unmodified lines
785749 int (*get_recommended_bpp)(struct omap_dss_device *dssdev);
786750
787751 int (*check_timings)(struct omap_dss_device *dssdev,
788− struct omap_video_timings *timings);
752+ struct videomode *vm);
789753 void (*set_timings)(struct omap_dss_device *dssdev,
790− struct omap_video_timings *timings);
754+ struct videomode *vm);
791755 void (*get_timings)(struct omap_dss_device *dssdev,
792− struct omap_video_timings *timings);
756+ struct videomode *vm);
793757
794758 int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
795759 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
819783 int (*match)(struct omap_dss_device *dssdev, void *data));
820784 const char *omapdss_get_default_display_name(void);
821785
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−
827786 int dss_feat_get_num_mgrs(void);
828787 int dss_feat_get_num_ovls(void);
829788 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
852811 u16 *xres, u16 *yres);
853812 int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev);
854813 void omapdss_default_get_timings(struct omap_dss_device *dssdev,
855− struct omap_video_timings *timings);
814+ struct videomode *vm);
856815
857816 typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
858817 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
906865 void dispc_mgr_set_lcd_config(enum omap_channel channel,
907866 const struct dss_lcd_mgr_config *config);
908867 void dispc_mgr_set_timings(enum omap_channel channel,
909− const struct omap_video_timings *timings);
868+ const struct videomode *vm);
910869 void dispc_mgr_setup(enum omap_channel channel,
911870 const struct omap_overlay_manager_info *info);
912871 u32 dispc_mgr_gamma_size(enum omap_channel channel);
@@ -919,8 +878,7 @@ bool dispc_ovl_enabled(enum omap_plane plane); · 6 unmodified lines
919878 void dispc_ovl_set_channel_out(enum omap_plane plane,
920879 enum omap_channel channel);
921880 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);
924882
925883 enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel channel);
926884
@@ -934,7 +892,7 @@ struct dss_mgr_ops { · 7 unmodified lines
934892 int (*enable)(enum omap_channel channel);
935893 void (*disable)(enum omap_channel channel);
936894 void (*set_timings)(enum omap_channel channel,
937− const struct omap_video_timings *timings);
895+ const struct videomode *vm);
938896 void (*set_lcd_config)(enum omap_channel channel,
939897 const struct dss_lcd_mgr_config *config);
940898 int (*register_framedone_handler)(enum omap_channel channel,
@@ -951,7 +909,7 @@ int dss_mgr_connect(enum omap_channel channel, · 10 unmodified lines
951909 void dss_mgr_disconnect(enum omap_channel channel,
952910 struct omap_dss_device *dst);
953911 void dss_mgr_set_timings(enum omap_channel channel,
954− const struct omap_video_timings *timings);
912+ const struct videomode *vm);
955913 void dss_mgr_set_lcd_config(enum omap_channel channel,
956914 const struct dss_lcd_mgr_config *config);
957915 int dss_mgr_enable(enum omap_channel channel);
drivers/gpu/drm/omapdrm/dss/output.c+2−3
@@ -201,10 +201,9 @@ void dss_mgr_disconnect(enum omap_channel channel, · 200 unmodified lines
201201 }
202202 EXPORT_SYMBOL(dss_mgr_disconnect);
203203
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)
206205 {
207− dss_mgr_ops->set_timings(channel, timings);
206+ dss_mgr_ops->set_timings(channel, vm);
208207 }
209208 EXPORT_SYMBOL(dss_mgr_set_timings);
210209
drivers/gpu/drm/omapdrm/dss/rfbi.c+27−22
@@ -113,7 +113,7 @@ static struct { · 112 unmodified lines
113113
114114 struct semaphore bus_lock;
115115
116− struct omap_video_timings timings;
116+ struct videomode vm;
117117 int pixel_size;
118118 int data_lines;
119119 struct rfbi_timings intf_timings;
@@ -308,15 +308,15 @@ static int rfbi_transfer_area(struct omap_dss_device *dssdev, · 188 unmodified lines
308308 u32 l;
309309 int r;
310310 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;
313313
314314 /*BUG_ON(callback == 0);*/
315315 BUG_ON(rfbi.framedone_callback != NULL);
316316
317317 DSSDBG("rfbi_transfer_area %dx%d\n", width, height);
318318
319− dss_mgr_set_timings(mgr, &rfbi.timings);
319+ dss_mgr_set_timings(mgr, &rfbi.vm);
320320
321321 r = dss_mgr_enable(mgr);
322322 if (r)
@@ -777,8 +777,8 @@ static int rfbi_update(struct omap_dss_device *dssdev, void (*callback)(void *), · 454 unmodified lines
777777
778778 static void rfbi_set_size(struct omap_dss_device *dssdev, u16 w, u16 h)
779779 {
780− rfbi.timings.x_res = w;
781− rfbi.timings.y_res = h;
780+ rfbi.vm.hactive = w;
781+ rfbi.vm.vactive = h;
782782 }
783783
784784 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
854854 dss_mgr_set_lcd_config(mgr, &mgr_config);
855855
856856 /*
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
858858 * are expected to be already configured by the panel driver via
859859 * omapdss_rfbi_set_size()
860860 */
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);
876881 }
877882
878883 static int rfbi_display_enable(struct omap_dss_device *dssdev)
drivers/gpu/drm/omapdrm/dss/sdi.c+16−17
@@ -39,7 +39,7 @@ static struct { · 38 unmodified lines
3939 struct regulator *vdds_sdi_reg;
4040
4141 struct dss_lcd_mgr_config mgr_config;
42− struct omap_video_timings timings;
42+ struct videomode vm;
4343 int datapairs;
4444
4545 struct omap_dss_device output;
@@ -131,7 +131,7 @@ static int sdi_display_enable(struct omap_dss_device *dssdev) · 85 unmodified lines
131131 {
132132 struct omap_dss_device *out = &sdi.output;
133133 enum omap_channel channel = dssdev->dispc_channel;
134− struct omap_video_timings *t = &sdi.timings;
134+ struct videomode *vm = &sdi.vm;
135135 unsigned long fck;
136136 struct dispc_clock_info dispc_cinfo;
137137 unsigned long pck;
@@ -151,10 +151,9 @@ static int sdi_display_enable(struct omap_dss_device *dssdev) · 13 unmodified lines
151151 goto err_get_dispc;
152152
153153 /* 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;
156155
157− r = sdi_calc_clock_div(t->pixelclock, &fck, &dispc_cinfo);
156+ r = sdi_calc_clock_div(vm->pixelclock, &fck, &dispc_cinfo);
158157 if (r)
159158 goto err_calc_clock_div;
160159
@@ -162,15 +161,15 @@ static int sdi_display_enable(struct omap_dss_device *dssdev) · 1 unmodified line
162161
163162 pck = fck / dispc_cinfo.lck_div / dispc_cinfo.pck_div;
164163
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);
168167
169− t->pixelclock = pck;
168+ vm->pixelclock = pck;
170169 }
171170
172171
173− dss_mgr_set_timings(channel, t);
172+ dss_mgr_set_timings(channel, vm);
174173
175174 r = dss_set_fck_rate(fck);
176175 if (r)
@@ -229,26 +228,26 @@ static void sdi_display_disable(struct omap_dss_device *dssdev) · 52 unmodified lines
229228 }
230229
231230 static void sdi_set_timings(struct omap_dss_device *dssdev,
232− struct omap_video_timings *timings)
231+ struct videomode *vm)
233232 {
234− sdi.timings = *timings;
233+ sdi.vm = *vm;
235234 }
236235
237236 static void sdi_get_timings(struct omap_dss_device *dssdev,
238− struct omap_video_timings *timings)
237+ struct videomode *vm)
239238 {
240− *timings = sdi.timings;
239+ *vm = sdi.vm;
241240 }
242241
243242 static int sdi_check_timings(struct omap_dss_device *dssdev,
244− struct omap_video_timings *timings)
243+ struct videomode *vm)
245244 {
246245 enum omap_channel channel = dssdev->dispc_channel;
247246
248− if (!dispc_mgr_timings_ok(channel, timings))
247+ if (!dispc_mgr_timings_ok(channel, vm))
249248 return -EINVAL;
250249
251− if (timings->pixelclock == 0)
250+ if (vm->pixelclock == 0)
252251 return -EINVAL;
253252
254253 return 0;
drivers/gpu/drm/omapdrm/dss/venc.c+45−52
@@ -262,47 +262,41 @@ static const struct venc_config venc_config_pal_bdghi = { · 261 unmodified lines
262262 .fid_ext_start_y__fid_ext_offset_y = 0x01380005,
263263 };
264264
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,
268268 .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,
283280 };
284−EXPORT_SYMBOL(omap_dss_pal_timings);
281+EXPORT_SYMBOL(omap_dss_pal_vm);
285282
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,
289286 .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,
304298 };
305−EXPORT_SYMBOL(omap_dss_ntsc_timings);
299+EXPORT_SYMBOL(omap_dss_ntsc_vm);
306300
307301 static struct {
308302 struct platform_device *pdev;
@@ -313,7 +307,7 @@ static struct { · 4 unmodified lines
313307
314308 struct clk *tv_dac_clk;
315309
316− struct omap_video_timings timings;
310+ struct videomode vm;
317311 enum omap_dss_venc_type type;
318312 bool invert_polarity;
319313
@@ -427,13 +421,12 @@ static void venc_runtime_put(void) · 107 unmodified lines
427421 WARN_ON(r < 0 && r != -ENOSYS);
428422 }
429423
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)
432425 {
433− if (memcmp(&omap_dss_pal_timings, timings, sizeof(*timings)) == 0)
426+ if (memcmp(&omap_dss_pal_vm, vm, sizeof(*vm)) == 0)
434427 return &venc_config_pal_trm;
435428
436− if (memcmp(&omap_dss_ntsc_timings, timings, sizeof(*timings)) == 0)
429+ if (memcmp(&omap_dss_ntsc_vm, vm, sizeof(*vm)) == 0)
437430 return &venc_config_ntsc_trm;
438431
439432 BUG();
@@ -451,7 +444,7 @@ static int venc_power_on(struct omap_dss_device *dssdev) · 11 unmodified lines
451444 goto err0;
452445
453446 venc_reset();
454− venc_write_config(venc_timings_to_config(&venc.timings));
447+ venc_write_config(venc_timings_to_config(&venc.vm));
455448
456449 dss_set_venc_output(venc.type);
457450 dss_set_dac_pwrdn_bgz(1);
@@ -468,7 +461,7 @@ static int venc_power_on(struct omap_dss_device *dssdev) · 10 unmodified lines
468461
469462 venc_write_reg(VENC_OUTPUT_CONTROL, l);
470463
471− dss_mgr_set_timings(channel, &venc.timings);
464+ dss_mgr_set_timings(channel, &venc.vm);
472465
473466 r = regulator_enable(venc.vdda_dac_reg);
474467 if (r)
@@ -546,17 +539,17 @@ static void venc_display_disable(struct omap_dss_device *dssdev) · 71 unmodified lines
546539 }
547540
548541 static void venc_set_timings(struct omap_dss_device *dssdev,
549− struct omap_video_timings *timings)
542+ struct videomode *vm)
550543 {
551544 DSSDBG("venc_set_timings\n");
552545
553546 mutex_lock(&venc.venc_lock);
554547
555548 /* Reset WSS data when the TV standard changes. */
556− if (memcmp(&venc.timings, timings, sizeof(*timings)))
549+ if (memcmp(&venc.vm, vm, sizeof(*vm)))
557550 venc.wss_data = 0;
558551
559− venc.timings = *timings;
552+ venc.vm = *vm;
560553
561554 dispc_set_tv_pclk(13500000);
562555
@@ -564,25 +557,25 @@ static void venc_set_timings(struct omap_dss_device *dssdev, · 1 unmodified line
564557 }
565558
566559 static int venc_check_timings(struct omap_dss_device *dssdev,
567− struct omap_video_timings *timings)
560+ struct videomode *vm)
568561 {
569562 DSSDBG("venc_check_timings\n");
570563
571− if (memcmp(&omap_dss_pal_timings, timings, sizeof(*timings)) == 0)
564+ if (memcmp(&omap_dss_pal_vm, vm, sizeof(*vm)) == 0)
572565 return 0;
573566
574− if (memcmp(&omap_dss_ntsc_timings, timings, sizeof(*timings)) == 0)
567+ if (memcmp(&omap_dss_ntsc_vm, vm, sizeof(*vm)) == 0)
575568 return 0;
576569
577570 return -EINVAL;
578571 }
579572
580573 static void venc_get_timings(struct omap_dss_device *dssdev,
581− struct omap_video_timings *timings)
574+ struct videomode *vm)
582575 {
583576 mutex_lock(&venc.venc_lock);
584577
585− *timings = venc.timings;
578+ *vm = venc.vm;
586579
587580 mutex_unlock(&venc.venc_lock);
588581 }
@@ -602,7 +595,7 @@ static int venc_set_wss(struct omap_dss_device *dssdev, u32 wss) · 13 unmodified lines
602595
603596 mutex_lock(&venc.venc_lock);
604597
605− config = venc_timings_to_config(&venc.timings);
598+ config = venc_timings_to_config(&venc.vm);
606599
607600 /* Invert due to VENC_L21_WC_CTL:INV=1 */
608601 venc.wss_data = (wss ^ 0xfffff) << 8;
drivers/gpu/drm/omapdrm/omap_connector.c+11−76
@@ -42,73 +42,6 @@ bool omap_connector_get_hdmi_mode(struct drm_connector *connector) · 41 unmodified lines
4242 return omap_connector->hdmi_mode;
4343 }
4444
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−
11245 static enum drm_connector_status omap_connector_detect(
11346 struct drm_connector *connector, bool force)
11447 {
@@ -185,11 +118,11 @@ static int omap_connector_get_modes(struct drm_connector *connector) · 70 unmodified lines
185118 kfree(edid);
186119 } else {
187120 struct drm_display_mode *mode = drm_mode_create(dev);
188− struct omap_video_timings timings = {0};
121+ struct videomode vm = {0};
189122
190− dssdrv->get_timings(dssdev, &timings);
123+ dssdrv->get_timings(dssdev, &vm);
191124
192− copy_timings_omap_to_drm(mode, &timings);
125+ drm_display_mode_from_videomode(&vm, mode);
193126
194127 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
195128 drm_mode_set_name(mode);
@@ -207,12 +140,14 @@ static int omap_connector_mode_valid(struct drm_connector *connector, · 11 unmodified lines
207140 struct omap_connector *omap_connector = to_omap_connector(connector);
208141 struct omap_dss_device *dssdev = omap_connector->dssdev;
209142 struct omap_dss_driver *dssdrv = dssdev->driver;
210− struct omap_video_timings timings = {0};
143+ struct videomode vm = {0};
211144 struct drm_device *dev = connector->dev;
212145 struct drm_display_mode *new_mode;
213146 int r, ret = MODE_BAD;
214147
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;
216151 mode->vrefresh = drm_mode_vrefresh(mode);
217152
218153 /*
@@ -221,13 +156,13 @@ static int omap_connector_mode_valid(struct drm_connector *connector, · 2 unmodified lines
221156 * panel's timings
222157 */
223158 if (dssdrv->check_timings) {
224− r = dssdrv->check_timings(dssdev, &timings);
159+ r = dssdrv->check_timings(dssdev, &vm);
225160 } else {
226− struct omap_video_timings t = {0};
161+ struct videomode t = {0};
227162
228163 dssdrv->get_timings(dssdev, &t);
229164
230− if (memcmp(&timings, &t, sizeof(struct omap_video_timings)))
165+ if (memcmp(&vm, &t, sizeof(struct videomode)))
231166 r = -EINVAL;
232167 else
233168 r = 0;
@@ -236,7 +171,7 @@ static int omap_connector_mode_valid(struct drm_connector *connector, · 2 unmodified lines
236171 if (!r) {
237172 /* check if vrefresh is still valid */
238173 new_mode = drm_mode_duplicate(dev, mode);
239− new_mode->clock = timings.pixelclock / 1000;
174+ new_mode->clock = vm.pixelclock / 1000;
240175 new_mode->vrefresh = 0;
241176 if (mode->vrefresh == drm_mode_vrefresh(new_mode))
242177 ret = MODE_OK;
drivers/gpu/drm/omapdrm/omap_crtc.c+10−20
@@ -34,7 +34,7 @@ struct omap_crtc { · 33 unmodified lines
3434 const char *name;
3535 enum omap_channel channel;
3636
37− struct omap_video_timings timings;
37+ struct videomode vm;
3838
3939 struct omap_drm_irq vblank_irq;
4040 struct omap_drm_irq error_irq;
@@ -56,10 +56,10 @@ uint32_t pipe2vbl(struct drm_crtc *crtc) · 15 unmodified lines
5656 return dispc_mgr_get_vsync_irq(omap_crtc->channel);
5757 }
5858
59−struct omap_video_timings *omap_crtc_timings(struct drm_crtc *crtc)
59+struct videomode *omap_crtc_timings(struct drm_crtc *crtc)
6060 {
6161 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
62− return &omap_crtc->timings;
62+ return &omap_crtc->vm;
6363 }
6464
6565 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
201201
202202 dispc_mgr_setup(omap_crtc->channel, &info);
203203 dispc_mgr_set_timings(omap_crtc->channel,
204− &omap_crtc->timings);
204+ &omap_crtc->vm);
205205 omap_crtc_set_enabled(&omap_crtc->base, true);
206206
207207 return 0;
@@ -215,11 +215,11 @@ static void omap_crtc_dss_disable(enum omap_channel channel) · 7 unmodified lines
215215 }
216216
217217 static void omap_crtc_dss_set_timings(enum omap_channel channel,
218− const struct omap_video_timings *timings)
218+ const struct videomode *vm)
219219 {
220220 struct omap_crtc *omap_crtc = omap_crtcs[channel];
221221 DBG("%s", omap_crtc->name);
222− omap_crtc->timings = *timings;
222+ omap_crtc->vm = *vm;
223223 }
224224
225225 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
369369 mode->vdisplay, mode->vsync_start, mode->vsync_end, mode->vtotal,
370370 mode->type, mode->flags);
371371
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;
373376 }
374377
375378 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
411414 dispc_mgr_set_gamma(omap_crtc->channel, lut, length);
412415 }
413416
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−
427417 if (dispc_mgr_is_enabled(omap_crtc->channel)) {
428418
429419 DBG("%s: GO", omap_crtc->name);
drivers/gpu/drm/omapdrm/omap_drv.h+1−6
@@ -148,7 +148,7 @@ static inline void omap_fbdev_free(struct drm_device *dev) · 147 unmodified lines
148148 }
149149 #endif
150150
151−struct omap_video_timings *omap_crtc_timings(struct drm_crtc *crtc);
151+struct videomode *omap_crtc_timings(struct drm_crtc *crtc);
152152 enum omap_channel omap_crtc_channel(struct drm_crtc *crtc);
153153 void omap_crtc_pre_init(void);
154154 void omap_crtc_pre_uninit(void);
@@ -171,11 +171,6 @@ struct drm_encoder *omap_connector_attached_encoder( · 16 unmodified lines
171171 struct drm_connector *connector);
172172 bool omap_connector_get_hdmi_mode(struct drm_connector *connector);
173173
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−
179174 uint32_t omap_framebuffer_get_formats(uint32_t *pixel_formats,
180175 uint32_t max_formats, enum omap_color_mode supported_modes);
181176 struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev,
drivers/gpu/drm/omapdrm/omap_encoder.c+5−5
@@ -102,7 +102,7 @@ static void omap_encoder_disable(struct drm_encoder *encoder) · 101 unmodified lines
102102
103103 static int omap_encoder_update(struct drm_encoder *encoder,
104104 enum omap_channel channel,
105− struct omap_video_timings *timings)
105+ struct videomode *vm)
106106 {
107107 struct drm_device *dev = encoder->dev;
108108 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
111111 int ret;
112112
113113 if (dssdrv->check_timings) {
114− ret = dssdrv->check_timings(dssdev, timings);
114+ ret = dssdrv->check_timings(dssdev, vm);
115115 } else {
116− struct omap_video_timings t = {0};
116+ struct videomode t = {0};
117117
118118 dssdrv->get_timings(dssdev, &t);
119119
120− if (memcmp(timings, &t, sizeof(struct omap_video_timings)))
120+ if (memcmp(vm, &t, sizeof(struct videomode)))
121121 ret = -EINVAL;
122122 else
123123 ret = 0;
@@ -129,7 +129,7 @@ static int omap_encoder_update(struct drm_encoder *encoder, · 5 unmodified lines
129129 }
130130
131131 if (dssdrv->set_timings)
132− dssdrv->set_timings(dssdev, timings);
132+ dssdrv->set_timings(dssdev, vm);
133133
134134 return 0;
135135 }
drivers/gpu/drm/omapdrm/omap_gem.c+4−2
@@ -336,8 +336,10 @@ static void omap_gem_detach_pages(struct drm_gem_object *obj) · 335 unmodified lines
336336 if (omap_obj->flags & (OMAP_BO_WC|OMAP_BO_UNCACHED)) {
337337 int i, npages = obj->size >> PAGE_SHIFT;
338338 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);
341343 }
342344 }
343345
drivers/gpu/drm/omapdrm/omap_plane.c+18−10
@@ -131,7 +131,9 @@ static void omap_plane_atomic_update(struct drm_plane *plane, · 130 unmodified lines
131131 /* and finally, update omapdss: */
132132 ret = dispc_ovl_setup(omap_plane->id, &info, false,
133133 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);
135137 dispc_ovl_enable(omap_plane->id, false);
136138 return;
137139 }
@@ -157,12 +159,20 @@ static int omap_plane_atomic_check(struct drm_plane *plane, · 19 unmodified lines
157159 {
158160 struct drm_crtc_state *crtc_state;
159161
160− if (!state->crtc)
162+ if (!state->fb)
161163 return 0;
162164
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;
166176
167177 if (state->crtc_x < 0 || state->crtc_y < 0)
168178 return -EINVAL;
@@ -173,11 +183,9 @@ static int omap_plane_atomic_check(struct drm_plane *plane, · 4 unmodified lines
173183 if (state->crtc_y + state->crtc_h > crtc_state->adjusted_mode.vdisplay)
174184 return -EINVAL;
175185
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;
181189
182190 return 0;
183191 }
drivers/video/of_display_timing.c+9−0
@@ -88,6 +88,15 @@ static int of_parse_display_timing(const struct device_node *np, · 87 unmodified lines
8888 dt->flags |= val ? DISPLAY_FLAGS_PIXDATA_POSEDGE :
8989 DISPLAY_FLAGS_PIXDATA_NEGEDGE;
9090
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+
91100 if (of_property_read_bool(np, "interlaced"))
92101 dt->flags |= DISPLAY_FLAGS_INTERLACED;
93102 if (of_property_read_bool(np, "doublescan"))
include/video/display_timing.h+4−0
@@ -28,6 +28,10 @@ enum display_flags { · 27 unmodified lines
2828 DISPLAY_FLAGS_INTERLACED = BIT(8),
2929 DISPLAY_FLAGS_DOUBLESCAN = BIT(9),
3030 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),
3135 };
3236
3337 /*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t