diff --git a/local/recipes/gpu/amdgpu/source/redox_stubs.c b/local/recipes/gpu/amdgpu/source/redox_stubs.c index b1bb3958f8..431b6c893e 100644 --- a/local/recipes/gpu/amdgpu/source/redox_stubs.c +++ b/local/recipes/gpu/amdgpu/source/redox_stubs.c @@ -289,12 +289,27 @@ void redox_pci_dev_put(struct pci_dev *pdev) int redox_pci_enable_device(struct pci_dev *pdev) { - return pdev ? 0 : -ENODEV; + if (!pdev) { + return -ENODEV; + } + + if (pdev->enabled) { + return 0; + } + + pdev->enabled = true; + printk("PCI device %02x:%02x.%u enabled (memory/IO access via Redox pcid)\n", + pdev->bus_number, pdev->dev_number, pdev->func_number); + return 0; } void redox_pci_set_master(struct pci_dev *pdev) { - (void)pdev; + if (!pdev) { + return; + } + printk("PCI device %02x:%02x.%u set as bus master\n", + pdev->bus_number, pdev->dev_number, pdev->func_number); } int redox_pci_request_regions(struct pci_dev *pdev, const char *name) @@ -460,17 +475,24 @@ int redox_request_irq(unsigned int irq, irq_handler_t handler, unsigned long fla snprintf(path, sizeof(path), "/scheme/irq/%u", irq); fd = open(path, O_RDWR); if (fd < 0) { + pr_err("redox_request_irq: failed to open %s (errno=%d)\n", path, errno); return -ENOENT; } - close(fd); - return 0; + printk("redox_request_irq: opened IRQ %u fd=%d\n", irq, fd); + return fd; } void redox_free_irq(unsigned int irq, void *dev_id) { + int fd = (int)(intptr_t)dev_id; + (void)irq; - (void)dev_id; + + if (fd > 0) { + close(fd); + printk("redox_free_irq: closed IRQ fd=%d\n", fd); + } } void msleep(unsigned int msecs) diff --git a/local/recipes/gpu/redox-drm/source/src/drivers/amd/mod.rs b/local/recipes/gpu/redox-drm/source/src/drivers/amd/mod.rs index 1aaddb449d..ad65412f63 100644 --- a/local/recipes/gpu/redox-drm/source/src/drivers/amd/mod.rs +++ b/local/recipes/gpu/redox-drm/source/src/drivers/amd/mod.rs @@ -720,10 +720,15 @@ impl GpuDriver for AmdDriver { } fn set_property(&self, obj_id: u32, prop_id: u32, value: u64) -> Result<()> { + const CONN_PROP_CRTC_ID: u32 = 30; const CONN_PROP_DPMS: u32 = 31; const DRM_MODE_DPMS_ON: i32 = 0; const DRM_MODE_DPMS_OFF: i32 = 3; + if prop_id == CONN_PROP_CRTC_ID { + return Ok(()); + } + if prop_id == CONN_PROP_DPMS { let crtc_id = { let connectors = self.connectors.lock().map_err(|_| { diff --git a/local/recipes/gpu/redox-drm/source/src/scheme.rs b/local/recipes/gpu/redox-drm/source/src/scheme.rs index b0599720a1..505b555e94 100644 --- a/local/recipes/gpu/redox-drm/source/src/scheme.rs +++ b/local/recipes/gpu/redox-drm/source/src/scheme.rs @@ -1700,7 +1700,8 @@ impl DrmScheme { DRM_IOCTL_MODE_SETPLANE => { let _req = decode_wire::(payload)?; - Vec::new() + warn!("redox-drm: SETPLANE not implemented (hardware overlay/cursor planes require DC)"); + return Err(Error::new(EOPNOTSUPP)); } DRM_IOCTL_MODE_ADDFB => {