[Mesa-dev] [PATCH 2/2] egl/dri2: platform_drm should also try render node first.
Emil Velikov
emil.l.velikov at gmail.com
Fri Apr 10 11:03:25 PDT 2015
Hi Haixia,
On 18/02/15 02:08, Haixia Shi wrote:
> Signed-off-by: Haixia Shi <hshi at chromium.org>
> ---
> src/egl/drivers/dri2/platform_drm.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
> index 02e87f7..834387f 100644
> --- a/src/egl/drivers/dri2/platform_drm.c
> +++ b/src/egl/drivers/dri2/platform_drm.c
> @@ -589,6 +589,8 @@ static struct dri2_egl_display_vtbl dri2_drm_display_vtbl = {
> .get_sync_values = dri2_fallback_get_sync_values,
> };
>
> +#define DRM_RENDER_DEV_NAME "%s/renderD%d"
> +
> EGLBoolean
> dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
> {
> @@ -608,7 +610,7 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
> gbm = disp->PlatformDisplay;
> if (gbm == NULL) {
> char buf[64];
> - int n = snprintf(buf, sizeof(buf), DRM_DEV_NAME, DRM_DIR_NAME, 0);
> + int n = snprintf(buf, sizeof(buf), DRM_RENDER_DEV_NAME, DRM_DIR_NAME, 128);
> if (n != -1 && n < sizeof(buf))
> fd = open(buf, O_RDWR);
> if (fd < 0)
>
I'm not sure that the patch title reflects reality here. This patch
essentially breaks old platforms that do not have render nodes, which is
something we might want to avoid.
-Emil
More information about the mesa-dev
mailing list