Skip to content

Commit

Permalink
drm/vc4: Convert from firmware calls to using a generic power domain.
Browse files Browse the repository at this point in the history
This lets the firmware interaction get taken care of by a
firmware-specific driver.  Other V3D implementations wouldn't depend
on raspberry pi firmware.

Signed-off-by: Eric Anholt <[email protected]>
  • Loading branch information
anholt committed Nov 30, 2015
1 parent eb55be2 commit 5e0242f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
10 changes: 0 additions & 10 deletions drivers/gpu/drm/vc4/vc4_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <soc/bcm2835/raspberrypi-firmware.h>
#include "drm_fb_cma_helper.h"

#include "uapi/drm/vc4_drm.h"
Expand Down Expand Up @@ -170,7 +169,6 @@ static int vc4_drm_bind(struct device *dev)
struct drm_device *drm;
struct drm_connector *connector;
struct vc4_dev *vc4;
struct device_node *firmware_node;
int ret = 0;

dev->coherent_dma_mask = DMA_BIT_MASK(32);
Expand All @@ -179,14 +177,6 @@ static int vc4_drm_bind(struct device *dev)
if (!vc4)
return -ENOMEM;

firmware_node = of_parse_phandle(dev->of_node, "firmware", 0);
vc4->firmware = rpi_firmware_get(firmware_node);
if (!vc4->firmware) {
DRM_DEBUG("Failed to get Raspberry Pi firmware reference.\n");
return -EPROBE_DEFER;
}
of_node_put(firmware_node);

drm = drm_dev_alloc(&vc4_drm_driver, dev);
if (!drm)
return -ENOMEM;
Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/vc4/vc4_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ struct vc4_dev {
struct vc4_v3d *v3d;

struct drm_fbdev_cma *fbdev;
struct rpi_firmware *firmware;

struct vc4_hang_state *hang_state;

Expand Down
16 changes: 4 additions & 12 deletions drivers/gpu/drm/vc4/vc4_v3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/

#include "linux/component.h"
#include "soc/bcm2835/raspberrypi-firmware.h"
#include "vc4_drv.h"
#include "vc4_regs.h"

Expand Down Expand Up @@ -152,11 +151,10 @@ int vc4_v3d_debugfs_ident(struct seq_file *m, void *unused)
int
vc4_v3d_set_power(struct vc4_dev *vc4, bool on)
{
u32 packet = on;

return rpi_firmware_property(vc4->firmware,
RPI_FIRMWARE_SET_ENABLE_QPU,
&packet, sizeof(packet));
if (on)
return pm_generic_poweroff(&vc4->v3d->pdev->dev);
else
return pm_generic_resume(&vc4->v3d->pdev->dev);
}

static void vc4_v3d_init_hw(struct drm_device *dev)
Expand Down Expand Up @@ -190,10 +188,6 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data)

vc4->v3d = v3d;

ret = vc4_v3d_set_power(vc4, true);
if (ret)
return ret;

if (V3D_READ(V3D_IDENT0) != V3D_EXPECTED_IDENT0) {
DRM_ERROR("V3D_IDENT0 read 0x%08x instead of 0x%08x\n",
V3D_READ(V3D_IDENT0), V3D_EXPECTED_IDENT0);
Expand Down Expand Up @@ -232,8 +226,6 @@ static void vc4_v3d_unbind(struct device *dev, struct device *master,
V3D_WRITE(V3D_BPOA, 0);
V3D_WRITE(V3D_BPOS, 0);

vc4_v3d_set_power(vc4, false);

vc4->v3d = NULL;
}

Expand Down

0 comments on commit 5e0242f

Please sign in to comment.