Re: [Mesa-dev] [PATCH v3 2/3] Add a dumb drm/kms winsys for software rendering

2014-07-02 Thread Andreas Pokorny
Hi,
Nice patches! I found one minor issue below.

I currently try to integrate and use that locally within kvm, currently on
top of 10.2.

2014-06-15 13:49 GMT+02:00 Giovanni Campagna scampa.giova...@gmail.com:

 From: Giovanni Campagna gcampa...@src.gnome.org

 Add a new winsys and target that can be used with a dri2 state tracker and
 [..]

 diff --git a/configure.ac b/configure.ac
 index 390adaa..07e4648 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -1993,6 +1993,9 @@ if test -n $with_gallium_drivers; then
  if test x$enable_dri = xyes; then
  GALLIUM_TARGET_DIRS=$GALLIUM_TARGET_DIRS dri-swrast
  fi
 +if text x$have_libdrm = xyes; then
 +GALLIUM_TARGET_DIRS=$GALLIUM_TARGET_DIRS dri-kms-swrast
 +fi
  ;;


s/text/test here



 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 2/3] Add a dumb drm/kms winsys for software rendering

2014-06-15 Thread Giovanni Campagna
From: Giovanni Campagna gcampa...@src.gnome.org

Add a new winsys and target that can be used with a dri2 state tracker and
loader instead of drisw. This allows to use gbm as a dri2/image loader
and avoid the extra copy from the backbuffer to the shadow frontbuffer.

The new driver is called kms_swrast, and is only loaded by gbm
as a fallback, because it is only useful with the gbm platform
(as no buffer sharing is possible)
---
 configure.ac   |   5 +
 docs/relnotes/10.3.html|   2 +
 src/gallium/targets/Makefile.am|   3 +
 src/gallium/targets/dri-kms-swrast/Makefile.am |  61 
 .../targets/dri-kms-swrast/kms_swrast_drm_api.c|  65 +
 src/gallium/winsys/Makefile.am |   5 +
 src/gallium/winsys/sw/kms-dri/Makefile.am  |  33 +++
 src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c  | 312 +
 src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.h  |  37 +++
 src/gbm/backends/dri/gbm_dri.c |  31 +-
 10 files changed, 549 insertions(+), 5 deletions(-)
 create mode 100644 src/gallium/targets/dri-kms-swrast/Makefile.am
 create mode 100644 src/gallium/targets/dri-kms-swrast/kms_swrast_drm_api.c
 create mode 100644 src/gallium/winsys/sw/kms-dri/Makefile.am
 create mode 100644 src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
 create mode 100644 src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.h

diff --git a/configure.ac b/configure.ac
index 390adaa..07e4648 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1993,6 +1993,9 @@ if test -n $with_gallium_drivers; then
 if test x$enable_dri = xyes; then
 GALLIUM_TARGET_DIRS=$GALLIUM_TARGET_DIRS dri-swrast
 fi
+if text x$have_libdrm = xyes; then
+GALLIUM_TARGET_DIRS=$GALLIUM_TARGET_DIRS dri-kms-swrast
+fi
 ;;
 *)
 AC_MSG_ERROR([Unknown Gallium driver: $driver])
@@ -2206,6 +2209,7 @@ AC_CONFIG_FILES([Makefile
src/gallium/state_trackers/xvmc/Makefile
src/gallium/targets/Makefile
src/gallium/targets/dri-freedreno/Makefile
+   src/gallium/targets/dri-kms-swrast/Makefile
src/gallium/targets/dri-i915/Makefile
src/gallium/targets/dri-ilo/Makefile
src/gallium/targets/dri-nouveau/Makefile
@@ -2243,6 +2247,7 @@ AC_CONFIG_FILES([Makefile
src/gallium/winsys/svga/drm/Makefile
src/gallium/winsys/sw/dri/Makefile
src/gallium/winsys/sw/fbdev/Makefile
+   src/gallium/winsys/sw/kms-dri/Makefile
src/gallium/winsys/sw/null/Makefile
src/gallium/winsys/sw/wayland/Makefile
src/gallium/winsys/sw/wrapper/Makefile
diff --git a/docs/relnotes/10.3.html b/docs/relnotes/10.3.html
index 7ceaca4..6c47c19 100644
--- a/docs/relnotes/10.3.html
+++ b/docs/relnotes/10.3.html
@@ -48,6 +48,8 @@ Note: some of the new features are only available with 
certain drivers.
 liGL_ARB_stencil_texturing on nv50, nvc0, r600, and radeonsi/li
 liGL_ARB_texture_cube_map_array on radeonsi/li
 liGL_ARB_compressed_texture_pixel_storage on all drivers/li
+liA new software rasterizer driver (kms_swrast_dri.so) that works with
+DRM drivers that don't have a full-fledged GEM (such as qxl or simpledrm)/li
 /ul
 
 
diff --git a/src/gallium/targets/Makefile.am b/src/gallium/targets/Makefile.am
index 36d359c..16f88ba 100644
--- a/src/gallium/targets/Makefile.am
+++ b/src/gallium/targets/Makefile.am
@@ -126,6 +126,9 @@ if HAVE_GALLIUM_SOFTPIPE
 if HAVE_DRISW
 SUBDIRS += dri-swrast
 endif
+if HAVE_DRI2
+SUBDIRS += dri-kms-swrast
+endif
 endif
 
 if NEED_GALLIUM_LOADER
diff --git a/src/gallium/targets/dri-kms-swrast/Makefile.am 
b/src/gallium/targets/dri-kms-swrast/Makefile.am
new file mode 100644
index 000..09a8d17
--- /dev/null
+++ b/src/gallium/targets/dri-kms-swrast/Makefile.am
@@ -0,0 +1,61 @@
+# Copyright © 2012 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the Software),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER