Skip to content

Commit e94fb68

Browse files
6by9pelwell
authored andcommitted
drm/vc4: Adopt the dma configuration from the HVS or V3D component
vc4_drv isn't necessarily under the /soc node in DT as it is a virtual device, but it is the one that does the allocations. The DMA addresses are consumed by primarily the HVS or V3D, and those require VideoCore cache alias address mapping, and so will be under /soc. During probe find the a suitable device node for HVS or V3D, and adopt the DMA configuration of that node. Signed-off-by: Dave Stevenson <[email protected]>
1 parent 99c315e commit e94fb68

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/gpu/drm/vc4/vc4_drv.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,14 @@ static void vc4_match_add_drivers(struct device *dev,
249249
}
250250
}
251251

252+
const struct of_device_id vc4_dma_range_matches[] = {
253+
{ .compatible = "brcm,bcm2835-hvs" },
254+
{ .compatible = "brcm,bcm2835-v3d" },
255+
{ .compatible = "brcm,cygnus-v3d" },
256+
{ .compatible = "brcm,vc4-v3d" },
257+
{}
258+
};
259+
252260
static int vc4_drm_bind(struct device *dev)
253261
{
254262
struct platform_device *pdev = to_platform_device(dev);
@@ -269,6 +277,16 @@ static int vc4_drm_bind(struct device *dev)
269277
vc4_drm_driver.driver_features &= ~DRIVER_RENDER;
270278
of_node_put(node);
271279

280+
node = of_find_matching_node_and_match(NULL, vc4_dma_range_matches,
281+
NULL);
282+
if (node) {
283+
ret = of_dma_configure(dev, node, true);
284+
of_node_put(node);
285+
286+
if (ret)
287+
return ret;
288+
}
289+
272290
drm = drm_dev_alloc(&vc4_drm_driver, dev);
273291
if (IS_ERR(drm))
274292
return PTR_ERR(drm);

0 commit comments

Comments
 (0)