Skip to content

Commit 79f92c7

Browse files
committed
drm/vc4: crtc: Support odd horizontal timings on BCM2712
BCM2711 runs pixelvalve at two pixels per clock cycle which results in an unfortunate limitation that odd horizontal timings are not possible. This is apparent on the standard DMT mode of 1366x768@60 which cannot be driven with correct timing. BCM2712 defaults to the same behaviour, but has a mode to support odd timings. While internally it still runs at two pixels per clock, setting the PV_VCONTROL_ODD_TIMING bit makes it appear externally to behave as it is one pixel per clock. Switching to this mode fixes 1366x768@60 mode, and other custom resultions with odd horizontal timings. Signed-off-by: Dom Cobley <[email protected]>
1 parent 3ed6d34 commit 79f92c7

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

drivers/gpu/drm/vc4/vc4_crtc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_encoder *encode
448448
*/
449449
CRTC_WRITE(PV_V_CONTROL,
450450
PV_VCONTROL_CONTINUOUS |
451+
(vc4->gen >= VC4_GEN_6 ? PV_VCONTROL_ODD_TIMING : 0) |
451452
(is_dsi ? PV_VCONTROL_DSI : 0) |
452453
PV_VCONTROL_INTERLACE |
453454
(odd_field_first
@@ -459,6 +460,7 @@ static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_encoder *encode
459460
} else {
460461
CRTC_WRITE(PV_V_CONTROL,
461462
PV_VCONTROL_CONTINUOUS |
463+
(vc4->gen >= VC4_GEN_6 ? PV_VCONTROL_ODD_TIMING : 0) |
462464
(is_dsi ? PV_VCONTROL_DSI : 0));
463465
CRTC_WRITE(PV_VSYNCD_EVEN, 0);
464466
}
@@ -1332,7 +1334,7 @@ const struct vc4_pv_data bcm2712_pv0_data = {
13321334
.hvs_output = 0,
13331335
},
13341336
.fifo_depth = 64,
1335-
.pixels_per_clock = 2,
1337+
.pixels_per_clock = 1,
13361338
.encoder_types = {
13371339
[0] = VC4_ENCODER_TYPE_HDMI0,
13381340
},
@@ -1345,7 +1347,7 @@ const struct vc4_pv_data bcm2712_pv1_data = {
13451347
.hvs_output = 1,
13461348
},
13471349
.fifo_depth = 64,
1348-
.pixels_per_clock = 2,
1350+
.pixels_per_clock = 1,
13491351
.encoder_types = {
13501352
[0] = VC4_ENCODER_TYPE_HDMI1,
13511353
},

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3958,7 +3958,7 @@ static const struct vc4_hdmi_variant bcm2712_hdmi0_variant = {
39583958
PHY_LANE_2,
39593959
PHY_LANE_CK,
39603960
},
3961-
.unsupported_odd_h_timings = true,
3961+
.unsupported_odd_h_timings = false,
39623962
.external_irq_controller = true,
39633963

39643964
.init_resources = vc5_hdmi_init_resources,
@@ -3985,7 +3985,7 @@ static const struct vc4_hdmi_variant bcm2712_hdmi1_variant = {
39853985
PHY_LANE_2,
39863986
PHY_LANE_CK,
39873987
},
3988-
.unsupported_odd_h_timings = true,
3988+
.unsupported_odd_h_timings = false,
39893989
.external_irq_controller = true,
39903990

39913991
.init_resources = vc5_hdmi_init_resources,

drivers/gpu/drm/vc4/vc4_regs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@
155155
# define PV_CONTROL_EN BIT(0)
156156

157157
#define PV_V_CONTROL 0x04
158+
# define PV_VCONTROL_ODD_TIMING BIT(29)
158159
# define PV_VCONTROL_ODD_DELAY_MASK VC4_MASK(22, 6)
159160
# define PV_VCONTROL_ODD_DELAY_SHIFT 6
160161
# define PV_VCONTROL_ODD_FIRST BIT(5)

0 commit comments

Comments
 (0)