0b45bb1ae70fd75b78c9cdb58fae71d5623eebdc
[openwrt/staging/thess.git] /
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 621/806] drm/vc4: Max resolution of 7680 is conditional on
5 being Pi4
6
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).
14
15 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
16 ---
17 drivers/gpu/drm/vc4/vc4_kms.c | 10 ++++++++--
18 1 file changed, 8 insertions(+), 2 deletions(-)
19
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)
23 return ret;
24 }
25
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;
32 + } else {
33 + dev->mode_config.max_width = 2048;
34 + dev->mode_config.max_height = 2048;
35 + }
36 dev->mode_config.funcs = &vc4_mode_funcs;
37 dev->mode_config.preferred_depth = 24;
38 dev->mode_config.async_page_flip = true;