wait_queue_head_t dma_waitq;
struct bcm2708_fb_stats stats;
unsigned long fb_bus_address;
+ struct { u32 base, length; } gpu;
};
#define to_bcm2708(info) container_of(info, struct bcm2708_fb, fb)
dma_addr_t bus_addr;
long rc = 0;
size_t offset;
- struct { u32 base, length; } gpu = {};
/* restrict this to root user */
if (!uid_eq(current_euid(), GLOBAL_ROOT_UID))
goto out;
}
- rc = rpi_firmware_property(fb->fw,
- RPI_FIRMWARE_GET_VC_MEMORY,
- &gpu, sizeof(gpu));
- if (rc != 0 || gpu.base == 0 || gpu.length == 0) {
- pr_err("[%s]: Unable to determine gpu memory %ld,%x,%x)\n", __func__, rc, gpu.base, gpu.length);
+ if (fb->gpu.base == 0 || fb->gpu.length == 0) {
+ pr_err("[%s]: Unable to determine gpu memory (%x,%x)\n", __func__, fb->gpu.base, fb->gpu.length);
return -EFAULT;
}
- if (INTALIAS_NORMAL(ioparam.src) < gpu.base || INTALIAS_NORMAL(ioparam.src) >= gpu.base + gpu.length) {
- pr_err("[%s]: Invalid memory access %x (%x-%x)", __func__, INTALIAS_NORMAL(ioparam.src), gpu.base, gpu.base + gpu.length);
+ if (INTALIAS_NORMAL(ioparam.src) < fb->gpu.base || INTALIAS_NORMAL(ioparam.src) >= fb->gpu.base + fb->gpu.length) {
+ pr_err("[%s]: Invalid memory access %x (%x-%x)", __func__, INTALIAS_NORMAL(ioparam.src), fb->gpu.base, fb->gpu.base + fb->gpu.length);
return -EFAULT;
}
fb->dev = dev;
fb->fb.device = &dev->dev;
+ // failure here isn't fatal, but we'll fail in vc_mem_copy if fb->gpu is not valid
+ rpi_firmware_property(fb->fw,
+ RPI_FIRMWARE_GET_VC_MEMORY,
+ &fb->gpu, sizeof(fb->gpu));
+
ret = bcm2708_fb_register(fb);
if (ret == 0) {
platform_set_drvdata(dev, fb);