summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vc4/vc4_drv.c
diff options
context:
space:
mode:
authorMaxime Ripard <maxime@cerno.tech>2022-06-10 13:51:37 +0200
committerMaxime Ripard <maxime@cerno.tech>2022-06-16 11:07:51 +0200
commit1cbc91eb7b518cc5f80442ff9b517dc5b9d3b849 (patch)
tree2c85be5190d06bd8a7a8a7e2026be0d21746d405 /drivers/gpu/drm/vc4/vc4_drv.c
parentcb468c7d84d174ab9cd638be9f5b3f1ba2b311a0 (diff)
downloadlinux-1cbc91eb7b518cc5f80442ff9b517dc5b9d3b849.tar.gz
linux-1cbc91eb7b518cc5f80442ff9b517dc5b9d3b849.tar.bz2
linux-1cbc91eb7b518cc5f80442ff9b517dc5b9d3b849.zip
drm/vc4: Consolidate Hardware Revision Check
A new generation of controller has been introduced with the BCM2711/RaspberryPi4. This generation needs a bunch of quirks, and over time we've piled on a number of checks in most parts of the drivers. All these checks are performed several times, and are not always consistent. Let's create a single, global, variable to hold it and use it everywhere. Reviewed-by: Melissa Wen <mwen@igalia.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://lore.kernel.org/r/20220610115149.964394-3-maxime@cerno.tech
Diffstat (limited to 'drivers/gpu/drm/vc4/vc4_drv.c')
-rw-r--r--drivers/gpu/drm/vc4/vc4_drv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
index 162bc18e7497..53067525b586 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.c
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
@@ -217,10 +217,13 @@ static int vc4_drm_bind(struct device *dev)
struct vc4_dev *vc4;
struct device_node *node;
struct drm_crtc *crtc;
+ bool is_vc5;
int ret = 0;
dev->coherent_dma_mask = DMA_BIT_MASK(32);
+ is_vc5 = of_device_is_compatible(dev->of_node, "brcm,bcm2711-vc5");
+
/* If VC4 V3D is missing, don't advertise render nodes. */
node = of_find_matching_node_and_match(NULL, vc4_v3d_dt_match, NULL);
if (!node || !of_device_is_available(node))
@@ -230,6 +233,7 @@ static int vc4_drm_bind(struct device *dev)
vc4 = devm_drm_dev_alloc(dev, &vc4_drm_driver, struct vc4_dev, base);
if (IS_ERR(vc4))
return PTR_ERR(vc4);
+ vc4->is_vc5 = is_vc5;
drm = &vc4->base;
platform_set_drvdata(pdev, drm);