1 From bce8c3dc146e3287519d5f6bb965dc2458e6684d Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Thu, 30 May 2019 15:55:15 +0100
4 Subject: [PATCH] drm/vc4: Max resolution of 7680 is conditional on
7 The max resolution had been increased from 2048 to 7680 for all
8 platforms. This code is common with Pi0-3 which have a max render
9 target for GL of 2048, therefore the increased resolution has to
10 be conditional on the platform.
11 Switch based on whether the bcm2835-v3d node is found, as that is
12 not present on Pi4. (There is a potential configuration on Pi0-3
13 with no v3d, but this is very unlikely).
15 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
17 drivers/gpu/drm/vc4/vc4_kms.c | 10 ++++++++--
18 1 file changed, 8 insertions(+), 2 deletions(-)
20 --- a/drivers/gpu/drm/vc4/vc4_kms.c
21 +++ b/drivers/gpu/drm/vc4/vc4_kms.c
22 @@ -429,8 +429,14 @@ int vc4_kms_load(struct drm_device *dev)
26 - dev->mode_config.max_width = 7680;
27 - dev->mode_config.max_height = 7680;
28 + if (!drm_core_check_feature(dev, DRIVER_RENDER)) {
29 + /* No V3D as part of vc4. Assume this is Pi4. */
30 + dev->mode_config.max_width = 7680;
31 + dev->mode_config.max_height = 7680;
33 + dev->mode_config.max_width = 2048;
34 + dev->mode_config.max_height = 2048;
36 dev->mode_config.funcs = &vc4_mode_funcs;
37 dev->mode_config.preferred_depth = 24;
38 dev->mode_config.async_page_flip = true;