summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vc4/vc4_hvs.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2015-12-28 13:25:41 -0800
committerEric Anholt <eric@anholt.net>2016-02-16 11:24:08 -0800
commitd8dbf44f13b91185c618219d912b246817a8d132 (patch)
treea8af3bb3b1e608514f93cd76b921c9e3d7ace76f /drivers/gpu/drm/vc4/vc4_hvs.c
parent6674a904d68041d982ffb284d2827410765a097a (diff)
downloadblackbird-op-linux-d8dbf44f13b91185c618219d912b246817a8d132.tar.gz
blackbird-op-linux-d8dbf44f13b91185c618219d912b246817a8d132.zip
drm/vc4: Make the CRTCs cooperate on allocating display lists.
So far, we've only ever lit up one CRTC, so this has been fine. To extend to more displays or more planes, we need to make sure we don't run our display lists into each other. Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/vc4/vc4_hvs.c')
-rw-r--r--drivers/gpu/drm/vc4/vc4_hvs.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c
index 8098c5b21ba4..9e435545b3b6 100644
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
@@ -119,6 +119,17 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data)
hvs->dlist = hvs->regs + SCALER_DLIST_START;
+ spin_lock_init(&hvs->mm_lock);
+
+ /* Set up the HVS display list memory manager. We never
+ * overwrite the setup from the bootloader (just 128b out of
+ * our 16K), since we don't want to scramble the screen when
+ * transitioning from the firmware's boot setup to runtime.
+ */
+ drm_mm_init(&hvs->dlist_mm,
+ HVS_BOOTLOADER_DLIST_END,
+ (SCALER_DLIST_SIZE >> 2) - HVS_BOOTLOADER_DLIST_END);
+
vc4->hvs = hvs;
return 0;
}
@@ -129,6 +140,8 @@ static void vc4_hvs_unbind(struct device *dev, struct device *master,
struct drm_device *drm = dev_get_drvdata(master);
struct vc4_dev *vc4 = drm->dev_private;
+ drm_mm_takedown(&vc4->hvs->dlist_mm);
+
vc4->hvs = NULL;
}
OpenPOWER on IntegriCloud