pipe-loader: use radeonsi for MM if amdgpu dri is used

Submitted by Marek Olšák on July 11, 2019, 6:08 p.m.

Details

Message ID 20190711180823.4492-1-maraeo@gmail.com
State New
Headers show
Series "pipe-loader: use radeonsi for MM if amdgpu dri is used" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Marek Olšák July 11, 2019, 6:08 p.m.
From: Jeremy Newton <Jeremy.Newton@amd.com>

The amdgpu dri is used for the closed source AMD driver. Since this driver
does not implement multimedia, we fall back to radeonsi in mesa to do
multimedia. This corrects the dri driver name for when it is set to amdgpu.

Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
---
 src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
index 960d63b2c31..6e889539c92 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
@@ -187,20 +187,25 @@  pipe_loader_drm_probe_fd_nodup(struct pipe_loader_device **dev, int fd)
    } else {
       ddev->base.type = PIPE_LOADER_DEVICE_PLATFORM;
    }
    ddev->base.ops = &pipe_loader_drm_ops;
    ddev->fd = fd;
 
    ddev->base.driver_name = loader_get_driver_for_fd(fd);
    if (!ddev->base.driver_name)
       goto fail;
 
+   if (strcmp(ddev->base.driver_name, "amdgpu") == 0) {
+      FREE(ddev->base.driver_name);
+      ddev->base.driver_name = strdup("radeonsi");
+   }
+
    struct util_dl_library **plib = NULL;
 #ifndef GALLIUM_STATIC_TARGETS
    plib = &ddev->lib;
 #endif
    ddev->dd = get_driver_descriptor(ddev->base.driver_name, plib);
    if (!ddev->dd)
       goto fail;
 
    *dev = &ddev->base;
    return true;

Comments

On 2019-07-11 8:08 p.m., Marek Olšák wrote:
> From: Jeremy Newton <Jeremy.Newton@amd.com>
> 
> The amdgpu dri is used for the closed source AMD driver. Since this driver
> does not implement multimedia, we fall back to radeonsi in mesa to do
> multimedia. This corrects the dri driver name for when it is set to amdgpu.

"Gallium driver name" instead of "dri driver name" might make it
slightly clearer why this is done.

Also, might be worth adding something to the commit log that this will
allow dropping the amdgpu-pro specific GBM implementation in favour of
Mesa's.

Either way,

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>