diff options
-rw-r--r-- | drivers/gpu/drm/arm/display/komeda/d71/d71_component.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/arm/display/komeda/komeda_dev.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/arm/display/komeda/komeda_dev.h | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/arm/display/komeda/komeda_plane.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/arm/hdlcd_crtc.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/arm/malidp_drv.c | 13 |
10 files changed, 44 insertions, 29 deletions
diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c index 031e5f305a3c..6bab816ed8e7 100644 --- a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c +++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c | |||
@@ -245,7 +245,7 @@ static void d71_layer_dump(struct komeda_component *c, struct seq_file *sf) | |||
245 | seq_printf(sf, "%sAD_V_CROP:\t\t0x%X\n", prefix, v[2]); | 245 | seq_printf(sf, "%sAD_V_CROP:\t\t0x%X\n", prefix, v[2]); |
246 | } | 246 | } |
247 | 247 | ||
248 | static struct komeda_component_funcs d71_layer_funcs = { | 248 | static const struct komeda_component_funcs d71_layer_funcs = { |
249 | .update = d71_layer_update, | 249 | .update = d71_layer_update, |
250 | .disable = d71_layer_disable, | 250 | .disable = d71_layer_disable, |
251 | .dump_register = d71_layer_dump, | 251 | .dump_register = d71_layer_dump, |
@@ -391,7 +391,7 @@ static void d71_compiz_dump(struct komeda_component *c, struct seq_file *sf) | |||
391 | seq_printf(sf, "CU_USER_HIGH:\t\t0x%X\n", v[1]); | 391 | seq_printf(sf, "CU_USER_HIGH:\t\t0x%X\n", v[1]); |
392 | } | 392 | } |
393 | 393 | ||
394 | static struct komeda_component_funcs d71_compiz_funcs = { | 394 | static const struct komeda_component_funcs d71_compiz_funcs = { |
395 | .update = d71_compiz_update, | 395 | .update = d71_compiz_update, |
396 | .disable = d71_component_disable, | 396 | .disable = d71_component_disable, |
397 | .dump_register = d71_compiz_dump, | 397 | .dump_register = d71_compiz_dump, |
@@ -467,7 +467,7 @@ static void d71_improc_dump(struct komeda_component *c, struct seq_file *sf) | |||
467 | seq_printf(sf, "IPS_RGB_YUV_COEFF%u:\t0x%X\n", i, v[i]); | 467 | seq_printf(sf, "IPS_RGB_YUV_COEFF%u:\t0x%X\n", i, v[i]); |
468 | } | 468 | } |
469 | 469 | ||
470 | static struct komeda_component_funcs d71_improc_funcs = { | 470 | static const struct komeda_component_funcs d71_improc_funcs = { |
471 | .update = d71_improc_update, | 471 | .update = d71_improc_update, |
472 | .disable = d71_component_disable, | 472 | .disable = d71_component_disable, |
473 | .dump_register = d71_improc_dump, | 473 | .dump_register = d71_improc_dump, |
@@ -580,7 +580,7 @@ static void d71_timing_ctrlr_dump(struct komeda_component *c, | |||
580 | seq_printf(sf, "BS_USER:\t\t0x%X\n", v[4]); | 580 | seq_printf(sf, "BS_USER:\t\t0x%X\n", v[4]); |
581 | } | 581 | } |
582 | 582 | ||
583 | static struct komeda_component_funcs d71_timing_ctrlr_funcs = { | 583 | static const struct komeda_component_funcs d71_timing_ctrlr_funcs = { |
584 | .update = d71_timing_ctrlr_update, | 584 | .update = d71_timing_ctrlr_update, |
585 | .disable = d71_timing_ctrlr_disable, | 585 | .disable = d71_timing_ctrlr_disable, |
586 | .dump_register = d71_timing_ctrlr_dump, | 586 | .dump_register = d71_timing_ctrlr_dump, |
diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c index 34506ef7ad40..3a7248d42376 100644 --- a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c +++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c | |||
@@ -502,7 +502,7 @@ static void d71_init_fmt_tbl(struct komeda_dev *mdev) | |||
502 | table->n_formats = ARRAY_SIZE(d71_format_caps_table); | 502 | table->n_formats = ARRAY_SIZE(d71_format_caps_table); |
503 | } | 503 | } |
504 | 504 | ||
505 | static struct komeda_dev_funcs d71_chip_funcs = { | 505 | static const struct komeda_dev_funcs d71_chip_funcs = { |
506 | .init_format_table = d71_init_fmt_tbl, | 506 | .init_format_table = d71_init_fmt_tbl, |
507 | .enum_resources = d71_enum_resources, | 507 | .enum_resources = d71_enum_resources, |
508 | .cleanup = d71_cleanup, | 508 | .cleanup = d71_cleanup, |
@@ -514,7 +514,7 @@ static struct komeda_dev_funcs d71_chip_funcs = { | |||
514 | .flush = d71_flush, | 514 | .flush = d71_flush, |
515 | }; | 515 | }; |
516 | 516 | ||
517 | struct komeda_dev_funcs * | 517 | const struct komeda_dev_funcs * |
518 | d71_identify(u32 __iomem *reg_base, struct komeda_chip_info *chip) | 518 | d71_identify(u32 __iomem *reg_base, struct komeda_chip_info *chip) |
519 | { | 519 | { |
520 | chip->arch_id = malidp_read32(reg_base, GLB_ARCH_ID); | 520 | chip->arch_id = malidp_read32(reg_base, GLB_ARCH_ID); |
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c index 62fad59f5a6a..284ce079d8c4 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | |||
@@ -350,7 +350,7 @@ static bool komeda_crtc_mode_fixup(struct drm_crtc *crtc, | |||
350 | return true; | 350 | return true; |
351 | } | 351 | } |
352 | 352 | ||
353 | static struct drm_crtc_helper_funcs komeda_crtc_helper_funcs = { | 353 | static const struct drm_crtc_helper_funcs komeda_crtc_helper_funcs = { |
354 | .atomic_check = komeda_crtc_atomic_check, | 354 | .atomic_check = komeda_crtc_atomic_check, |
355 | .atomic_flush = komeda_crtc_atomic_flush, | 355 | .atomic_flush = komeda_crtc_atomic_flush, |
356 | .atomic_enable = komeda_crtc_atomic_enable, | 356 | .atomic_enable = komeda_crtc_atomic_enable, |
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c index ca3599e4a4d3..b67030a9f056 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/of_device.h> | 8 | #include <linux/of_device.h> |
9 | #include <linux/of_graph.h> | 9 | #include <linux/of_graph.h> |
10 | #include <linux/platform_device.h> | 10 | #include <linux/platform_device.h> |
11 | #include <linux/dma-mapping.h> | ||
11 | #ifdef CONFIG_DEBUG_FS | 12 | #ifdef CONFIG_DEBUG_FS |
12 | #include <linux/debugfs.h> | 13 | #include <linux/debugfs.h> |
13 | #include <linux/seq_file.h> | 14 | #include <linux/seq_file.h> |
@@ -249,6 +250,9 @@ struct komeda_dev *komeda_dev_create(struct device *dev) | |||
249 | goto err_cleanup; | 250 | goto err_cleanup; |
250 | } | 251 | } |
251 | 252 | ||
253 | dev->dma_parms = &mdev->dma_parms; | ||
254 | dma_set_max_seg_size(dev, DMA_BIT_MASK(32)); | ||
255 | |||
252 | err = sysfs_create_group(&dev->kobj, &komeda_sysfs_attr_group); | 256 | err = sysfs_create_group(&dev->kobj, &komeda_sysfs_attr_group); |
253 | if (err) { | 257 | if (err) { |
254 | DRM_ERROR("create sysfs group failed.\n"); | 258 | DRM_ERROR("create sysfs group failed.\n"); |
@@ -269,7 +273,7 @@ err_cleanup: | |||
269 | void komeda_dev_destroy(struct komeda_dev *mdev) | 273 | void komeda_dev_destroy(struct komeda_dev *mdev) |
270 | { | 274 | { |
271 | struct device *dev = mdev->dev; | 275 | struct device *dev = mdev->dev; |
272 | struct komeda_dev_funcs *funcs = mdev->funcs; | 276 | const struct komeda_dev_funcs *funcs = mdev->funcs; |
273 | int i; | 277 | int i; |
274 | 278 | ||
275 | sysfs_remove_group(&dev->kobj, &komeda_sysfs_attr_group); | 279 | sysfs_remove_group(&dev->kobj, &komeda_sysfs_attr_group); |
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h index 29e03c4e1ffc..973fd5e0eb98 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h | |||
@@ -60,7 +60,7 @@ struct komeda_chip_info { | |||
60 | 60 | ||
61 | struct komeda_product_data { | 61 | struct komeda_product_data { |
62 | u32 product_id; | 62 | u32 product_id; |
63 | struct komeda_dev_funcs *(*identify)(u32 __iomem *reg, | 63 | const struct komeda_dev_funcs *(*identify)(u32 __iomem *reg, |
64 | struct komeda_chip_info *info); | 64 | struct komeda_chip_info *info); |
65 | }; | 65 | }; |
66 | 66 | ||
@@ -149,6 +149,8 @@ struct komeda_dev { | |||
149 | struct device *dev; | 149 | struct device *dev; |
150 | /** @reg_base: the base address of komeda io space */ | 150 | /** @reg_base: the base address of komeda io space */ |
151 | u32 __iomem *reg_base; | 151 | u32 __iomem *reg_base; |
152 | /** @dma_parms: the dma parameters of komeda */ | ||
153 | struct device_dma_parameters dma_parms; | ||
152 | 154 | ||
153 | /** @chip: the basic chip information */ | 155 | /** @chip: the basic chip information */ |
154 | struct komeda_chip_info chip; | 156 | struct komeda_chip_info chip; |
@@ -173,7 +175,7 @@ struct komeda_dev { | |||
173 | struct komeda_pipeline *pipelines[KOMEDA_MAX_PIPELINES]; | 175 | struct komeda_pipeline *pipelines[KOMEDA_MAX_PIPELINES]; |
174 | 176 | ||
175 | /** @funcs: chip funcs to access to HW */ | 177 | /** @funcs: chip funcs to access to HW */ |
176 | struct komeda_dev_funcs *funcs; | 178 | const struct komeda_dev_funcs *funcs; |
177 | /** | 179 | /** |
178 | * @chip_data: | 180 | * @chip_data: |
179 | * | 181 | * |
@@ -192,7 +194,7 @@ komeda_product_match(struct komeda_dev *mdev, u32 target) | |||
192 | return MALIDP_CORE_ID_PRODUCT_ID(mdev->chip.core_id) == target; | 194 | return MALIDP_CORE_ID_PRODUCT_ID(mdev->chip.core_id) == target; |
193 | } | 195 | } |
194 | 196 | ||
195 | struct komeda_dev_funcs * | 197 | const struct komeda_dev_funcs * |
196 | d71_identify(u32 __iomem *reg, struct komeda_chip_info *chip); | 198 | d71_identify(u32 __iomem *reg, struct komeda_chip_info *chip); |
197 | 199 | ||
198 | struct komeda_dev *komeda_dev_create(struct device *dev); | 200 | struct komeda_dev *komeda_dev_create(struct device *dev); |
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c index c379439c6194..a130b62fa6d1 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c | |||
@@ -12,7 +12,7 @@ | |||
12 | /** komeda_pipeline_add - Add a pipeline to &komeda_dev */ | 12 | /** komeda_pipeline_add - Add a pipeline to &komeda_dev */ |
13 | struct komeda_pipeline * | 13 | struct komeda_pipeline * |
14 | komeda_pipeline_add(struct komeda_dev *mdev, size_t size, | 14 | komeda_pipeline_add(struct komeda_dev *mdev, size_t size, |
15 | struct komeda_pipeline_funcs *funcs) | 15 | const struct komeda_pipeline_funcs *funcs) |
16 | { | 16 | { |
17 | struct komeda_pipeline *pipe; | 17 | struct komeda_pipeline *pipe; |
18 | 18 | ||
@@ -130,7 +130,7 @@ komeda_pipeline_get_component(struct komeda_pipeline *pipe, int id) | |||
130 | struct komeda_component * | 130 | struct komeda_component * |
131 | komeda_component_add(struct komeda_pipeline *pipe, | 131 | komeda_component_add(struct komeda_pipeline *pipe, |
132 | size_t comp_sz, u32 id, u32 hw_id, | 132 | size_t comp_sz, u32 id, u32 hw_id, |
133 | struct komeda_component_funcs *funcs, | 133 | const struct komeda_component_funcs *funcs, |
134 | u8 max_active_inputs, u32 supported_inputs, | 134 | u8 max_active_inputs, u32 supported_inputs, |
135 | u8 max_active_outputs, u32 __iomem *reg, | 135 | u8 max_active_outputs, u32 __iomem *reg, |
136 | const char *name_fmt, ...) | 136 | const char *name_fmt, ...) |
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h index b1f813a349a4..bae8a32b81a6 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h | |||
@@ -124,7 +124,7 @@ struct komeda_component { | |||
124 | /** | 124 | /** |
125 | * @funcs: chip functions to access HW | 125 | * @funcs: chip functions to access HW |
126 | */ | 126 | */ |
127 | struct komeda_component_funcs *funcs; | 127 | const struct komeda_component_funcs *funcs; |
128 | }; | 128 | }; |
129 | 129 | ||
130 | /** | 130 | /** |
@@ -346,8 +346,8 @@ struct komeda_pipeline { | |||
346 | struct komeda_improc *improc; | 346 | struct komeda_improc *improc; |
347 | /** @ctrlr: timing controller */ | 347 | /** @ctrlr: timing controller */ |
348 | struct komeda_timing_ctrlr *ctrlr; | 348 | struct komeda_timing_ctrlr *ctrlr; |
349 | /** @funcs: chip pipeline functions */ | 349 | /** @funcs: chip private pipeline functions */ |
350 | struct komeda_pipeline_funcs *funcs; /* private pipeline functions */ | 350 | const struct komeda_pipeline_funcs *funcs; |
351 | 351 | ||
352 | /** @of_node: pipeline dt node */ | 352 | /** @of_node: pipeline dt node */ |
353 | struct device_node *of_node; | 353 | struct device_node *of_node; |
@@ -397,7 +397,7 @@ struct komeda_pipeline_state { | |||
397 | /* pipeline APIs */ | 397 | /* pipeline APIs */ |
398 | struct komeda_pipeline * | 398 | struct komeda_pipeline * |
399 | komeda_pipeline_add(struct komeda_dev *mdev, size_t size, | 399 | komeda_pipeline_add(struct komeda_dev *mdev, size_t size, |
400 | struct komeda_pipeline_funcs *funcs); | 400 | const struct komeda_pipeline_funcs *funcs); |
401 | void komeda_pipeline_destroy(struct komeda_dev *mdev, | 401 | void komeda_pipeline_destroy(struct komeda_dev *mdev, |
402 | struct komeda_pipeline *pipe); | 402 | struct komeda_pipeline *pipe); |
403 | int komeda_assemble_pipelines(struct komeda_dev *mdev); | 403 | int komeda_assemble_pipelines(struct komeda_dev *mdev); |
@@ -411,7 +411,7 @@ void komeda_pipeline_dump_register(struct komeda_pipeline *pipe, | |||
411 | struct komeda_component * | 411 | struct komeda_component * |
412 | komeda_component_add(struct komeda_pipeline *pipe, | 412 | komeda_component_add(struct komeda_pipeline *pipe, |
413 | size_t comp_sz, u32 id, u32 hw_id, | 413 | size_t comp_sz, u32 id, u32 hw_id, |
414 | struct komeda_component_funcs *funcs, | 414 | const struct komeda_component_funcs *funcs, |
415 | u8 max_active_inputs, u32 supported_inputs, | 415 | u8 max_active_inputs, u32 supported_inputs, |
416 | u8 max_active_outputs, u32 __iomem *reg, | 416 | u8 max_active_outputs, u32 __iomem *reg, |
417 | const char *name_fmt, ...); | 417 | const char *name_fmt, ...); |
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c index 07ed0cc1bc44..c97062bdd69b 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c | |||
@@ -55,7 +55,6 @@ komeda_plane_atomic_check(struct drm_plane *plane, | |||
55 | struct komeda_plane_state *kplane_st = to_kplane_st(state); | 55 | struct komeda_plane_state *kplane_st = to_kplane_st(state); |
56 | struct komeda_layer *layer = kplane->layer; | 56 | struct komeda_layer *layer = kplane->layer; |
57 | struct drm_crtc_state *crtc_st; | 57 | struct drm_crtc_state *crtc_st; |
58 | struct komeda_crtc *kcrtc; | ||
59 | struct komeda_crtc_state *kcrtc_st; | 58 | struct komeda_crtc_state *kcrtc_st; |
60 | struct komeda_data_flow_cfg dflow; | 59 | struct komeda_data_flow_cfg dflow; |
61 | int err; | 60 | int err; |
@@ -64,7 +63,7 @@ komeda_plane_atomic_check(struct drm_plane *plane, | |||
64 | return 0; | 63 | return 0; |
65 | 64 | ||
66 | crtc_st = drm_atomic_get_crtc_state(state->state, state->crtc); | 65 | crtc_st = drm_atomic_get_crtc_state(state->state, state->crtc); |
67 | if (!crtc_st->enable) { | 66 | if (IS_ERR(crtc_st) || !crtc_st->enable) { |
68 | DRM_DEBUG_ATOMIC("Cannot update plane on a disabled CRTC.\n"); | 67 | DRM_DEBUG_ATOMIC("Cannot update plane on a disabled CRTC.\n"); |
69 | return -EINVAL; | 68 | return -EINVAL; |
70 | } | 69 | } |
@@ -73,7 +72,6 @@ komeda_plane_atomic_check(struct drm_plane *plane, | |||
73 | if (!crtc_st->active) | 72 | if (!crtc_st->active) |
74 | return 0; | 73 | return 0; |
75 | 74 | ||
76 | kcrtc = to_kcrtc(state->crtc); | ||
77 | kcrtc_st = to_kcrtc_st(crtc_st); | 75 | kcrtc_st = to_kcrtc_st(crtc_st); |
78 | 76 | ||
79 | err = komeda_plane_init_data_flow(state, &dflow); | 77 | err = komeda_plane_init_data_flow(state, &dflow); |
diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index 0b2b62f8fa3c..a3efa28436ea 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c | |||
@@ -186,20 +186,20 @@ static void hdlcd_crtc_atomic_disable(struct drm_crtc *crtc, | |||
186 | clk_disable_unprepare(hdlcd->clk); | 186 | clk_disable_unprepare(hdlcd->clk); |
187 | } | 187 | } |
188 | 188 | ||
189 | static int hdlcd_crtc_atomic_check(struct drm_crtc *crtc, | 189 | static enum drm_mode_status hdlcd_crtc_mode_valid(struct drm_crtc *crtc, |
190 | struct drm_crtc_state *state) | 190 | const struct drm_display_mode *mode) |
191 | { | 191 | { |
192 | struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc); | 192 | struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc); |
193 | struct drm_display_mode *mode = &state->adjusted_mode; | ||
194 | long rate, clk_rate = mode->clock * 1000; | 193 | long rate, clk_rate = mode->clock * 1000; |
195 | 194 | ||
196 | rate = clk_round_rate(hdlcd->clk, clk_rate); | 195 | rate = clk_round_rate(hdlcd->clk, clk_rate); |
197 | if (rate != clk_rate) { | 196 | /* 0.1% seems a close enough tolerance for the TDA19988 on Juno */ |
197 | if (abs(rate - clk_rate) * 1000 > clk_rate) { | ||
198 | /* clock required by mode not supported by hardware */ | 198 | /* clock required by mode not supported by hardware */ |
199 | return -EINVAL; | 199 | return MODE_NOCLOCK; |
200 | } | 200 | } |
201 | 201 | ||
202 | return 0; | 202 | return MODE_OK; |
203 | } | 203 | } |
204 | 204 | ||
205 | static void hdlcd_crtc_atomic_begin(struct drm_crtc *crtc, | 205 | static void hdlcd_crtc_atomic_begin(struct drm_crtc *crtc, |
@@ -220,7 +220,7 @@ static void hdlcd_crtc_atomic_begin(struct drm_crtc *crtc, | |||
220 | } | 220 | } |
221 | 221 | ||
222 | static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = { | 222 | static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = { |
223 | .atomic_check = hdlcd_crtc_atomic_check, | 223 | .mode_valid = hdlcd_crtc_mode_valid, |
224 | .atomic_begin = hdlcd_crtc_atomic_begin, | 224 | .atomic_begin = hdlcd_crtc_atomic_begin, |
225 | .atomic_enable = hdlcd_crtc_atomic_enable, | 225 | .atomic_enable = hdlcd_crtc_atomic_enable, |
226 | .atomic_disable = hdlcd_crtc_atomic_disable, | 226 | .atomic_disable = hdlcd_crtc_atomic_disable, |
diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 21725c9b9f5e..18cb7f134f4e 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c | |||
@@ -192,6 +192,7 @@ static void malidp_atomic_commit_hw_done(struct drm_atomic_state *state) | |||
192 | { | 192 | { |
193 | struct drm_device *drm = state->dev; | 193 | struct drm_device *drm = state->dev; |
194 | struct malidp_drm *malidp = drm->dev_private; | 194 | struct malidp_drm *malidp = drm->dev_private; |
195 | int loop = 5; | ||
195 | 196 | ||
196 | malidp->event = malidp->crtc.state->event; | 197 | malidp->event = malidp->crtc.state->event; |
197 | malidp->crtc.state->event = NULL; | 198 | malidp->crtc.state->event = NULL; |
@@ -206,8 +207,18 @@ static void malidp_atomic_commit_hw_done(struct drm_atomic_state *state) | |||
206 | drm_crtc_vblank_get(&malidp->crtc); | 207 | drm_crtc_vblank_get(&malidp->crtc); |
207 | 208 | ||
208 | /* only set config_valid if the CRTC is enabled */ | 209 | /* only set config_valid if the CRTC is enabled */ |
209 | if (malidp_set_and_wait_config_valid(drm) < 0) | 210 | if (malidp_set_and_wait_config_valid(drm) < 0) { |
211 | /* | ||
212 | * make a loop around the second CVAL setting and | ||
213 | * try 5 times before giving up. | ||
214 | */ | ||
215 | while (loop--) { | ||
216 | if (!malidp_set_and_wait_config_valid(drm)) | ||
217 | break; | ||
218 | } | ||
210 | DRM_DEBUG_DRIVER("timed out waiting for updated configuration\n"); | 219 | DRM_DEBUG_DRIVER("timed out waiting for updated configuration\n"); |
220 | } | ||
221 | |||
211 | } else if (malidp->event) { | 222 | } else if (malidp->event) { |
212 | /* CRTC inactive means vblank IRQ is disabled, send event directly */ | 223 | /* CRTC inactive means vblank IRQ is disabled, send event directly */ |
213 | spin_lock_irq(&drm->event_lock); | 224 | spin_lock_irq(&drm->event_lock); |