[Mesa-dev] [PATCH 3/6] Add support for swrast to the DRM EGL platform

Pekka Paalanen ppaalanen at gmail.com
Wed Jul 23 23:23:29 PDT 2014


On Thu, 24 Jul 2014 01:43:35 +0100
Emil Velikov <emil.l.velikov at gmail.com> wrote:

> From: Giovanni Campagna <gcampagna at src.gnome.org>
> 
> Turn GBM into a swrast loader (providing putimage/getimage backed
> by a dumb KMS buffer). This allows to run KMS+DRM GL applications
> (such as weston or mutter-wayland) unmodified on cards that don't
> have any client side HW acceleration component but that can do
> modeset (examples include simpledrm and qxl)
> 
> [Emil Velikov]
>  - Fix make check.
>  - Split dri_open_driver() from dri_load_driver().
>  - Don't try to bind the swrast extensions when using dri.
>  - Handle swrast->CreateNewScreen() failure.
>  - strdup the driver_name, as it's free'd at destruction.
>  - s/LIBGL_ALWAYS_SOFTWARE/GBM_ALWAYS_SOFTWARE/
>  - Move gbm_dri_bo_map/unmap to gbm_driiint.h.
>  - Correct swrast fallback logic.
> 
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
>  src/egl/drivers/dri2/platform_drm.c | 153 +++++++++++++++++++++++----
>  src/gbm/backends/dri/gbm_dri.c      | 203 +++++++++++++++++++++++++++++++-----
>  src/gbm/backends/dri/gbm_driint.h   |  57 +++++++++-
>  src/gbm/gbm-symbols-check           |   1 +
>  src/gbm/main/gbm.h                  |   3 +
>  5 files changed, 369 insertions(+), 48 deletions(-)
> 

> diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
> index 347bc99..1aca506 100644
> --- a/src/gbm/backends/dri/gbm_dri.c
> +++ b/src/gbm/backends/dri/gbm_dri.c

> @@ -743,7 +886,7 @@ static struct gbm_device *
>  dri_device_create(int fd)
>  {
>     struct gbm_dri_device *dri;
> -   int ret;
> +   int ret, force_sw;
>  
>     dri = calloc(1, sizeof *dri);
>     if (!dri)
> @@ -763,7 +906,15 @@ dri_device_create(int fd)
>     dri->base.type = GBM_DRM_DRIVER_TYPE_DRI;
>     dri->base.base.name = "drm";
>  
> -   ret = dri_screen_create(dri);
> +   force_sw = getenv("GBM_ALWAYS_SOFTWARE") != NULL;
> +   if (!force_sw) {
> +      ret = dri_screen_create(dri);
> +      if (ret)
> +         ret = dri_screen_create_swrast(dri);
> +   } else {
> +      ret = dri_screen_create_swrast(dri);
> +   }
> +
>     if (ret)
>        goto err_dri;

Hi,

is GBM_ALWAYS_SOFTWARE a new env var?
Is it documented somewhere?
How does it interact with EGL_SOFTWARE?
Does GBM_ALWAYS_SOFTWARE affect GBM's ability to import dmabufs
somehow, or only the surfaces that will be passed to EGL?
(Importing dmabufs to be passed directly to KMS for scanout.)

I'm terribly confused with all the *SOFTWARE* variables, and it seems
I'm not alone as someone just recently filed a bunch of Weston bug
reports while trying to get software GL rendering with
LIBGL_ALWAYS_SOFTWARE on DRM/KMS.


Thanks,
pq


More information about the mesa-dev mailing list