[PATCH xf86-video-dummy] Add glamor acceleration which enables native OpenGL support
Emil Velikov
emil.l.velikov at gmail.com
Tue Mar 7 21:35:46 UTC 2017
On 7 March 2017 at 03:53, Qiang Yu <Qiang.Yu at amd.com> wrote:
> Enable glamor acceleration in xorg.conf by:
> Section "Device"
> ...
> Driver "dummy"
> Option "Render" "/dev/dri/renderD128"
> ...
> EndSection
>
> GPU is chosen by the Render option which specifies the render
> node of the GPU DRM device.
>
> We could use the dumb buffer instead of gbm buffer as the
> screen front buffer. But dumb buffer requires open
> /dev/dri/cardx which has the limitation of only one instance
> of OpenGL enabled xserver can start.
>
> With gbm buffer, we can use /dev/dri/renderDx which has no
> limitation on the number of OpenGL enabled xserver and even
> won't conflict with a "real" xserver using radeon/amdgpu DDX.
>
> Due to using renderDx, only DRI3 OpenGL is supported.
>
> DGA is disabled when glamor is enabled, we can enable it with
> new gbm_bo_map/unmap API, but consider a more effiction way
> is just using DRI3BufferFromPixmap for the root window pixmap.
>
> Signed-off-by: Qiang Yu <Qiang.Yu at amd.com>
> ---
> configure.ac | 26 ++++++++++
> src/Makefile.am | 7 ++-
> src/dummy.h | 9 ++++
> src/dummy_dga.c | 3 ++
> src/dummy_driver.c | 143 ++++++++++++++++++++++++++++++++++++++++++++++++-----
> 5 files changed, 176 insertions(+), 12 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 4eb7fae..7239b63 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -68,6 +68,32 @@ AM_CONDITIONAL([DGA], [test "x$DGA" = xyes])
> # Obtain compiler/linker options for the driver dependencies
> PKG_CHECK_MODULES(XORG, [xorg-server >= 1.4.99.901] xproto fontsproto $REQUIRED_MODULES)
>
> +# Check glamor support
> +AC_ARG_ENABLE(glamor,
> + AS_HELP_STRING([--disable-glamor],
> + [Disable glamor, a new GL-based acceleration [default=enabled]]),
> + [GLAMOR="$enableval"],
> + [GLAMOR=yes])
> +
> +SAVE_CPPFLAGS="$CPPFLAGS"
> +CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
> +if test "x$GLAMOR" != "xno"; then
> + AC_CHECK_HEADERS([glamor.h], , [GLAMOR=no], [#include "xorg-server.h"])
> +fi
> +CPPFLAGS="$SAVE_CPPFLAGS"
> +
> +if test "x$GLAMOR" != "xno"; then
> + PKG_CHECK_MODULES(GBM, [gbm], , [GLAMOR=no])
> +fi
> +
> +AC_MSG_CHECKING([whether to include GLAMOR support])
> +AC_MSG_RESULT([$GLAMOR])
> +
> +if test "x$GLAMOR" != "xno"; then
> + AC_DEFINE(USE_GLAMOR, 1, [Enable glamor acceleration])
> +fi
> +AM_CONDITIONAL(GLAMOR, test x$GLAMOR != xno)
> +
The idea is cool, but the above looks wrong/broken.
You want to AC_MSG_ERROR if the the option is set to "yes" and it's
not available. Currently one silently ignores it, which is not good.
-Emil
More information about the xorg-devel
mailing list