[Intel-gfx] [RFC i-g-t 1/2] configure.ac: Add support for configure flag --disable-pciaccess.
From: Robert Foss <robert.f...@collabora.com> Add support for configure flag --disable-pciaccess and the associated automake define HAVE_PCIACCESS. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- configure.ac | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 11b1d46..e46bbd5 100644 --- a/configure.ac +++ b/configure.ac @@ -101,7 +101,6 @@ fi AC_SUBST(ASSEMBLER_WARN_CFLAGS) PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.64 libdrm]) -PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) case "$target_cpu" in x86*) @@ -175,6 +174,18 @@ if test "x$VC4" = xyes; then fi AM_CONDITIONAL(HAVE_VC4, [test "x$VC4" = xyes]) +AC_ARG_ENABLE(pciaccess, AS_HELP_STRING([--disable-pciaccess], + [Enable use of pci bus access using libpciaccess (default: auto)]), + [PCIACCESS=$enableval], [PCIACCESS=auto]) +if test "x$PCIACCESS" = xauto; then + PKG_CHECK_EXISTS([pciaccess], [PCIACCESS=yes], [PCIACCESS=no]) +fi +if test "x$PCIACCESS" = xyes; then + PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) + AC_DEFINE(HAVE_LIBPCIACCESS, 1, [Have libpciaccess support]) +fi +AM_CONDITIONAL(HAVE_LIBPCIACCESS, [test "x$PCIACCESS" = xyes]) + # Define a configure option for the shader debugger AC_ARG_ENABLE(shader-debugger, AS_HELP_STRING([--enable-shader-debugger], [Enable shader debugging support [autodetected]]), -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC i-g-t 7/9] lib/intel_drm_stubs: Add stubs for functionality from libdrm_intel.
On 2016-05-24 04:05 AM, Daniel Vetter wrote: On Fri, May 20, 2016 at 06:59:31PM -0400, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> This patch provides stubs for functionality otherwise provided by libdrm_intel. The stubbed functions all fail with a call to igt_require(false). Defines and enums have been copied from libdrm_intel. For prettiness mayb igt_require_f(false, "Not compiled with libdrm_intel support\n"); or something similar. -Daniel Ack, added in v2. Rob. Due to the stubbed tests failing with an igt_require() call, these stubs are not well suited for non-tests, since tools/benchmarks/etc 'skipping' execution is unhelpful. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/Makefile.sources | 2 + lib/intel_drm_stubs.c | 258 + lib/intel_drm_stubs.h | 999 ++ 3 files changed, 1259 insertions(+) create mode 100644 lib/intel_drm_stubs.c create mode 100644 lib/intel_drm_stubs.h diff --git a/lib/Makefile.sources b/lib/Makefile.sources index 1316fd2..c0f9f6d 100644 --- a/lib/Makefile.sources +++ b/lib/Makefile.sources @@ -21,6 +21,8 @@ libintel_tools_la_SOURCES = \ intel_batchbuffer.c \ intel_batchbuffer.h \ intel_chipset.h \ + intel_drm_stubs.c \ + intel_drm_stubs.h \ intel_os.c \ intel_io.h \ intel_mmio.c\ diff --git a/lib/intel_drm_stubs.c b/lib/intel_drm_stubs.c new file mode 100644 index 000..d46a9b3 --- /dev/null +++ b/lib/intel_drm_stubs.c @@ -0,0 +1,258 @@ +#ifndef HAVE_INTEL + +#include "intel_drm_stubs.h" + +drm_intel_bufmgr *drm_intel_bufmgr_gem_init(int fd, int batch_size) +{ + igt_require(false); + return (drm_intel_bufmgr *) NULL; +} + +void drm_intel_bo_unreference(drm_intel_bo *bo) +{ + igt_require(false); +} + +drm_intel_bo *drm_intel_bo_alloc(drm_intel_bufmgr *bufmgr, const char *name, +unsigned long size, unsigned int alignment) +{ + igt_require(false); + return (drm_intel_bo *) NULL; +} + +int drm_intel_bo_subdata(drm_intel_bo *bo, unsigned long offset, +unsigned long size, const void *data) +{ + igt_require(false); + return 0; +} + +int drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx, + int used, unsigned int flags) +{ + igt_require(false); + return 0; +} + +int drm_intel_bo_emit_reloc(drm_intel_bo *bo, uint32_t offset, + drm_intel_bo *target_bo, uint32_t target_offset, + uint32_t read_domains, uint32_t write_domain) +{ + igt_require(false); + return 0; +} + +int drm_intel_bo_emit_reloc_fence(drm_intel_bo *bo, uint32_t offset, + drm_intel_bo *target_bo, + uint32_t target_offset, + uint32_t read_domains, uint32_t write_domain) +{ + igt_require(false); + return 0; +} + +int drm_intel_bo_get_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, + uint32_t * swizzle_mode) +{ + igt_require(false); + return 0; +} + +int drm_intel_bo_mrb_exec(drm_intel_bo *bo, int used, + struct drm_clip_rect *cliprects, int num_cliprects, int DR4, + unsigned int flags) +{ + igt_require(false); + return 0; +} + +void drm_intel_bufmgr_gem_set_aub_annotations(drm_intel_bo *bo, +drm_intel_aub_annotation *annotations, +unsigned count) +{ + igt_require(false); +} + +void drm_intel_bufmgr_gem_enable_reuse(drm_intel_bufmgr *bufmgr) +{ + igt_require(false); +} + +int drm_intel_bo_exec(drm_intel_bo *bo, int used, + struct drm_clip_rect *cliprects, int num_cliprects, int DR4) +{ + igt_require(false); + return 0; +} + +void drm_intel_bufmgr_destroy(drm_intel_bufmgr *bufmgr) +{ + igt_require(false); +} + +void drm_intel_bo_wait_rendering(drm_intel_bo *bo) +{ + igt_require(false); +} + +int drm_intel_bo_get_subdata(drm_intel_bo *bo, unsigned long offset, +unsigned long size, void *data) +{ + igt_require(false); + return 0; +} + +int drm_intel_bo_map(drm_intel_bo *bo, int write_enable) +{ + igt_require(false); + return 0; +} + +int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo) +{ + igt_require(false); + return 0; +} + +void drm_intel_bufmgr_gem_enable_fenced_relocs(drm_intel_bufmgr *bufmgr) +{ + igt_require(false); +} + +int drm_intel_bo_unmap(drm_intel_bo *bo) +{ + igt_require(false); + return 0; +} + +int drm_intel_bo_flink(drm_intel_bo *bo, uint32_t * name) +{ + ig
[Intel-gfx] [RFC i-g-t 3/7] benchmarks/Makefile: Don't build benchmarks that depend on libdrm_intel.
From: Robert Foss <robert.f...@collabora.com> Use the HAS_INTEL automake flag to avoid building benchmarks that won't compile unless libdrm_intel is available in the build system. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- benchmarks/Android.mk | 6 ++ benchmarks/Makefile.am | 5 - benchmarks/Makefile.sources | 14 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk index 207a177..08b6816 100644 --- a/benchmarks/Android.mk +++ b/benchmarks/Android.mk @@ -34,4 +34,10 @@ endef benchmark_list := $(benchmarks_PROGRAMS) +ifeq ($(HAVE_LIBDRM_INTEL),true) +benchmark_list += $(LIBDRM_INTEL_BENCHMARKS) +endif + + + $(foreach item,$(benchmark_list),$(eval $(call add_benchmark,$(item diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am index 49d2f64..7400dd0 100644 --- a/benchmarks/Makefile.am +++ b/benchmarks/Makefile.am @@ -1,6 +1,9 @@ - include Makefile.sources +if HAVE_LIBDRM_INTEL + benchmarks_PROGRAMS += $(LIBDRM_INTEL_BENCHMARKS) +endif + AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) \ $(WERROR_CFLAGS) diff --git a/benchmarks/Makefile.sources b/benchmarks/Makefile.sources index bc4f2b5..a2742f3 100644 --- a/benchmarks/Makefile.sources +++ b/benchmarks/Makefile.sources @@ -1,10 +1,7 @@ benchmarksdir=$(libexecdir)/intel-gpu-tools/benchmarks + benchmarks_PROGRAMS = \ - intel_upload_blit_large \ - intel_upload_blit_large_gtt \ - intel_upload_blit_large_map \ - intel_upload_blit_small \ gem_blt \ gem_create \ gem_exec_ctx\ @@ -17,6 +14,13 @@ benchmarks_PROGRAMS =\ gem_prw \ gem_set_domain \ gem_syslatency \ - gem_userptr_benchmark \ kms_vblank \ $(NULL) + +LIBDRM_INTEL_BENCHMARKS = \ + intel_upload_blit_large \ + intel_upload_blit_large_gtt \ + intel_upload_blit_large_map \ + intel_upload_blit_small \ + gem_userptr_benchmark \ + $(NULL) -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t 6/7] demos/Makefile: Don't build tools that depend on libdrm_intel.
From: Robert Foss <robert.f...@collabora.com> Use the HAS_INTEL automake flag to avoid building tools that won't compile unless libdrm_intel is available in the build system. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- demos/Android.mk | 5 - demos/Makefile.am | 8 +--- demos/Makefile.sources | 7 +++ 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 demos/Makefile.sources diff --git a/demos/Android.mk b/demos/Android.mk index 7d06c9a..add2414 100644 --- a/demos/Android.mk +++ b/demos/Android.mk @@ -4,8 +4,11 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_SRC_FILES := intel_sprite_on.c +LOCAL_SRC_FILES := +ifeq ($(HAVE_LIBDRM_INTEL),true) +LOCAL_SRC_FILES += $(LIBDRM_INTEL_BIN) +endif LOCAL_CFLAGS += -DHAVE_TERMIOS_H LOCAL_CFLAGS += -DANDROID -UNDEBUG diff --git a/demos/Makefile.am b/demos/Makefile.am index f5725f4..48eb6c2 100644 --- a/demos/Makefile.am +++ b/demos/Makefile.am @@ -1,6 +1,8 @@ -bin_PROGRAMS = \ - intel_sprite_on \ - $(NULL) +include Makefile.sources + +if HAVE_LIBDRM_INTEL + bin_PROGRAMS += $(LIBDRM_INTEL_BIN) +endif AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \ diff --git a/demos/Makefile.sources b/demos/Makefile.sources new file mode 100644 index 000..302f6d9 --- /dev/null +++ b/demos/Makefile.sources @@ -0,0 +1,7 @@ +bin_PROGRAMS = \ + $(NULL) + +HAVE_LIBDRM_INTEL_BIN =\ + intel_sprite_on \ + $(NULL) + -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t 0/2] Remove build time dependency in libpciaccess.
From: Robert Foss <robert.f...@collabora.com> Don't try to build overlay if libpciaccess is unavailable. This is useful for platforms that typically don't have pci hardware, like ARM platforms. Robert Foss (2): configure.ac: Add support for configure flag --disable-pciaccess. overlay/Makefile: Don't try to build overlay if libpciaccess is unavailable. configure.ac| 13 - overlay/Makefile.am | 5 - 2 files changed, 16 insertions(+), 2 deletions(-) -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t 2/2] overlay/Makefile: Don't try to build overlay if libpciaccess is unavailable.
From: Robert Foss <robert.f...@collabora.com> Don't try to build overlay if libpciaccess is unavailable. This is useful for platforms that typically don't have pci hardware, like ARM platforms. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- overlay/Makefile.am | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/overlay/Makefile.am b/overlay/Makefile.am index c926557..a60c6b8 100644 --- a/overlay/Makefile.am +++ b/overlay/Makefile.am @@ -1,5 +1,8 @@ + if BUILD_OVERLAY -bin_PROGRAMS = intel-gpu-overlay + if HAVE_LIBPCIACCESS + bin_PROGRAMS = intel-gpu-overlay + endif endif AM_CPPFLAGS = -I. -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC i-g-t 2/9] benchmarks/Makefile: Don't build benchmarks that depend on libdrm_intel.
On 2016-05-24 04:01 AM, Daniel Vetter wrote: On Mon, May 23, 2016 at 03:04:16PM +0100, Emil Velikov wrote: On Friday, May 20, 2016 23:59 BST, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> Use the HAS_INTEL automake flag to avoid building benchmarks that won't compile unless libdrm_intel is available in the build system. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- benchmarks/Makefile.sources | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/benchmarks/Makefile.sources b/benchmarks/Makefile.sources index 81607a5..26ee3ea 100644 --- a/benchmarks/Makefile.sources +++ b/benchmarks/Makefile.sources @@ -1,10 +1,6 @@ benchmarksdir=$(libexecdir)/intel-gpu-tools/benchmarks benchmarks_PROGRAMS = \ - intel_upload_blit_large \ - intel_upload_blit_large_gtt \ - intel_upload_blit_large_map \ - intel_upload_blit_small \ gem_blt \ gem_create \ gem_exec_ctx\ @@ -16,6 +12,15 @@ benchmarks_PROGRAMS =\ gem_prw \ gem_set_domain \ gem_syslatency \ - gem_userptr_benchmark \ kms_vblank \ $(NULL) + +if HAVE_INTEL + benchmarks_PROGRAMS += \ + intel_upload_blit_large \ + intel_upload_blit_large_gtt \ + intel_upload_blit_large_map \ + intel_upload_blit_small \ + gem_userptr_benchmark \ + $(NULL) +endif Some suggestions: - Please don't use conditionals in the Makefile.sources - you'll break the other build (Android) - instead of ^^ use separate variable and combine them in the Makefile.am/Android.mk - Don't double-indent, don't think any other place does so. Atm the other build is Intel-only, so I don't think it's that bad really - if we add a #define HAVE_INTEL there before including Makefile.sources (or whatever the make magic for this is). If someone wants to build igt on other Android machines that needs some extensions, but hey not my problem when Android wants to reinvent half of autoconf ;-) -Daniel For v2 I've implemented the changes as suggested by Emil, I've also added the (hopefully) equivalent changes to Arduino.mk. ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC i-g-t 8/9] lib: Replace intel specific header includes with intel_drm_stubs.h.
On 2016-05-24 04:07 AM, Daniel Vetter wrote: On Fri, May 20, 2016 at 06:59:32PM -0400, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> Replace intel specific header includes with intel_drm_stubs.h. The stubbed functions will all call igt_require(false) and cause a skip. Signed-off-by: Robert Foss <robert.f...@collabora.com> Do we need this sed job really? I kinda hoped we could have a dummy header somewhere, like lib/stubs/drm/i915_drm.h and similar (instead of your intel_drm_stubs.h), and then add lib/stubs/ to the include path when !HAVE_LIBDRM_INTEL? That way 0 changes to tests/lib itself should be needed. -Daniel This is a much cleaner solution, I've added it to v2. I'm somewhat worried about not having grokked the automake syntax for including the correct header files depending in HAVE_LIBDRM_INTEL though. Rob. --- lib/drmtest.c | 2 +- lib/gpgpu_fill.c| 7 +++ lib/igt_aux.c | 2 +- lib/igt_aux.h | 3 ++- lib/igt_debugfs.c | 4 ++-- lib/igt_draw.h | 3 +-- lib/igt_fb.h| 3 ++- lib/igt_kms.c | 3 +-- lib/intel_batchbuffer.c | 4 lib/intel_batchbuffer.h | 3 +-- lib/intel_chipset.c | 2 +- lib/ioctl_wrappers.c| 1 - lib/ioctl_wrappers.h| 4 ++-- lib/media_fill_gen7.c | 3 +-- lib/media_fill_gen8.c | 4 +--- lib/media_fill_gen8lp.c | 6 ++ lib/media_fill_gen9.c | 4 +--- lib/media_spin.c| 2 -- lib/rendercopy_gen6.c | 5 ++--- lib/rendercopy_gen7.c | 4 +--- lib/rendercopy_gen8.c | 4 +--- lib/rendercopy_gen9.c | 5 + lib/rendercopy_i830.c | 5 + lib/rendercopy_i915.c | 9 +++-- 24 files changed, 31 insertions(+), 61 deletions(-) diff --git a/lib/drmtest.c b/lib/drmtest.c index 7d6b74a..f043607 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -48,13 +48,13 @@ #include #include "drmtest.h" -#include "i915_drm.h" #include "intel_chipset.h" #include "intel_io.h" #include "igt_gt.h" #include "igt_debugfs.h" #include "version.h" #include "config.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #include "ioctl_wrappers.h" diff --git a/lib/gpgpu_fill.c b/lib/gpgpu_fill.c index 4d98643..62b1161 100644 --- a/lib/gpgpu_fill.c +++ b/lib/gpgpu_fill.c @@ -25,15 +25,14 @@ * Dominik Zeromski <dominik.zerom...@intel.com> */ -#include -#include -#include "intel_reg.h" #include "drmtest.h" -#include "intel_batchbuffer.h" #include "gen7_media.h" #include "gen8_media.h" #include "gpgpu_fill.h" +#include "intel_batchbuffer.h" +#include "intel_drm_stubs.h" +#include "intel_reg.h" /* shaders/gpgpu/gpgpu_fill.gxa */ static const uint32_t gen7_gpgpu_kernel[][4] = { diff --git a/lib/igt_aux.c b/lib/igt_aux.c index fe18365..772c902 100644 --- a/lib/igt_aux.c +++ b/lib/igt_aux.c @@ -52,12 +52,12 @@ #include #include "drmtest.h" -#include "i915_drm.h" #include "intel_chipset.h" #include "igt_aux.h" #include "igt_debugfs.h" #include "igt_gt.h" #include "config.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #include "ioctl_wrappers.h" #include "igt_kms.h" diff --git a/lib/igt_aux.h b/lib/igt_aux.h index f66de72..c66121b 100644 --- a/lib/igt_aux.h +++ b/lib/igt_aux.h @@ -28,10 +28,11 @@ #ifndef IGT_AUX_H #define IGT_AUX_H -#include #include #include +#include "intel_drm_stubs.h" + extern drm_intel_bo **trash_bos; extern int num_trash_bos; diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c index a32ed78..d9f371f 100644 --- a/lib/igt_debugfs.c +++ b/lib/igt_debugfs.c @@ -32,12 +32,12 @@ #include #include #include -#include #include "drmtest.h" +#include "intel_drm_stubs.h" #include "igt_aux.h" -#include "igt_kms.h" #include "igt_debugfs.h" +#include "igt_kms.h" /** * SECTION:igt_debugfs diff --git a/lib/igt_draw.h b/lib/igt_draw.h index b030131..c0e95ca 100644 --- a/lib/igt_draw.h +++ b/lib/igt_draw.h @@ -25,9 +25,8 @@ #ifndef __IGT_DRAW_H__ #define __IGT_DRAW_H__ -#include #include "igt_fb.h" - +#include "intel_drm_stubs.h" /** * igt_draw_method: * @IGT_DRAW_MMAP_CPU: draw using a CPU mmap. diff --git a/lib/igt_fb.h b/lib/igt_fb.h index ce2cc0f..82dbacb 100644 --- a/lib/igt_fb.h +++ b/lib/igt_fb.h @@ -38,10 +38,11 @@ typedef struct _cairo cairo_t; #include #include +#include #include #include -#include +#include "intel_drm_stubs.h" /* helpers to create nice-looking framebuffers */ struct igt_fb { diff --git a/lib/igt_kms.c b/lib/igt_kms.c ind
[Intel-gfx] Fwd: Re: [RFC i-g-t 2/2] overlay/Makefile: Don't try to build overlay if libpciaccess is unavailable.
Forward to ML. On Wed, May 25, 2016 at 02:43:59PM -0400, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> Don't try to build overlay if libpciaccess is unavailable. This is useful for platforms that typically don't have pci hardware, like ARM platforms. Ok, I should be able to make the dependency optional. -Chris -- Chris Wilson, Intel Open Source Technology Centre ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] Fwd: Re: [RFC i-g-t 1/7] configure.ac: Test for libdrm_intel and build for it if present.
Forward to ML. On Wednesday, May 25, 2016 19:18 BST, robert.f...@collabora.com wrote: +if test "x$INTEL" = xyes; then + PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel >= 2.4.64]) + AC_DEFINE(HAVE_LIBDRM_INTEL, 1, [Have intel support]) +fi +AM_CONDITIONAL(HAVE_LIBDRM_INTEL, [test "x$INTEL" = xyes]) + Strictly speaking we could add the DRM_INTEL_CFLAGS to pretty much every Makefile.am (in AM_CFLAGS) and LIBDRM_INTEL_LIBS (*LDADD and/or *LIBADD) only within the HAVE_LIBDRM_INTEL conditional. Although to make things a bit easier, we can/should move the CFLAGS out of the conditional. This way: - building with intel gets the correct cflags (and link) - building without intel - gets the local cflags (include) and no link (in case the variable is already set to something funny). -Emil ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] Fwd: Re: [RFC i-g-t 7/7] lib/stubs: Add stubs for intel_bufmgr.
Forward to ML. On Wednesday, May 25, 2016 19:18 BST, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> This patch provides stubs for functionality otherwise provided by intel_bufmgr. The stubbed functions all fail with a call to igt_require_f(false,""). Defines and enums have been copied from libdrm_intel. Due to the stubbed tests failing with an igt_require_f() call, these stubs are not well suited for non-tests, since tools/benchmarks/etc 'skipping' execution is unhelpful. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/Makefile.am | 7 + lib/stubs/drm/intel_bufmgr.c | 275 +++ lib/stubs/drm/intel_bufmgr.h | 430 +++ 3 files changed, 712 insertions(+) create mode 100644 lib/stubs/drm/intel_bufmgr.c create mode 100644 lib/stubs/drm/intel_bufmgr.h And now the final piece... diff --git a/lib/Makefile.am b/lib/Makefile.am index d2ae98d..3e12f25 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -14,6 +14,13 @@ if HAVE_LIBDRM_VC4 igt_vc4.h endif Not sure how one can do this gradually so here's the overall result... Actually we can do it with a lot less churn props to the following. I should comment on 1/7 though as it's missing some bits. --- a/configure.ac +++ b/configure.ac @@ -155,6 +155,9 @@ PKG_CHECK_MODULES(GLIB, glib-2.0) if test "x$INTEL" = xyes; then PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel >= 2.4.64]) AC_DEFINE(HAVE_LIBDRM_INTEL, 1, [Have intel support]) +else + DRM_INTEL_CFLAGS=$(top_srcdir)/lib/stubs/drm/ + AC_SUBST([DRM_INTEL_CFLAGS]) fi AM_CONDITIONAL(HAVE_LIBDRM_INTEL, [test "x$INTEL" = xyes]) +if HAVE_LIBDRM_INTEL +else Just drop the conditional ? The if guard within the source file is enough. +libintel_tools_la_SOURCES += \ +stubs/drm/intel_bufmgr.c \ +stubs/drm/intel_bufmgr.h +endif + AM_CPPFLAGS = -I$(top_srcdir) AM_CFLAGS = $(CWARNFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(LIBUNWIND_CFLAGS) $(DEBUG_CFLAGS) \ -DIGT_SRCDIR=\""$(abs_top_srcdir)/tests"\" \ diff --git a/lib/stubs/drm/intel_bufmgr.c b/lib/stubs/drm/intel_bufmgr.c new file mode 100644 index 000..eaf1b3e --- /dev/null +++ b/lib/stubs/drm/intel_bufmgr.c @@ -0,0 +1,275 @@ +#ifndef HAVE_LIBDRM_INTEL + +#include +#include +#include +#include + +#include "igt_core.h" +#include "intel_bufmgr.h" + Not sure if we need all those includes. I'm leaning that at least stdint and stdbool should do. Please double-check. + +drm_intel_bufmgr *drm_intel_bufmgr_gem_init(int fd, int batch_size) +{ + igt_require_f(false, "Not compiled with libdrm_intel support\n"); Ideally you want something like (you might get away without the "%s") igt_require_f(false, "%s", compiled_without_libdrm_intel_msg); And declare the variable at the top static const char *compiled_without_libdrm_intel_msg = "Not compiled with libdrm_intel support\n"; Otherwise you'll end up with dozens of instances of the exact same string. +} + +#endif//HAVE_LIBDRM_INTEL Space around // diff --git a/lib/stubs/drm/intel_bufmgr.h b/lib/stubs/drm/intel_bufmgr.h new file mode 100644 index 000..12bce60 --- /dev/null +++ b/lib/stubs/drm/intel_bufmgr.h @@ -0,0 +1,430 @@ +#ifndef INTEL_DRM_STUBS_H +#define INTEL_DRM_STUBS_H + This file should be an exact copy of the one provided by libdrm_intel. You want to add a README here and/or update the RELEASING document to remind people to check/resync the file before release. Ideally as a follow up commit. -Emil ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] Fwd: Re: [RFC i-g-t 6/7] demos/Makefile: Don't build tools that depend on libdrm_intel.
On Wednesday, May 25, 2016 19:18 BST, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> Use the HAS_INTEL automake flag to avoid building tools that won't compile unless libdrm_intel is available in the build system. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- demos/Android.mk | 5 - demos/Makefile.am | 8 +--- demos/Makefile.sources | 7 +++ 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 demos/Makefile.sources diff --git a/demos/Android.mk b/demos/Android.mk index 7d06c9a..add2414 100644 --- a/demos/Android.mk +++ b/demos/Android.mk @@ -4,8 +4,11 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_SRC_FILES := intel_sprite_on.c +LOCAL_SRC_FILES := +ifeq ($(HAVE_LIBDRM_INTEL),true) +LOCAL_SRC_FILES += $(LIBDRM_INTEL_BIN) +endif Note for the future, you don't have to do anything. As/if one tries to get IGT on Android without libdrm_intel and there aren't any non-intel demos, the guard should cover the whole file. I doubt their build system will be happy if you request a program with no sources and just static library. -Emil ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] Fwd: Re: [RFC i-g-t 5/7] tools/Makefile: Format whitespace.
On Wednesday, May 25, 2016 19:18 BST, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> Harmonize tabs/spaces etc. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tools/Makefile.sources | 57 +- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/tools/Makefile.sources b/tools/Makefile.sources index 07d8d9b..7ed5fe5 100644 --- a/tools/Makefile.sources +++ b/tools/Makefile.sources @@ -1,33 +1,34 @@ -noinst_PROGRAMS = \ - hsw_compute_wrpll \ - skl_compute_wrpll \ - skl_ddb_allocation \ +noinst_PROGRAMS = \ + hsw_compute_wrpll \ + skl_compute_wrpll \ + skl_ddb_allocation \ $(NULL) And this is why ladies and gentlemen you don't align on the \ character. As one adds a test/file with long name, you'll need to re-indent the whole lot. Then again... people like these, for whatever reason :-( -Emil ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC i-g-t 3/7] benchmarks/Makefile: Don't build benchmarks that depend on libdrm_intel.
Forward to ML. On 2016-05-25 03:55 PM, Emil Velikov wrote: On Wednesday, May 25, 2016 19:18 BST, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> Use the HAS_INTEL automake flag to avoid building benchmarks that won't compile unless libdrm_intel is available in the build system. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- benchmarks/Android.mk | 6 ++ benchmarks/Makefile.am | 5 - benchmarks/Makefile.sources | 14 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk index 207a177..08b6816 100644 --- a/benchmarks/Android.mk +++ b/benchmarks/Android.mk @@ -34,4 +34,10 @@ endef benchmark_list := $(benchmarks_PROGRAMS) +ifeq ($(HAVE_LIBDRM_INTEL),true) +benchmark_list += $(LIBDRM_INTEL_BENCHMARKS) +endif + + + Add just one blank line. Yet again... one should set HAVE_LIBDRM_INTEL so that things don't regress/change. Something like the following should do it --- a/Android.mk +++ b/Android.mk @@ -1,2 +1,4 @@ +HAVE_LIBDRM_INTEL := true + include $(call all-named-subdir-makefiles, lib tests tools benchmarks) I'd keep ^^ either as separate patch (1.1/7) or just fold it into 1/7 and update the commit message. $(foreach item,$(benchmark_list),$(eval $(call add_benchmark,$(item diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am index 49d2f64..7400dd0 100644 --- a/benchmarks/Makefile.am +++ b/benchmarks/Makefile.am @@ -1,6 +1,9 @@ - include Makefile.sources +if HAVE_LIBDRM_INTEL + benchmarks_PROGRAMS += $(LIBDRM_INTEL_BENCHMARKS) +endif + This is absolutely correct, sadly the existing Makefile.sources (ab)use makes things hard to grasp. The 'hard to grasp' part being - this (and other) Makefile.am files are missing the definition of the *PROGRAMS, *LTLIBRARIES, etc. variables thus the whole file (and this hunk and particular makes things harder to read. Ideally one will give clearer (non-autoconf specific) names of the variables in the Makefile.sources and move the PROGRAMS... bits into Makefile.am. That is rather evasive so I'm not sure if you're up for it. Example (note it has some ~unrelated comments/nitpicks) diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk index 207a177..dfe34bc 100644 --- a/benchmarks/Android.mk +++ b/benchmarks/Android.mk @@ -32,6 +32,6 @@ endef ## -benchmark_list := $(benchmarks_PROGRAMS) +benchmark_list := $(benchmarks_prog_list) $(foreach item,$(benchmark_list),$(eval $(call add_benchmark,$(item diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am index 2c2d100..5396db1 100644 --- a/benchmarks/Makefile.am +++ b/benchmarks/Makefile.am @@ -3,15 +3,23 @@ include Makefile.sources AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) + +benchmarks_PROGRAMS = $(benchmarks_prog_list) LDADD = $(top_builddir)/lib/libintel_tools.la +# Sees to be unused by IGT. Add a comment and move it after gem_foo +benchmarksdir=$(libexecdir)/intel-gpu-tools/benchmarks benchmarks_LTLIBRARIES = gem_exec_tracer.la gem_exec_tracer_la_LDFLAGS = -module -avoid-version -no-undefined +# there should be a detection in configure.ac as some platforms don't use/have libdl.so gem_exec_tracer_la_LIBADD = -ldl +# one could/should use AX_PTHREADS in configure and PTHREAD_CFLAGS/PTHREAD_LIBS through the project. +# unless they use pthread and don't strictly require the locking. then they can use the pthread-stubs package. gem_latency_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) gem_latency_LDADD = $(LDADD) -lpthread gem_syslatency_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) gem_syslatency_LDADD = $(LDADD) -lpthread -lrt +# spaces around = ? EXTRA_DIST=README diff --git a/benchmarks/Makefile.sources b/benchmarks/Makefile.sources index 81607a5..51f59e5 100644 --- a/benchmarks/Makefile.sources +++ b/benchmarks/Makefile.sources @@ -1,6 +1,4 @@ -benchmarksdir=$(libexecdir)/intel-gpu-tools/benchmarks - -benchmarks_PROGRAMS = \ +benchmarks_prog_list = \ intel_upload_blit_large \ intel_upload_blit_large_gtt \ intel_upload_blit_large_map \ --- a/benchmarks/Makefile.sources +++ b/benchmarks/Makefile.sources @@ -1,10 +1,7 @@ benchmarksdir=$(libexecdir)/intel-gpu-tools/benchmarks + Please don't add unneeded whitespace changes. +LIBDRM_INTEL_BENCHMARKS = \ With the above suggestions in place this could become intel_benchmarks_prog_list. Don't think there's a difference between upper/lower case and/or short/long names. Go with what IGT people are happy. -Emil ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] Fwd: Re: [RFC i-g-t 4/7] tools/Makefile: Don't build tools that depend on libdrm_intel.
From: Robert Foss <robert.f...@collabora.com> Use the HAS_INTEL automake flag to avoid building tools that won't compile unless libdrm_intel is available in the build system. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tools/Android.mk | 8 tools/Makefile.am | 8 tools/Makefile.sources | 16 ++-- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/tools/Android.mk b/tools/Android.mk index 5f64184..7c99432 100644 --- a/tools/Android.mk +++ b/tools/Android.mk @@ -67,6 +67,14 @@ ifneq ("${ANDROID_HAS_CAIRO}", "1") skip_tools_list += intel_residency endif +ifeq ($(HAVE_LIBDRM_INTEL),true) +bin_PROGRAMS += $(LIBDRM_INTEL_BIN) + +intel_dump_decode_SOURCES =intel_dump_decode.c +intel_error_decode_SOURCES = intel_error_decode.c Drop these two lines all together. The default extension for autoconf is .c, thus just mentionoing the program name will automatically pick the above sources respectively. On the Android build the function add_tool (a few lines above) already does it for us. +intel_error_decode_LDFLAGS = -lz Seems like I was wrong about this one... Android does use it (despite that it looks a bit ugly). Thus one can keep it where it was. -Emil ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] Fwd: Re: [RFC i-g-t 5/7] tools/Makefile: Format whitespace.
Forward to ML. On Wednesday, May 25, 2016 21:04 BST, Robert Foss <robert.f...@collabora.com> wrote: > And this is why ladies and gentlemen you don't align on the \ character. As one adds a test/file with long name, you'll need to re-indent the whole lot. Then again... people like these, for whatever reason :-( > > -Emil I don't have particularly strong feelings about the patch, but it does harmonize the formatting. I'll happily drop if if anyone feels I should. I think they'll like/keep it. Despite that I (sometimes) think that that the patch makes things looks prettier, I'd rather devote resources into something that's of more value ;-) And adding/removing whitespace isn't the one. -Emil ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t 7/7] lib/stubs: Add stubs for intel_bufmgr.
From: Robert Foss <robert.f...@collabora.com> This patch provides stubs for functionality otherwise provided by intel_bufmgr. The stubbed functions all fail with a call to igt_require_f(false,""). Defines and enums have been copied from libdrm_intel. Due to the stubbed tests failing with an igt_require_f() call, these stubs are not well suited for non-tests, since tools/benchmarks/etc 'skipping' execution is unhelpful. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/Makefile.am | 7 + lib/stubs/drm/intel_bufmgr.c | 275 +++ lib/stubs/drm/intel_bufmgr.h | 430 +++ 3 files changed, 712 insertions(+) create mode 100644 lib/stubs/drm/intel_bufmgr.c create mode 100644 lib/stubs/drm/intel_bufmgr.h diff --git a/lib/Makefile.am b/lib/Makefile.am index d2ae98d..3e12f25 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -14,6 +14,13 @@ if HAVE_LIBDRM_VC4 igt_vc4.h endif +if HAVE_LIBDRM_INTEL +else +libintel_tools_la_SOURCES += \ +stubs/drm/intel_bufmgr.c \ +stubs/drm/intel_bufmgr.h +endif + AM_CPPFLAGS = -I$(top_srcdir) AM_CFLAGS = $(CWARNFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(LIBUNWIND_CFLAGS) $(DEBUG_CFLAGS) \ -DIGT_SRCDIR=\""$(abs_top_srcdir)/tests"\" \ diff --git a/lib/stubs/drm/intel_bufmgr.c b/lib/stubs/drm/intel_bufmgr.c new file mode 100644 index 000..eaf1b3e --- /dev/null +++ b/lib/stubs/drm/intel_bufmgr.c @@ -0,0 +1,275 @@ +#ifndef HAVE_LIBDRM_INTEL + +#include +#include +#include +#include + +#include "igt_core.h" +#include "intel_bufmgr.h" + + +drm_intel_bufmgr *drm_intel_bufmgr_gem_init(int fd, int batch_size) +{ + igt_require_f(false, "Not compiled with libdrm_intel support\n"); + return (drm_intel_bufmgr *) NULL; +} + +void drm_intel_bo_unreference(drm_intel_bo *bo) +{ + igt_require_f(false, "Not compiled with libdrm_intel support\n"); +} + +drm_intel_bo *drm_intel_bo_alloc(drm_intel_bufmgr *bufmgr, const char *name, +unsigned long size, unsigned int alignment) +{ + igt_require_f(false, "Not compiled with libdrm_intel support\n"); + return (drm_intel_bo *) NULL; +} + +int drm_intel_bo_subdata(drm_intel_bo *bo, unsigned long offset, +unsigned long size, const void *data) +{ + igt_require_f(false, "Not compiled with libdrm_intel support\n"); + return 0; +} + +int drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx, + int used, unsigned int flags) +{ + igt_require_f(false, "Not compiled with libdrm_intel support\n"); + return 0; +} + +int drm_intel_bo_emit_reloc(drm_intel_bo *bo, uint32_t offset, + drm_intel_bo *target_bo, uint32_t target_offset, + uint32_t read_domains, uint32_t write_domain) +{ + igt_require_f(false, "Not compiled with libdrm_intel support\n"); + return 0; +} + +int drm_intel_bo_emit_reloc_fence(drm_intel_bo *bo, uint32_t offset, + drm_intel_bo *target_bo, + uint32_t target_offset, + uint32_t read_domains, uint32_t write_domain) +{ + igt_require_f(false, "Not compiled with libdrm_intel support\n"); + return 0; +} + +int drm_intel_bo_get_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, + uint32_t * swizzle_mode) +{ + igt_require_f(false, "Not compiled with libdrm_intel support\n"); + return 0; +} + +int drm_intel_bo_mrb_exec(drm_intel_bo *bo, int used, + struct drm_clip_rect *cliprects, int num_cliprects, + int DR4, unsigned int flags) +{ + igt_require_f(false, "Not compiled with libdrm_intel support\n"); + return 0; +} + +void drm_intel_bufmgr_gem_set_aub_annotations(drm_intel_bo *bo, + drm_intel_aub_annotation *annotations, + unsigned count) +{ + igt_require_f(false, "Not compiled with libdrm_intel support\n"); +} + +void drm_intel_bufmgr_gem_enable_reuse(drm_intel_bufmgr *bufmgr) +{ + igt_require_f(false, "Not compiled with libdrm_intel support\n"); +} + +int drm_intel_bo_exec(drm_intel_bo *bo, int used, + struct drm_clip_rect *cliprects, int num_cliprects, int DR4) +{ + igt_require_f(false, "Not compiled with libdrm_intel support\n"); + return 0; +} + +void drm_intel_bufmgr_destroy(drm_intel_bufmgr *bufmgr) +{ + igt_require_f(false, "Not compiled with libdrm_intel support\n"); +} + +void drm_intel_bo_wait_rendering(drm_intel_bo *bo) +{ + igt_requ
[Intel-gfx] [RFC i-g-t 5/7] tools/Makefile: Format whitespace.
From: Robert Foss <robert.f...@collabora.com> Harmonize tabs/spaces etc. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tools/Makefile.sources | 57 +- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/tools/Makefile.sources b/tools/Makefile.sources index 07d8d9b..7ed5fe5 100644 --- a/tools/Makefile.sources +++ b/tools/Makefile.sources @@ -1,33 +1,34 @@ -noinst_PROGRAMS = \ - hsw_compute_wrpll \ - skl_compute_wrpll \ - skl_ddb_allocation \ +noinst_PROGRAMS = \ + hsw_compute_wrpll \ + skl_compute_wrpll \ + skl_ddb_allocation \ $(NULL) -bin_PROGRAMS = \ - igt_stats \ - intel_audio_dump\ - intel_reg \ - intel_backlight \ - intel_bios_dumper \ - intel_bios_reader \ - intel_display_crc \ - intel_display_poller\ - intel_forcewaked\ - intel_gpu_frequency \ - intel_firmware_decode \ - intel_gpu_time \ - intel_gpu_top \ - intel_gtt \ - intel_infoframes\ - intel_l3_parity \ - intel_lid \ - intel_opregion_decode \ - intel_panel_fitter \ - intel_reg_checker \ - intel_residency \ - intel_stepping \ - intel_watermark +bin_PROGRAMS = \ + igt_stats \ + intel_audio_dump\ + intel_reg \ + intel_backlight \ + intel_bios_dumper \ + intel_bios_reader \ + intel_display_crc \ + intel_display_poller\ + intel_forcewaked\ + intel_gpu_frequency \ + intel_firmware_decode \ + intel_gpu_time \ + intel_gpu_top \ + intel_gtt \ + intel_infoframes\ + intel_l3_parity \ + intel_lid \ + intel_opregion_decode \ + intel_panel_fitter \ + intel_reg_checker \ + intel_residency \ + intel_stepping \ + intel_watermark \ + $(NULL) dist_bin_SCRIPTS = intel_gpu_abrt -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t 0/7] Remove compile time depencencies on libdrm_intel.
From: Robert Foss <robert.f...@collabora.com> Changes since v1: - Replaced the automake flags HAVE_VC4/NOUVEAU/INTEL with HAVE_LIBDRM_XXX. - Move conditionals from Makefile.sources to Arduino.mk/Makefile.am. - Removed duplicated i915_drm.h symbols from intel_drm_stubs.h. - Replaced igt_require with igt_require_f to communicate stubs being the cause of failure. - Rename intel_drm_stubs to intel_bufmgr. - Moved intel_bufmgr to lib/stubs/drm. - Remove header inclusion changes in favor for inclusion of stubs in lib/stubs/drm using build scripts. - Rebased on trunk. Robert Foss (7): configure.ac: Test for libdrm_intel and build for it if present. configure.ac: Harmonize HAVE_XXX flag for all drm platforms to HAVE_LIBDRM_XXX. benchmarks/Makefile: Don't build benchmarks that depend on libdrm_intel. tools/Makefile: Don't build tools that depend on libdrm_intel. tools/Makefile: Format whitespace. demos/Makefile: Don't build tools that depend on libdrm_intel. lib/stubs: Add stubs for intel_bufmgr. benchmarks/Android.mk| 6 + benchmarks/Makefile.am | 5 +- benchmarks/Makefile.sources | 14 +- configure.ac | 22 ++- demos/Android.mk | 5 +- demos/Makefile.am| 8 +- demos/Makefile.sources | 7 + lib/Makefile.am | 9 +- lib/stubs/drm/intel_bufmgr.c | 275 +++ lib/stubs/drm/intel_bufmgr.h | 430 +++ tests/Makefile.am| 4 +- tools/Android.mk | 8 + tools/Makefile.am| 8 + tools/Makefile.sources | 73 14 files changed, 818 insertions(+), 56 deletions(-) create mode 100644 demos/Makefile.sources create mode 100644 lib/stubs/drm/intel_bufmgr.c create mode 100644 lib/stubs/drm/intel_bufmgr.h -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t 2/7] configure.ac: Harmonize HAVE_XXX flag for all drm platforms to HAVE_LIBDRM_XXX.
From: Robert Foss <robert.f...@collabora.com> Replace the automake flag HAVE_XXX for VC4/NOUVEAU with HAVE_LIBDRM_XXX in order for the flags to be more descriptive and also follow the same convention as HAVE_LIBDRM_INTEL. --- configure.ac | 8 lib/Makefile.am | 2 +- tests/Makefile.am | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 48d81c5..e27698b 100644 --- a/configure.ac +++ b/configure.ac @@ -171,9 +171,9 @@ if test "x$NOUVEAU" = xauto; then fi if test "x$NOUVEAU" = xyes; then PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33]) - AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau support]) + AC_DEFINE(HAVE_LIBDRM_NOUVEAU, 1, [Have nouveau support]) fi -AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes]) +AM_CONDITIONAL(HAVE_LIBDRM_NOUVEAU, [test "x$NOUVEAU" = xyes]) AC_ARG_ENABLE(vc4, AS_HELP_STRING([--disable-vc4], [Enable building of vc4 tests (default: auto)]), @@ -183,9 +183,9 @@ if test "x$VC4" = xauto; then fi if test "x$VC4" = xyes; then PKG_CHECK_MODULES(DRM_VC4, [libdrm_vc4]) - AC_DEFINE(HAVE_VC4, 1, [Have vc4 support]) + AC_DEFINE(HAVE_LIBDRM_VC4, 1, [Have vc4 support]) fi -AM_CONDITIONAL(HAVE_VC4, [test "x$VC4" = xyes]) +AM_CONDITIONAL(HAVE_LIBDRM_VC4, [test "x$VC4" = xyes]) # Define a configure option for the shader debugger AC_ARG_ENABLE(shader-debugger, AS_HELP_STRING([--enable-shader-debugger], diff --git a/lib/Makefile.am b/lib/Makefile.am index d2f2e16..d2ae98d 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -8,7 +8,7 @@ include Makefile.sources noinst_LTLIBRARIES = libintel_tools.la noinst_HEADERS = check-ndebug.h -if HAVE_VC4 +if HAVE_LIBDRM_VC4 libintel_tools_la_SOURCES += \ igt_vc4.c \ igt_vc4.h diff --git a/tests/Makefile.am b/tests/Makefile.am index c2c2025..737afbe 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,10 +1,10 @@ include Makefile.sources -if HAVE_NOUVEAU +if HAVE_LIBDRM_NOUVEAU TESTS_progs_M += $(NOUVEAU_TESTS_M) endif -if HAVE_VC4 +if HAVE_LIBDRM_VC4 TESTS_progs_M += $(VC4_TESTS_M) endif -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t 1/7] configure.ac: Test for libdrm_intel and build for it if present.
From: Robert Foss <robert.f...@collabora.com> Test for libdrm_intel and build for it if present. Also expose the HAVE_INTEL #define to allow code to be conditionally compiled. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- configure.ac | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 11b1d46..48d81c5 100644 --- a/configure.ac +++ b/configure.ac @@ -100,7 +100,7 @@ if test "x$GCC" = "xyes"; then fi AC_SUBST(ASSEMBLER_WARN_CFLAGS) -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.64 libdrm]) +PKG_CHECK_MODULES(DRM, [libdrm]) PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) case "$target_cpu" in @@ -150,6 +150,18 @@ PKG_CHECK_MODULES(GLIB, glib-2.0) # - # Configuration options # - +AC_ARG_ENABLE(intel, AS_HELP_STRING([--disable-intel], + [Enable building of intel specific parts (default: auto)]), + [INTEL=$enableval], [INTEL=auto]) +if test "x$INTEL" = xauto; then + PKG_CHECK_EXISTS([libdrm_intel >= 2.4.64], [INTEL=yes], [INTEL=no]) +fi +if test "x$INTEL" = xyes; then + PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel >= 2.4.64]) + AC_DEFINE(HAVE_LIBDRM_INTEL, 1, [Have intel support]) +fi +AM_CONDITIONAL(HAVE_LIBDRM_INTEL, [test "x$INTEL" = xyes]) + # for dma-buf tests AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau], [Enable use of nouveau API for prime tests (default: auto)]), -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t 4/7] tools/Makefile: Don't build tools that depend on libdrm_intel.
From: Robert Foss <robert.f...@collabora.com> Use the HAS_INTEL automake flag to avoid building tools that won't compile unless libdrm_intel is available in the build system. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tools/Android.mk | 8 tools/Makefile.am | 8 tools/Makefile.sources | 16 ++-- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/tools/Android.mk b/tools/Android.mk index 5f64184..7c99432 100644 --- a/tools/Android.mk +++ b/tools/Android.mk @@ -67,6 +67,14 @@ ifneq ("${ANDROID_HAS_CAIRO}", "1") skip_tools_list += intel_residency endif +ifeq ($(HAVE_LIBDRM_INTEL),true) +bin_PROGRAMS += $(LIBDRM_INTEL_BIN) + +intel_dump_decode_SOURCES =intel_dump_decode.c +intel_error_decode_SOURCES = intel_error_decode.c +intel_error_decode_LDFLAGS = -lz +endif + tools_list := $(filter-out $(skip_tools_list),$(bin_PROGRAMS)) $(foreach item,$(tools_list),$(eval $(call add_tool,$(item diff --git a/tools/Makefile.am b/tools/Makefile.am index 5f45144..bf2511d 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,5 +1,13 @@ include Makefile.sources +if HAVE_LIBDRM_INTEL + bin_PROGRAMS += $(LIBDRM_INTEL_BIN) + + intel_dump_decode_SOURCES = intel_dump_decode.c + intel_error_decode_SOURCES = intel_error_decode.c + intel_error_decode_LDFLAGS = -lz +endif + SUBDIRS = null_state_gen registers AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib diff --git a/tools/Makefile.sources b/tools/Makefile.sources index 5d5958d..07d8d9b 100644 --- a/tools/Makefile.sources +++ b/tools/Makefile.sources @@ -13,11 +13,8 @@ bin_PROGRAMS = \ intel_bios_reader \ intel_display_crc \ intel_display_poller\ - intel_dump_decode \ - intel_error_decode \ intel_forcewaked\ intel_gpu_frequency \ - intel_framebuffer_dump \ intel_firmware_decode \ intel_gpu_time \ intel_gpu_top \ @@ -27,7 +24,6 @@ bin_PROGRAMS =\ intel_lid \ intel_opregion_decode \ intel_panel_fitter \ - intel_perf_counters \ intel_reg_checker \ intel_residency \ intel_stepping \ @@ -35,8 +31,12 @@ bin_PROGRAMS = \ dist_bin_SCRIPTS = intel_gpu_abrt -intel_dump_decode_SOURCES =\ - intel_dump_decode.c +LIBDRM_INTEL_BIN = \ + intel_dump_decode \ + intel_error_decode \ + intel_framebuffer_dump \ + intel_perf_counters \ + $(NULL) intel_reg_SOURCES =\ intel_reg.c \ @@ -44,10 +44,6 @@ intel_reg_SOURCES = \ intel_reg_spec.c\ intel_reg_spec.h -intel_error_decode_SOURCES = \ - intel_error_decode.c -intel_error_decode_LDFLAGS = -lz - intel_bios_reader_SOURCES =\ intel_bios_reader.c \ intel_bios.h -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t v3 06/13] tools/Makefile: Format whitespace.
From: Robert Foss <robert.f...@collabora.com> Harmonize tabs/spaces etc. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tools/Makefile.sources | 57 +- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/tools/Makefile.sources b/tools/Makefile.sources index 07d8d9b..7ed5fe5 100644 --- a/tools/Makefile.sources +++ b/tools/Makefile.sources @@ -1,33 +1,34 @@ -noinst_PROGRAMS = \ - hsw_compute_wrpll \ - skl_compute_wrpll \ - skl_ddb_allocation \ +noinst_PROGRAMS = \ + hsw_compute_wrpll \ + skl_compute_wrpll \ + skl_ddb_allocation \ $(NULL) -bin_PROGRAMS = \ - igt_stats \ - intel_audio_dump\ - intel_reg \ - intel_backlight \ - intel_bios_dumper \ - intel_bios_reader \ - intel_display_crc \ - intel_display_poller\ - intel_forcewaked\ - intel_gpu_frequency \ - intel_firmware_decode \ - intel_gpu_time \ - intel_gpu_top \ - intel_gtt \ - intel_infoframes\ - intel_l3_parity \ - intel_lid \ - intel_opregion_decode \ - intel_panel_fitter \ - intel_reg_checker \ - intel_residency \ - intel_stepping \ - intel_watermark +bin_PROGRAMS = \ + igt_stats \ + intel_audio_dump\ + intel_reg \ + intel_backlight \ + intel_bios_dumper \ + intel_bios_reader \ + intel_display_crc \ + intel_display_poller\ + intel_forcewaked\ + intel_gpu_frequency \ + intel_firmware_decode \ + intel_gpu_time \ + intel_gpu_top \ + intel_gtt \ + intel_infoframes\ + intel_l3_parity \ + intel_lid \ + intel_opregion_decode \ + intel_panel_fitter \ + intel_reg_checker \ + intel_residency \ + intel_stepping \ + intel_watermark \ + $(NULL) dist_bin_SCRIPTS = intel_gpu_abrt -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t v3 09/13] demos/Makefile: Replace automake specific name of listing in Makfile.sources
From: Robert Foss <robert.f...@collabora.com> Replace the automake specific name of listings in Makefile.sources with something not automake specific. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- demos/Android.mk | 2 +- demos/Makefile.am | 2 ++ demos/Makefile.sources | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/demos/Android.mk b/demos/Android.mk index add2414..90d8b37 100644 --- a/demos/Android.mk +++ b/demos/Android.mk @@ -4,7 +4,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_SRC_FILES := +LOCAL_SRC_FILES := $(demos_prog_lists) ifeq ($(HAVE_LIBDRM_INTEL),true) LOCAL_SRC_FILES += $(LIBDRM_INTEL_BIN) diff --git a/demos/Makefile.am b/demos/Makefile.am index 48eb6c2..fe0ff1f 100644 --- a/demos/Makefile.am +++ b/demos/Makefile.am @@ -1,5 +1,7 @@ include Makefile.sources +bin_PROGRAMS = $(demos_prog_list) + if HAVE_LIBDRM_INTEL bin_PROGRAMS += $(LIBDRM_INTEL_BIN) endif diff --git a/demos/Makefile.sources b/demos/Makefile.sources index 302f6d9..31f7f83 100644 --- a/demos/Makefile.sources +++ b/demos/Makefile.sources @@ -1,4 +1,4 @@ -bin_PROGRAMS = \ +demos_prog_list = \ $(NULL) HAVE_LIBDRM_INTEL_BIN =\ -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t v3 01/13] configure.ac: Test for libdrm_intel and build for it if present.
From: Robert Foss <robert.f...@collabora.com> Test for libdrm_intel and build for it if present. Also expose the HAVE_INTEL #define to allow code to be conditionally compiled. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- configure.ac | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0405c8b..49903e4 100644 --- a/configure.ac +++ b/configure.ac @@ -100,7 +100,7 @@ if test "x$GCC" = "xyes"; then fi AC_SUBST(ASSEMBLER_WARN_CFLAGS) -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.64 libdrm]) +PKG_CHECK_MODULES(DRM, [libdrm]) PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) case "$target_cpu" in @@ -150,6 +150,21 @@ PKG_CHECK_MODULES(GLIB, glib-2.0) # - # Configuration options # - +AC_ARG_ENABLE(intel, AS_HELP_STRING([--disable-intel], + [Enable building of intel specific parts (default: auto)]), + [INTEL=$enableval], [INTEL=auto]) +if test "x$INTEL" = xauto; then + PKG_CHECK_EXISTS([libdrm_intel >= 2.4.64], [INTEL=yes], [INTEL=no]) +fi +if test "x$INTEL" = xyes; then + PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel >= 2.4.64]) + AC_DEFINE(HAVE_LIBDRM_INTEL, 1, [Have intel support]) +else + DRM_INTEL_CFLAGS=$(top_srcdir)/lib/stubs/drm/ + AC_SUBST([DRM_INTEL_CFLAGS]) +fi +AM_CONDITIONAL(HAVE_LIBDRM_INTEL, [test "x$INTEL" = xyes]) + # for dma-buf tests AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau], [Enable use of nouveau API for prime tests (default: auto)]), -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t v3 10/13] benchmarks/Makefile: Replace automake specific name of listing in Makfile.sources
From: Robert Foss <robert.f...@collabora.com> Replace the automake specific name of listings in Makefile.sources with something not automake specific. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- benchmarks/Android.mk | 2 +- benchmarks/Makefile.am | 2 ++ benchmarks/Makefile.sources | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk index 22ecd2f..147f5db 100644 --- a/benchmarks/Android.mk +++ b/benchmarks/Android.mk @@ -32,7 +32,7 @@ endef ## -benchmark_list := $(benchmarks_PROGRAMS) +benchmark_list := $(benchmarks_prog_list) ifeq ($(HAVE_LIBDRM_INTEL),true) benchmark_list += $(LIBDRM_INTEL_BENCHMARKS) diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am index 7400dd0..8ae3cb3 100644 --- a/benchmarks/Makefile.am +++ b/benchmarks/Makefile.am @@ -1,5 +1,7 @@ include Makefile.sources +benchmarks_PROGRAMS = $(benchmarks_prog_list) + if HAVE_LIBDRM_INTEL benchmarks_PROGRAMS += $(LIBDRM_INTEL_BENCHMARKS) endif diff --git a/benchmarks/Makefile.sources b/benchmarks/Makefile.sources index 5804d3b..8fb342a 100644 --- a/benchmarks/Makefile.sources +++ b/benchmarks/Makefile.sources @@ -1,6 +1,6 @@ benchmarksdir=$(libexecdir)/intel-gpu-tools/benchmarks -benchmarks_PROGRAMS = \ +benchmarks_prog_list = \ gem_blt \ gem_create \ gem_exec_ctx\ -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t v3 05/13] tools/Makefile: Don't build tools that depend on libdrm_intel.
From: Robert Foss <robert.f...@collabora.com> Use the HAS_INTEL automake flag to avoid building tools that won't compile unless libdrm_intel is available in the build system. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tools/Android.mk | 5 + tools/Makefile.am | 5 + tools/Makefile.sources | 16 ++-- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/tools/Android.mk b/tools/Android.mk index 5f64184..306a4b5 100644 --- a/tools/Android.mk +++ b/tools/Android.mk @@ -67,6 +67,11 @@ ifneq ("${ANDROID_HAS_CAIRO}", "1") skip_tools_list += intel_residency endif +ifeq ($(HAVE_LIBDRM_INTEL),true) +bin_PROGRAMS += $(LIBDRM_INTEL_BIN) +intel_error_decode_LDFLAGS = -lz +endif + tools_list := $(filter-out $(skip_tools_list),$(bin_PROGRAMS)) $(foreach item,$(tools_list),$(eval $(call add_tool,$(item diff --git a/tools/Makefile.am b/tools/Makefile.am index 5f45144..f8ac0d8 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,5 +1,10 @@ include Makefile.sources +if HAVE_LIBDRM_INTEL + bin_PROGRAMS += $(LIBDRM_INTEL_BIN) + intel_error_decode_LDFLAGS = -lz +endif + SUBDIRS = null_state_gen registers AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib diff --git a/tools/Makefile.sources b/tools/Makefile.sources index 5d5958d..07d8d9b 100644 --- a/tools/Makefile.sources +++ b/tools/Makefile.sources @@ -13,11 +13,8 @@ bin_PROGRAMS = \ intel_bios_reader \ intel_display_crc \ intel_display_poller\ - intel_dump_decode \ - intel_error_decode \ intel_forcewaked\ intel_gpu_frequency \ - intel_framebuffer_dump \ intel_firmware_decode \ intel_gpu_time \ intel_gpu_top \ @@ -27,7 +24,6 @@ bin_PROGRAMS =\ intel_lid \ intel_opregion_decode \ intel_panel_fitter \ - intel_perf_counters \ intel_reg_checker \ intel_residency \ intel_stepping \ @@ -35,8 +31,12 @@ bin_PROGRAMS = \ dist_bin_SCRIPTS = intel_gpu_abrt -intel_dump_decode_SOURCES =\ - intel_dump_decode.c +LIBDRM_INTEL_BIN = \ + intel_dump_decode \ + intel_error_decode \ + intel_framebuffer_dump \ + intel_perf_counters \ + $(NULL) intel_reg_SOURCES =\ intel_reg.c \ @@ -44,10 +44,6 @@ intel_reg_SOURCES = \ intel_reg_spec.c\ intel_reg_spec.h -intel_error_decode_SOURCES = \ - intel_error_decode.c -intel_error_decode_LDFLAGS = -lz - intel_bios_reader_SOURCES =\ intel_bios_reader.c \ intel_bios.h -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t v3 02/13] configure.ac: Harmonize HAVE_XXX flag for all drm platforms to HAVE_LIBDRM_XXX.
From: Robert Foss <robert.f...@collabora.com> Replace the automake flag HAVE_XXX for VC4/NOUVEAU with HAVE_LIBDRM_XXX in order for the flags to be more descriptive and also follow the same convention as HAVE_LIBDRM_INTEL. --- configure.ac | 8 lib/Makefile.am | 2 +- tests/Makefile.am | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 49903e4..a6210ae 100644 --- a/configure.ac +++ b/configure.ac @@ -174,9 +174,9 @@ if test "x$NOUVEAU" = xauto; then fi if test "x$NOUVEAU" = xyes; then PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33]) - AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau support]) + AC_DEFINE(HAVE_LIBDRM_NOUVEAU, 1, [Have nouveau support]) fi -AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes]) +AM_CONDITIONAL(HAVE_LIBDRM_NOUVEAU, [test "x$NOUVEAU" = xyes]) AC_ARG_ENABLE(vc4, AS_HELP_STRING([--disable-vc4], [Enable building of vc4 tests (default: auto)]), @@ -186,9 +186,9 @@ if test "x$VC4" = xauto; then fi if test "x$VC4" = xyes; then PKG_CHECK_MODULES(DRM_VC4, [libdrm_vc4]) - AC_DEFINE(HAVE_VC4, 1, [Have vc4 support]) + AC_DEFINE(HAVE_LIBDRM_VC4, 1, [Have vc4 support]) fi -AM_CONDITIONAL(HAVE_VC4, [test "x$VC4" = xyes]) +AM_CONDITIONAL(HAVE_LIBDRM_VC4, [test "x$VC4" = xyes]) # Define a configure option for the shader debugger AC_ARG_ENABLE(shader-debugger, AS_HELP_STRING([--enable-shader-debugger], diff --git a/lib/Makefile.am b/lib/Makefile.am index d2f2e16..d2ae98d 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -8,7 +8,7 @@ include Makefile.sources noinst_LTLIBRARIES = libintel_tools.la noinst_HEADERS = check-ndebug.h -if HAVE_VC4 +if HAVE_LIBDRM_VC4 libintel_tools_la_SOURCES += \ igt_vc4.c \ igt_vc4.h diff --git a/tests/Makefile.am b/tests/Makefile.am index c2c2025..737afbe 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,10 +1,10 @@ include Makefile.sources -if HAVE_NOUVEAU +if HAVE_LIBDRM_NOUVEAU TESTS_progs_M += $(NOUVEAU_TESTS_M) endif -if HAVE_VC4 +if HAVE_LIBDRM_VC4 TESTS_progs_M += $(VC4_TESTS_M) endif -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t v3 07/13] demos/Makefile: Don't build tools that depend on libdrm_intel.
From: Robert Foss <robert.f...@collabora.com> Use the HAS_INTEL automake flag to avoid building tools that won't compile unless libdrm_intel is available in the build system. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- demos/Android.mk | 5 - demos/Makefile.am | 8 +--- demos/Makefile.sources | 7 +++ 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 demos/Makefile.sources diff --git a/demos/Android.mk b/demos/Android.mk index 7d06c9a..add2414 100644 --- a/demos/Android.mk +++ b/demos/Android.mk @@ -4,8 +4,11 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_SRC_FILES := intel_sprite_on.c +LOCAL_SRC_FILES := +ifeq ($(HAVE_LIBDRM_INTEL),true) +LOCAL_SRC_FILES += $(LIBDRM_INTEL_BIN) +endif LOCAL_CFLAGS += -DHAVE_TERMIOS_H LOCAL_CFLAGS += -DANDROID -UNDEBUG diff --git a/demos/Makefile.am b/demos/Makefile.am index f5725f4..48eb6c2 100644 --- a/demos/Makefile.am +++ b/demos/Makefile.am @@ -1,6 +1,8 @@ -bin_PROGRAMS = \ - intel_sprite_on \ - $(NULL) +include Makefile.sources + +if HAVE_LIBDRM_INTEL + bin_PROGRAMS += $(LIBDRM_INTEL_BIN) +endif AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \ diff --git a/demos/Makefile.sources b/demos/Makefile.sources new file mode 100644 index 000..302f6d9 --- /dev/null +++ b/demos/Makefile.sources @@ -0,0 +1,7 @@ +bin_PROGRAMS = \ + $(NULL) + +HAVE_LIBDRM_INTEL_BIN =\ + intel_sprite_on \ + $(NULL) + -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t v3 11/13] tools/Makefile: Replace automake specific name of listings in Makfile.sources
From: Robert Foss <robert.f...@collabora.com> Replace the automake specific names of listings in Makefile.sources with something not automake specific. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tools/Android.mk | 3 ++- tools/Makefile.am | 2 ++ tools/Makefile.sources | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/Android.mk b/tools/Android.mk index 306a4b5..72dfa12 100644 --- a/tools/Android.mk +++ b/tools/Android.mk @@ -55,7 +55,8 @@ endef $(shell mkdir -p $(TARGET_OUT_VENDOR)/$(LOCAL_TOOLS_DIR)/registers) $(shell cp $(LOCAL_PATH)/registers/* $(TARGET_OUT_VENDOR)/$(LOCAL_TOOLS_DIR)/registers) - +bin_PROGRAMS := $(tools_prog_lists) + skip_tools_list := \ intel_framebuffer_dump \ intel_reg_dumper \ diff --git a/tools/Makefile.am b/tools/Makefile.am index f8ac0d8..d324321 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,5 +1,7 @@ include Makefile.sources +bin_PROGRAMS = $(tools_prog_lists) + if HAVE_LIBDRM_INTEL bin_PROGRAMS += $(LIBDRM_INTEL_BIN) intel_error_decode_LDFLAGS = -lz diff --git a/tools/Makefile.sources b/tools/Makefile.sources index 7ed5fe5..2bb6c8e 100644 --- a/tools/Makefile.sources +++ b/tools/Makefile.sources @@ -4,7 +4,7 @@ noinst_PROGRAMS = \ skl_ddb_allocation \ $(NULL) -bin_PROGRAMS = \ +tools_prog_lists = \ igt_stats \ intel_audio_dump\ intel_reg \ -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t v3 08/13] lib/stubs: Add stubs for intel_bufmgr.
From: Robert Foss <robert.f...@collabora.com> This patch provides stubs for functionality otherwise provided by intel_bufmgr. The stubbed functions all fail with a call to igt_require_f(false,""). Defines and enums have been copied from libdrm_intel. Due to the stubbed tests failing with an igt_require_f() call, these stubs are not well suited for non-tests, since tools/benchmarks/etc 'skipping' execution is unhelpful. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/Makefile.am | 7 + lib/stubs/drm/README | 4 + lib/stubs/drm/intel_bufmgr.c | 269 +++ lib/stubs/drm/intel_bufmgr.h | 430 +++ 4 files changed, 710 insertions(+) create mode 100644 lib/stubs/drm/README create mode 100644 lib/stubs/drm/intel_bufmgr.c create mode 100644 lib/stubs/drm/intel_bufmgr.h diff --git a/lib/Makefile.am b/lib/Makefile.am index d2ae98d..3e12f25 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -14,6 +14,13 @@ if HAVE_LIBDRM_VC4 igt_vc4.h endif +if HAVE_LIBDRM_INTEL +else +libintel_tools_la_SOURCES += \ +stubs/drm/intel_bufmgr.c \ +stubs/drm/intel_bufmgr.h +endif + AM_CPPFLAGS = -I$(top_srcdir) AM_CFLAGS = $(CWARNFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(LIBUNWIND_CFLAGS) $(DEBUG_CFLAGS) \ -DIGT_SRCDIR=\""$(abs_top_srcdir)/tests"\" \ diff --git a/lib/stubs/drm/README b/lib/stubs/drm/README new file mode 100644 index 000..dec6a1d --- /dev/null +++ b/lib/stubs/drm/README @@ -0,0 +1,4 @@ +intel_bufmgr.h is a copy the file provided in libdrm (intel/intel_bufmgr.h). + +Before releasing i-g-t a current copy of intel_bufmgr.h should be copied into +this directory of i-g-t. diff --git a/lib/stubs/drm/intel_bufmgr.c b/lib/stubs/drm/intel_bufmgr.c new file mode 100644 index 000..bc1c196 --- /dev/null +++ b/lib/stubs/drm/intel_bufmgr.c @@ -0,0 +1,269 @@ +#include + +#include "igt_core.h" +#include "intel_bufmgr.h" + +const char * const missing_support_str = "Not compiled with libdrm_intel support\n"; + +drm_intel_bufmgr *drm_intel_bufmgr_gem_init(int fd, int batch_size) +{ + igt_require_f(false, missing_support_str); + return (drm_intel_bufmgr *) NULL; +} + +void drm_intel_bo_unreference(drm_intel_bo *bo) +{ + igt_require_f(false, missing_support_str); +} + +drm_intel_bo *drm_intel_bo_alloc(drm_intel_bufmgr *bufmgr, const char *name, +unsigned long size, unsigned int alignment) +{ + igt_require_f(false, missing_support_str); + return (drm_intel_bo *) NULL; +} + +int drm_intel_bo_subdata(drm_intel_bo *bo, unsigned long offset, +unsigned long size, const void *data) +{ + igt_require_f(false, missing_support_str); + return 0; +} + +int drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx, + int used, unsigned int flags) +{ + igt_require_f(false, missing_support_str); + return 0; +} + +int drm_intel_bo_emit_reloc(drm_intel_bo *bo, uint32_t offset, + drm_intel_bo *target_bo, uint32_t target_offset, + uint32_t read_domains, uint32_t write_domain) +{ + igt_require_f(false, missing_support_str); + return 0; +} + +int drm_intel_bo_emit_reloc_fence(drm_intel_bo *bo, uint32_t offset, + drm_intel_bo *target_bo, + uint32_t target_offset, + uint32_t read_domains, uint32_t write_domain) +{ + igt_require_f(false, missing_support_str); + return 0; +} + +int drm_intel_bo_get_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, + uint32_t * swizzle_mode) +{ + igt_require_f(false, missing_support_str); + return 0; +} + +int drm_intel_bo_mrb_exec(drm_intel_bo *bo, int used, + struct drm_clip_rect *cliprects, int num_cliprects, + int DR4, unsigned int flags) +{ + igt_require_f(false, missing_support_str); + return 0; +} + +void drm_intel_bufmgr_gem_set_aub_annotations(drm_intel_bo *bo, + drm_intel_aub_annotation *annotations, + unsigned count) +{ + igt_require_f(false, missing_support_str); +} + +void drm_intel_bufmgr_gem_enable_reuse(drm_intel_bufmgr *bufmgr) +{ + igt_require_f(false, missing_support_str); +} + +int drm_intel_bo_exec(drm_intel_bo *bo, int used, + struct drm_clip_rect *cliprects, int num_cliprects, int DR4) +{ + igt_require_f(false, missing_support_str); + return 0; +} + +void drm_intel_bufmgr_destroy(drm_intel_bufmgr *bufmgr) +{ + igt_require_f(false, missing_support_str); +} + +void drm_intel_bo_wait_rendering(drm_intel
[Intel-gfx] [RFC i-g-t v3 00/13] Remove compile time depencencies on libdrm_intel.
From: Robert Foss <robert.f...@collabora.com> Hey, I've been looking at the possibilty of removing the compile time depency on libdrm_intel. There are two technical solutions to this problem as far as I can see; stubs and conditional compilation. This series uses the stubbing approach. Changes since v1: - Replaced the automake flags HAVE_VC4/NOUVEAU/INTEL with HAVE_LIBDRM_XXX. - Move conditionals from Makefile.sources to Arduino.mk/Makefile.am. - Removed duplicated i915_drm.h symbols from intel_drm_stubs.h. - Replaced igt_require with igt_require_f to communicate stubs being the cause of failure. - Rename intel_drm_stubs to intel_bufmgr. - Moved intel_bufmgr to lib/stubs/drm. - Remove header inclusion changes in favor for inclusion of stubs in lib/stubs/drm using build scripts. - Rebased on trunk. Changes since v2: - Removed conditional compilation from intel_bufmgr.h. - Enable HAVE_LIBDRM_INTEL on android platforms. - Remove unnecessary whitespace. - Remove unnecessary inclusion of C files. - De-duplicated intel_bufmgr.c error string. - Changed Makefile.sources variable names to be non-automake specific Robert Foss (13): configure.ac: Test for libdrm_intel and build for it if present. configure.ac: Harmonize HAVE_XXX flag for all drm platforms to HAVE_LIBDRM_XXX. Enable HAVE_LIBDRM_INTEL unconditionally for Android. benchmarks/Makefile: Don't build benchmarks that depend on libdrm_intel. tools/Makefile: Don't build tools that depend on libdrm_intel. tools/Makefile: Format whitespace. demos/Makefile: Don't build tools that depend on libdrm_intel. lib/stubs: Add stubs for intel_bufmgr. demos/Makefile: Replace automake specific name of listing in Makfile.sources benchmarks/Makefile: Replace automake specific name of listing in Makfile.sources tools/Makefile: Replace automake specific name of listings in Makfile.sources lib/tests/Makefile: Replace automake specific names of listings in Makefile.sources lib/Makefile: Replace automake specific names of listings in Makefile.sources Android.mk | 2 + benchmarks/Android.mk| 6 +- benchmarks/Makefile.am | 7 +- benchmarks/Makefile.sources | 15 +- configure.ac | 25 ++- demos/Android.mk | 5 +- demos/Makefile.am| 10 +- demos/Makefile.sources | 7 + lib/Android.mk | 2 +- lib/Makefile.am | 11 +- lib/Makefile.sources | 2 +- lib/stubs/drm/README | 4 + lib/stubs/drm/intel_bufmgr.c | 269 +++ lib/stubs/drm/intel_bufmgr.h | 430 +++ lib/tests/Android.mk | 2 +- lib/tests/Makefile.am| 3 + lib/tests/Makefile.sources | 8 +- tests/Makefile.am| 4 +- tools/Android.mk | 8 +- tools/Makefile.am| 7 + tools/Makefile.sources | 73 21 files changed, 834 insertions(+), 66 deletions(-) create mode 100644 demos/Makefile.sources create mode 100644 lib/stubs/drm/README create mode 100644 lib/stubs/drm/intel_bufmgr.c create mode 100644 lib/stubs/drm/intel_bufmgr.h -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t v3 12/13] lib/tests/Makefile: Replace automake specific names of listings in Makefile.sources
From: Robert Foss <robert.f...@collabora.com> Replace the automake specific names of listings with something that isn't automake specific. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/tests/Android.mk | 2 +- lib/tests/Makefile.am | 3 +++ lib/tests/Makefile.sources | 8 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/tests/Android.mk b/lib/tests/Android.mk index df8e159..026f17f 100644 --- a/lib/tests/Android.mk +++ b/lib/tests/Android.mk @@ -37,5 +37,5 @@ IGT_LOCAL_C_INCLUDES += ${ANDROID_BUILD_TOP}/external/PRIVATE/drm/include/drm IGT_LOCAL_STATIC_LIBRARIES := libintel_gpu_tools IGT_LOCAL_SHARED_LIBRARIES := libpciaccess libdrm libdrm_intel -$(foreach item,$(check_PROGRAMS),$(eval $(call add_test,$(item +$(foreach item,$($(check_prog_list)),$(eval $(call add_test,$(item diff --git a/lib/tests/Makefile.am b/lib/tests/Makefile.am index 582cc3e..c2fa2eb 100644 --- a/lib/tests/Makefile.am +++ b/lib/tests/Makefile.am @@ -1,5 +1,8 @@ include Makefile.sources +check_PROGRAMS = $(check_prog_list) +check_SCRIPTS = $(check_script_list) + AM_TESTS_ENVIRONMENT = \ top_builddir=$(top_builddir) \ top_srcdir=$(top_srcdir) diff --git a/lib/tests/Makefile.sources b/lib/tests/Makefile.sources index 707c445..5d8c785 100644 --- a/lib/tests/Makefile.sources +++ b/lib/tests/Makefile.sources @@ -1,4 +1,4 @@ -check_PROGRAMS = \ +check_prog_list = \ igt_no_exit \ igt_no_exit_list_only \ igt_fork_helper \ @@ -15,13 +15,13 @@ check_PROGRAMS = \ igt_exit_handler \ $(NULL) -check_SCRIPTS = \ +check_script_list = \ igt_command_line.sh \ $(NULL) TESTS = \ - $(check_PROGRAMS) \ - $(check_SCRIPTS) \ + $(check_prog_list) \ + $(check_script_list) \ $(NULL) # Test that exercise specific asserts in the test framework library and are -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t v3 03/13] Enable HAVE_LIBDRM_INTEL unconditionally for Android.
From: Robert Foss <robert.f...@collabora.com> Always set HAVE_LIBDRM_INTEL to true for Android targets. --- Android.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Android.mk b/Android.mk index 681d114..3690fc5 100644 --- a/Android.mk +++ b/Android.mk @@ -1,2 +1,4 @@ +HAVE_LIBDRM_INTEL := true + include $(call all-named-subdir-makefiles, lib tests tools benchmarks) -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t v3 04/13] benchmarks/Makefile: Don't build benchmarks that depend on libdrm_intel.
From: Robert Foss <robert.f...@collabora.com> Use the HAS_INTEL automake flag to avoid building benchmarks that won't compile unless libdrm_intel is available in the build system. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- benchmarks/Android.mk | 4 benchmarks/Makefile.am | 5 - benchmarks/Makefile.sources | 13 - 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk index 207a177..22ecd2f 100644 --- a/benchmarks/Android.mk +++ b/benchmarks/Android.mk @@ -34,4 +34,8 @@ endef benchmark_list := $(benchmarks_PROGRAMS) +ifeq ($(HAVE_LIBDRM_INTEL),true) +benchmark_list += $(LIBDRM_INTEL_BENCHMARKS) +endif + $(foreach item,$(benchmark_list),$(eval $(call add_benchmark,$(item diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am index 49d2f64..7400dd0 100644 --- a/benchmarks/Makefile.am +++ b/benchmarks/Makefile.am @@ -1,6 +1,9 @@ - include Makefile.sources +if HAVE_LIBDRM_INTEL + benchmarks_PROGRAMS += $(LIBDRM_INTEL_BENCHMARKS) +endif + AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) \ $(WERROR_CFLAGS) diff --git a/benchmarks/Makefile.sources b/benchmarks/Makefile.sources index bc4f2b5..5804d3b 100644 --- a/benchmarks/Makefile.sources +++ b/benchmarks/Makefile.sources @@ -1,10 +1,6 @@ benchmarksdir=$(libexecdir)/intel-gpu-tools/benchmarks benchmarks_PROGRAMS = \ - intel_upload_blit_large \ - intel_upload_blit_large_gtt \ - intel_upload_blit_large_map \ - intel_upload_blit_small \ gem_blt \ gem_create \ gem_exec_ctx\ @@ -17,6 +13,13 @@ benchmarks_PROGRAMS =\ gem_prw \ gem_set_domain \ gem_syslatency \ - gem_userptr_benchmark \ kms_vblank \ $(NULL) + +LIBDRM_INTEL_BENCHMARKS = \ + intel_upload_blit_large \ + intel_upload_blit_large_gtt \ + intel_upload_blit_large_map \ + intel_upload_blit_small \ + gem_userptr_benchmark \ + $(NULL) -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [RFC i-g-t v3 13/13] lib/Makefile: Replace automake specific names of listings in Makefile.sources
From: Robert Foss <robert.f...@collabora.com> Replace the automake specific variable names for listings in Makefile.sources with something not automake specific. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/Android.mk | 2 +- lib/Makefile.am | 2 ++ lib/Makefile.sources | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Android.mk b/lib/Android.mk index badec1e..eb72f84 100644 --- a/lib/Android.mk +++ b/lib/Android.mk @@ -44,7 +44,7 @@ skip_lib_list := \ -DANDROID_HAS_CAIRO=0 endif -LOCAL_SRC_FILES := $(filter-out $(skip_lib_list),$(libintel_tools_la_SOURCES)) +LOCAL_SRC_FILES := $(filter-out $(skip_lib_list),$(lib_source_list)) include $(BUILD_STATIC_LIBRARY) diff --git a/lib/Makefile.am b/lib/Makefile.am index 3e12f25..390cecb 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -5,6 +5,8 @@ SUBDIRS = . tests include Makefile.sources +libintel_tools_la_SOURCES = $(lib_source_list) + noinst_LTLIBRARIES = libintel_tools.la noinst_HEADERS = check-ndebug.h diff --git a/lib/Makefile.sources b/lib/Makefile.sources index f50ff4d..3cc33f4 100644 --- a/lib/Makefile.sources +++ b/lib/Makefile.sources @@ -1,4 +1,4 @@ -libintel_tools_la_SOURCES =\ +lib_source_list = \ debug.h \ drmtest.c \ drmtest.h \ -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC i-g-t 3/7] benchmarks/Makefile: Don't build benchmarks that depend on libdrm_intel.
On 2016-05-25 03:55 PM, Emil Velikov wrote: On Wednesday, May 25, 2016 19:18 BST, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> Use the HAS_INTEL automake flag to avoid building benchmarks that won't compile unless libdrm_intel is available in the build system. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- benchmarks/Android.mk | 6 ++ benchmarks/Makefile.am | 5 - benchmarks/Makefile.sources | 14 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk index 207a177..08b6816 100644 --- a/benchmarks/Android.mk +++ b/benchmarks/Android.mk @@ -34,4 +34,10 @@ endef benchmark_list := $(benchmarks_PROGRAMS) +ifeq ($(HAVE_LIBDRM_INTEL),true) +benchmark_list += $(LIBDRM_INTEL_BENCHMARKS) +endif + + + Add just one blank line. Yet again... one should set HAVE_LIBDRM_INTEL so that things don't regress/change. Something like the following should do it --- a/Android.mk +++ b/Android.mk @@ -1,2 +1,4 @@ +HAVE_LIBDRM_INTEL := true + include $(call all-named-subdir-makefiles, lib tests tools benchmarks) I'd keep ^^ either as separate patch (1.1/7) or just fold it into 1/7 and update the commit message. $(foreach item,$(benchmark_list),$(eval $(call add_benchmark,$(item diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am index 49d2f64..7400dd0 100644 --- a/benchmarks/Makefile.am +++ b/benchmarks/Makefile.am @@ -1,6 +1,9 @@ - include Makefile.sources +if HAVE_LIBDRM_INTEL +benchmarks_PROGRAMS += $(LIBDRM_INTEL_BENCHMARKS) +endif + This is absolutely correct, sadly the existing Makefile.sources (ab)use makes things hard to grasp. The 'hard to grasp' part being - this (and other) Makefile.am files are missing the definition of the *PROGRAMS, *LTLIBRARIES, etc. variables thus the whole file (and this hunk and particular makes things harder to read. Ideally one will give clearer (non-autoconf specific) names of the variables in the Makefile.sources and move the PROGRAMS... bits into Makefile.am. That is rather evasive so I'm not sure if you're up for it. Example (note it has some ~unrelated comments/nitpicks) diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk index 207a177..dfe34bc 100644 --- a/benchmarks/Android.mk +++ b/benchmarks/Android.mk @@ -32,6 +32,6 @@ endef ## -benchmark_list := $(benchmarks_PROGRAMS) +benchmark_list := $(benchmarks_prog_list) $(foreach item,$(benchmark_list),$(eval $(call add_benchmark,$(item diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am index 2c2d100..5396db1 100644 --- a/benchmarks/Makefile.am +++ b/benchmarks/Makefile.am @@ -3,15 +3,23 @@ include Makefile.sources AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) + +benchmarks_PROGRAMS = $(benchmarks_prog_list) LDADD = $(top_builddir)/lib/libintel_tools.la +# Sees to be unused by IGT. Add a comment and move it after gem_foo +benchmarksdir=$(libexecdir)/intel-gpu-tools/benchmarks benchmarks_LTLIBRARIES = gem_exec_tracer.la gem_exec_tracer_la_LDFLAGS = -module -avoid-version -no-undefined +# there should be a detection in configure.ac as some platforms don't use/have libdl.so gem_exec_tracer_la_LIBADD = -ldl +# one could/should use AX_PTHREADS in configure and PTHREAD_CFLAGS/PTHREAD_LIBS through the project. +# unless they use pthread and don't strictly require the locking. then they can use the pthread-stubs package. gem_latency_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) gem_latency_LDADD = $(LDADD) -lpthread gem_syslatency_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) gem_syslatency_LDADD = $(LDADD) -lpthread -lrt +# spaces around = ? EXTRA_DIST=README diff --git a/benchmarks/Makefile.sources b/benchmarks/Makefile.sources index 81607a5..51f59e5 100644 --- a/benchmarks/Makefile.sources +++ b/benchmarks/Makefile.sources @@ -1,6 +1,4 @@ -benchmarksdir=$(libexecdir)/intel-gpu-tools/benchmarks - -benchmarks_PROGRAMS =\ +benchmarks_prog_list =\ intel_upload_blit_large \ intel_upload_blit_large_gtt \ intel_upload_blit_large_map \ --- a/benchmarks/Makefile.sources +++ b/benchmarks/Makefile.sources @@ -1,10 +1,7 @@ benchmarksdir=$(libexecdir)/intel-gpu-tools/benchmarks + Please don't add unneeded whitespace changes. +LIBDRM_INTEL_BENCHMARKS =\ With the above suggestions in place this could become intel_benchmarks_prog_list. Don't think there's a difference between upper/lower case and/or short/long names. Go with what IGT people are happy. -Emil About the LIBDRM_INTEL_BENCHMARKS -> changes (and the corresponding changes to tools/lib/etc.) this would change the Android.mk behavior too. The Android.mk changes would make it deviate from the the standard expected behaviour with having XXX_PROGRAMS being assumed to contain the
Re: [Intel-gfx] [PATCH] drm: Wrap direct calls to driver->gem_free_object from CMA
Verified working on rpi2. Tested-by: Robert Foss <robert.f...@collabora.com> On 2016-05-31 05:25 PM, Chris Wilson wrote: Since the introduction of (struct_mutex) lockless GEM bo freeing, there are a pair of driver vfuncs for freeing the GEM bo, of which the driver may choose to only implement driver->gem_object_free_unlocked (and so avoid taking the struct_mutex along the free path). However, the CMA GEM helpers were still calling driver->gem_free_object directly, now NULL, and promptly dying on the fancy new lockless drivers. Oops. Robert Foss bisected this to b82caafcf2303 (drm/vc4: Use lockless gem BO free callback) on his vc4 device, but that just serves as an enabler for 9f0ba539d13ae (drm/gem: support BO freeing without dev->struct_mutex). Reported-by: Robert Foss <robert.f...@collabora.com> Fixes: 9f0ba539d13ae (drm/gem: support BO freeing without dev->struct_mutex) Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> Cc: Robert Foss <robert.f...@collabora.com> Cc: Daniel Vetter <daniel.vet...@intel.com> Cc: Eric Anholt <e...@anholt.net> Cc: Alex Deucher <alexdeuc...@gmail.com> Cc: Lucas Stach <l.st...@pengutronix.de> Cc: sta...@vger.kernel.org --- drivers/gpu/drm/drm_fb_cma_helper.c | 2 +- drivers/gpu/drm/drm_gem_cma_helper.c | 12 +++- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c index 172cafe11c71..5075fae3c4e2 100644 --- a/drivers/gpu/drm/drm_fb_cma_helper.c +++ b/drivers/gpu/drm/drm_fb_cma_helper.c @@ -445,7 +445,7 @@ err_cma_destroy: err_fb_info_destroy: drm_fb_helper_release_fbi(helper); err_gem_free_object: - dev->driver->gem_free_object(>base); + drm_gem_object_unreference_unlocked(>base); return ret; } EXPORT_SYMBOL(drm_fbdev_cma_create_with_funcs); diff --git a/drivers/gpu/drm/drm_gem_cma_helper.c b/drivers/gpu/drm/drm_gem_cma_helper.c index e1ab008b3f08..1d6c335584ec 100644 --- a/drivers/gpu/drm/drm_gem_cma_helper.c +++ b/drivers/gpu/drm/drm_gem_cma_helper.c @@ -121,7 +121,7 @@ struct drm_gem_cma_object *drm_gem_cma_create(struct drm_device *drm, return cma_obj; error: - drm->driver->gem_free_object(_obj->base); + drm_gem_object_unreference_unlocked(_obj->base); return ERR_PTR(ret); } EXPORT_SYMBOL_GPL(drm_gem_cma_create); @@ -162,18 +162,12 @@ drm_gem_cma_create_with_handle(struct drm_file *file_priv, * and handle has the id what user can see. */ ret = drm_gem_handle_create(file_priv, gem_obj, handle); - if (ret) - goto err_handle_create; - /* drop reference from allocate - handle holds it now. */ drm_gem_object_unreference_unlocked(gem_obj); + if (ret) + return ERR_PTR(ret); return cma_obj; - -err_handle_create: - drm->driver->gem_free_object(gem_obj); - - return ERR_PTR(ret); } /** ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PACTH i-g-t v4 03/13] Enable HAVE_LIBDRM_INTEL unconditionally for Android.
From: Robert Foss <robert.f...@collabora.com> Always set HAVE_LIBDRM_INTEL to true for Android targets. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- Android.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Android.mk b/Android.mk index 681d114..3690fc5 100644 --- a/Android.mk +++ b/Android.mk @@ -1,2 +1,4 @@ +HAVE_LIBDRM_INTEL := true + include $(call all-named-subdir-makefiles, lib tests tools benchmarks) -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PACTH i-g-t v4 06/13] tools/Makefile: Format whitespace.
From: Robert Foss <robert.f...@collabora.com> Harmonize tabs/spaces etc. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tools/Makefile.sources | 57 +- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/tools/Makefile.sources b/tools/Makefile.sources index 07d8d9b..7ed5fe5 100644 --- a/tools/Makefile.sources +++ b/tools/Makefile.sources @@ -1,33 +1,34 @@ -noinst_PROGRAMS = \ - hsw_compute_wrpll \ - skl_compute_wrpll \ - skl_ddb_allocation \ +noinst_PROGRAMS = \ + hsw_compute_wrpll \ + skl_compute_wrpll \ + skl_ddb_allocation \ $(NULL) -bin_PROGRAMS = \ - igt_stats \ - intel_audio_dump\ - intel_reg \ - intel_backlight \ - intel_bios_dumper \ - intel_bios_reader \ - intel_display_crc \ - intel_display_poller\ - intel_forcewaked\ - intel_gpu_frequency \ - intel_firmware_decode \ - intel_gpu_time \ - intel_gpu_top \ - intel_gtt \ - intel_infoframes\ - intel_l3_parity \ - intel_lid \ - intel_opregion_decode \ - intel_panel_fitter \ - intel_reg_checker \ - intel_residency \ - intel_stepping \ - intel_watermark +bin_PROGRAMS = \ + igt_stats \ + intel_audio_dump\ + intel_reg \ + intel_backlight \ + intel_bios_dumper \ + intel_bios_reader \ + intel_display_crc \ + intel_display_poller\ + intel_forcewaked\ + intel_gpu_frequency \ + intel_firmware_decode \ + intel_gpu_time \ + intel_gpu_top \ + intel_gtt \ + intel_infoframes\ + intel_l3_parity \ + intel_lid \ + intel_opregion_decode \ + intel_panel_fitter \ + intel_reg_checker \ + intel_residency \ + intel_stepping \ + intel_watermark \ + $(NULL) dist_bin_SCRIPTS = intel_gpu_abrt -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PACTH i-g-t v4 08/13] lib/stubs: Add stubs for intel_bufmgr.
From: Robert Foss <robert.f...@collabora.com> This patch provides stubs for functionality otherwise provided by intel_bufmgr. The stubbed functions all fail with a call to igt_require_f(false,""). Defines and enums have been copied from libdrm_intel. Due to the stubbed tests failing with an igt_require_f() call, these stubs are not well suited for non-tests, since tools/benchmarks/etc 'skipping' execution is unhelpful. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/Makefile.am | 6 + lib/stubs/drm/README | 4 + lib/stubs/drm/intel_bufmgr.c | 269 lib/stubs/drm/intel_bufmgr.h | 321 +++ 4 files changed, 600 insertions(+) create mode 100644 lib/stubs/drm/README create mode 100644 lib/stubs/drm/intel_bufmgr.c create mode 100644 lib/stubs/drm/intel_bufmgr.h diff --git a/lib/Makefile.am b/lib/Makefile.am index d2ae98d..365d7d9 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -14,6 +14,12 @@ if HAVE_LIBDRM_VC4 igt_vc4.h endif +if !HAVE_LIBDRM_INTEL +libintel_tools_la_SOURCES += \ +stubs/drm/intel_bufmgr.c \ +stubs/drm/intel_bufmgr.h +endif + AM_CPPFLAGS = -I$(top_srcdir) AM_CFLAGS = $(CWARNFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(LIBUNWIND_CFLAGS) $(DEBUG_CFLAGS) \ -DIGT_SRCDIR=\""$(abs_top_srcdir)/tests"\" \ diff --git a/lib/stubs/drm/README b/lib/stubs/drm/README new file mode 100644 index 000..79f2b5f --- /dev/null +++ b/lib/stubs/drm/README @@ -0,0 +1,4 @@ +intel_bufmgr.h is a local copy of the file provided by libdrm (intel/intel_bufmgr.h). + +Before releasing i-g-t a current copy of intel_bufmgr.h should be copied into +this directory of i-g-t. diff --git a/lib/stubs/drm/intel_bufmgr.c b/lib/stubs/drm/intel_bufmgr.c new file mode 100644 index 000..bc1c196 --- /dev/null +++ b/lib/stubs/drm/intel_bufmgr.c @@ -0,0 +1,269 @@ +#include + +#include "igt_core.h" +#include "intel_bufmgr.h" + +const char * const missing_support_str = "Not compiled with libdrm_intel support\n"; + +drm_intel_bufmgr *drm_intel_bufmgr_gem_init(int fd, int batch_size) +{ + igt_require_f(false, missing_support_str); + return (drm_intel_bufmgr *) NULL; +} + +void drm_intel_bo_unreference(drm_intel_bo *bo) +{ + igt_require_f(false, missing_support_str); +} + +drm_intel_bo *drm_intel_bo_alloc(drm_intel_bufmgr *bufmgr, const char *name, +unsigned long size, unsigned int alignment) +{ + igt_require_f(false, missing_support_str); + return (drm_intel_bo *) NULL; +} + +int drm_intel_bo_subdata(drm_intel_bo *bo, unsigned long offset, +unsigned long size, const void *data) +{ + igt_require_f(false, missing_support_str); + return 0; +} + +int drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx, + int used, unsigned int flags) +{ + igt_require_f(false, missing_support_str); + return 0; +} + +int drm_intel_bo_emit_reloc(drm_intel_bo *bo, uint32_t offset, + drm_intel_bo *target_bo, uint32_t target_offset, + uint32_t read_domains, uint32_t write_domain) +{ + igt_require_f(false, missing_support_str); + return 0; +} + +int drm_intel_bo_emit_reloc_fence(drm_intel_bo *bo, uint32_t offset, + drm_intel_bo *target_bo, + uint32_t target_offset, + uint32_t read_domains, uint32_t write_domain) +{ + igt_require_f(false, missing_support_str); + return 0; +} + +int drm_intel_bo_get_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, + uint32_t * swizzle_mode) +{ + igt_require_f(false, missing_support_str); + return 0; +} + +int drm_intel_bo_mrb_exec(drm_intel_bo *bo, int used, + struct drm_clip_rect *cliprects, int num_cliprects, + int DR4, unsigned int flags) +{ + igt_require_f(false, missing_support_str); + return 0; +} + +void drm_intel_bufmgr_gem_set_aub_annotations(drm_intel_bo *bo, + drm_intel_aub_annotation *annotations, + unsigned count) +{ + igt_require_f(false, missing_support_str); +} + +void drm_intel_bufmgr_gem_enable_reuse(drm_intel_bufmgr *bufmgr) +{ + igt_require_f(false, missing_support_str); +} + +int drm_intel_bo_exec(drm_intel_bo *bo, int used, + struct drm_clip_rect *cliprects, int num_cliprects, int DR4) +{ + igt_require_f(false, missing_support_str); + return 0; +} + +void drm_intel_bufmgr_destroy(drm_intel_bufmgr *bufmgr) +{ + igt_require_f(false, missing_support_str); +} + +void drm_
[Intel-gfx] [PACTH i-g-t v4 10/13] benchmarks/Makefile: Replace automake specific name of listing in Makfile.sources
From: Robert Foss <robert.f...@collabora.com> Replace the automake specific name of listings in Makefile.sources with something not automake specific. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- benchmarks/Android.mk | 2 +- benchmarks/Makefile.am | 2 ++ benchmarks/Makefile.sources | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk index 22ecd2f..147f5db 100644 --- a/benchmarks/Android.mk +++ b/benchmarks/Android.mk @@ -32,7 +32,7 @@ endef ## -benchmark_list := $(benchmarks_PROGRAMS) +benchmark_list := $(benchmarks_prog_list) ifeq ($(HAVE_LIBDRM_INTEL),true) benchmark_list += $(LIBDRM_INTEL_BENCHMARKS) diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am index 7400dd0..8ae3cb3 100644 --- a/benchmarks/Makefile.am +++ b/benchmarks/Makefile.am @@ -1,5 +1,7 @@ include Makefile.sources +benchmarks_PROGRAMS = $(benchmarks_prog_list) + if HAVE_LIBDRM_INTEL benchmarks_PROGRAMS += $(LIBDRM_INTEL_BENCHMARKS) endif diff --git a/benchmarks/Makefile.sources b/benchmarks/Makefile.sources index 5804d3b..8fb342a 100644 --- a/benchmarks/Makefile.sources +++ b/benchmarks/Makefile.sources @@ -1,6 +1,6 @@ benchmarksdir=$(libexecdir)/intel-gpu-tools/benchmarks -benchmarks_PROGRAMS = \ +benchmarks_prog_list = \ gem_blt \ gem_create \ gem_exec_ctx\ -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PACTH i-g-t v4 00/13] Remove compile time depencencies on libdrm_intel.
From: Robert Foss <robert.f...@collabora.com> Hey, I've been looking at the possibilty of removing the compile time depency on libdrm_intel. There are two technical solutions to this problem as far as I can see; stubs and conditional compilation. This series uses the stubbing approach. Changes since v1: - Replaced the automake flags HAVE_VC4/NOUVEAU/INTEL with HAVE_LIBDRM_XXX. - Move conditionals from Makefile.sources to Arduino.mk/Makefile.am. - Removed duplicated i915_drm.h symbols from intel_drm_stubs.h. - Replaced igt_require with igt_require_f to communicate stubs being the cause of failure. - Rename intel_drm_stubs to intel_bufmgr. - Moved intel_bufmgr to lib/stubs/drm. - Remove header inclusion changes in favor for inclusion of stubs in lib/stubs/drm using build scripts. - Rebased on trunk. Changes since v2: - Removed conditional compilation from intel_bufmgr.h. - Enable HAVE_LIBDRM_INTEL on android platforms. - Remove unnecessary whitespace. - Remove unnecessary inclusion of C files. - De-duplicated intel_bufmgr.c error string. - Changed Makefile.sources variable names to be non-automake specific Changes since v3: - Added signoff to two commits. - Changed automake if not statement. - Removed accidental space character. - Copied in new copy of intel_bufmgr.h - Improved wording of lib/stubs/drm/README. Robert Foss (13): configure.ac: Test for libdrm_intel and build for it if present. configure.ac: Harmonize HAVE_XXX flag for all drm platforms to HAVE_LIBDRM_XXX. Enable HAVE_LIBDRM_INTEL unconditionally for Android. benchmarks/Makefile: Don't build benchmarks that depend on libdrm_intel. tools/Makefile: Don't build tools that depend on libdrm_intel. tools/Makefile: Format whitespace. demos/Makefile: Don't build tools that depend on libdrm_intel. lib/stubs: Add stubs for intel_bufmgr. demos/Makefile: Replace automake specific name of listing in Makfile.sources benchmarks/Makefile: Replace automake specific name of listing in Makfile.sources tools/Makefile: Replace automake specific name of listings in Makfile.sources lib/tests/Makefile: Replace automake specific names of listings in Makefile.sources lib/Makefile: Replace automake specific names of listings in Makefile.sources Android.mk | 2 + benchmarks/Android.mk| 6 +- benchmarks/Makefile.am | 7 +- benchmarks/Makefile.sources | 15 +- configure.ac | 25 +++- demos/Android.mk | 5 +- demos/Makefile.am| 10 +- demos/Makefile.sources | 7 + lib/Android.mk | 2 +- lib/Makefile.am | 10 +- lib/Makefile.sources | 2 +- lib/stubs/drm/README | 4 + lib/stubs/drm/intel_bufmgr.c | 269 lib/stubs/drm/intel_bufmgr.h | 321 +++ lib/tests/Android.mk | 2 +- lib/tests/Makefile.am| 3 + lib/tests/Makefile.sources | 8 +- tests/Makefile.am| 4 +- tools/Android.mk | 6 + tools/Makefile.am| 7 + tools/Makefile.sources | 73 +- 21 files changed, 723 insertions(+), 65 deletions(-) create mode 100644 demos/Makefile.sources create mode 100644 lib/stubs/drm/README create mode 100644 lib/stubs/drm/intel_bufmgr.c create mode 100644 lib/stubs/drm/intel_bufmgr.h -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PACTH i-g-t v4 01/13] configure.ac: Test for libdrm_intel and build for it if present.
From: Robert Foss <robert.f...@collabora.com> Test for libdrm_intel and build for it if present. Also expose the HAVE_INTEL #define to allow code to be conditionally compiled. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- configure.ac | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0405c8b..49903e4 100644 --- a/configure.ac +++ b/configure.ac @@ -100,7 +100,7 @@ if test "x$GCC" = "xyes"; then fi AC_SUBST(ASSEMBLER_WARN_CFLAGS) -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.64 libdrm]) +PKG_CHECK_MODULES(DRM, [libdrm]) PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) case "$target_cpu" in @@ -150,6 +150,21 @@ PKG_CHECK_MODULES(GLIB, glib-2.0) # - # Configuration options # - +AC_ARG_ENABLE(intel, AS_HELP_STRING([--disable-intel], + [Enable building of intel specific parts (default: auto)]), + [INTEL=$enableval], [INTEL=auto]) +if test "x$INTEL" = xauto; then + PKG_CHECK_EXISTS([libdrm_intel >= 2.4.64], [INTEL=yes], [INTEL=no]) +fi +if test "x$INTEL" = xyes; then + PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel >= 2.4.64]) + AC_DEFINE(HAVE_LIBDRM_INTEL, 1, [Have intel support]) +else + DRM_INTEL_CFLAGS=$(top_srcdir)/lib/stubs/drm/ + AC_SUBST([DRM_INTEL_CFLAGS]) +fi +AM_CONDITIONAL(HAVE_LIBDRM_INTEL, [test "x$INTEL" = xyes]) + # for dma-buf tests AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau], [Enable use of nouveau API for prime tests (default: auto)]), -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PACTH i-g-t v4 04/13] benchmarks/Makefile: Don't build benchmarks that depend on libdrm_intel.
From: Robert Foss <robert.f...@collabora.com> Use the HAS_INTEL automake flag to avoid building benchmarks that won't compile unless libdrm_intel is available in the build system. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- benchmarks/Android.mk | 4 benchmarks/Makefile.am | 5 - benchmarks/Makefile.sources | 13 - 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk index 207a177..22ecd2f 100644 --- a/benchmarks/Android.mk +++ b/benchmarks/Android.mk @@ -34,4 +34,8 @@ endef benchmark_list := $(benchmarks_PROGRAMS) +ifeq ($(HAVE_LIBDRM_INTEL),true) +benchmark_list += $(LIBDRM_INTEL_BENCHMARKS) +endif + $(foreach item,$(benchmark_list),$(eval $(call add_benchmark,$(item diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am index 49d2f64..7400dd0 100644 --- a/benchmarks/Makefile.am +++ b/benchmarks/Makefile.am @@ -1,6 +1,9 @@ - include Makefile.sources +if HAVE_LIBDRM_INTEL + benchmarks_PROGRAMS += $(LIBDRM_INTEL_BENCHMARKS) +endif + AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) \ $(WERROR_CFLAGS) diff --git a/benchmarks/Makefile.sources b/benchmarks/Makefile.sources index bc4f2b5..5804d3b 100644 --- a/benchmarks/Makefile.sources +++ b/benchmarks/Makefile.sources @@ -1,10 +1,6 @@ benchmarksdir=$(libexecdir)/intel-gpu-tools/benchmarks benchmarks_PROGRAMS = \ - intel_upload_blit_large \ - intel_upload_blit_large_gtt \ - intel_upload_blit_large_map \ - intel_upload_blit_small \ gem_blt \ gem_create \ gem_exec_ctx\ @@ -17,6 +13,13 @@ benchmarks_PROGRAMS =\ gem_prw \ gem_set_domain \ gem_syslatency \ - gem_userptr_benchmark \ kms_vblank \ $(NULL) + +LIBDRM_INTEL_BENCHMARKS = \ + intel_upload_blit_large \ + intel_upload_blit_large_gtt \ + intel_upload_blit_large_map \ + intel_upload_blit_small \ + gem_userptr_benchmark \ + $(NULL) -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PACTH i-g-t v4 11/13] tools/Makefile: Replace automake specific name of listings in Makfile.sources
From: Robert Foss <robert.f...@collabora.com> Replace the automake specific names of listings in Makefile.sources with something not automake specific. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tools/Android.mk | 1 + tools/Makefile.am | 2 ++ tools/Makefile.sources | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/Android.mk b/tools/Android.mk index 306a4b5..6cdedeb 100644 --- a/tools/Android.mk +++ b/tools/Android.mk @@ -55,6 +55,7 @@ endef $(shell mkdir -p $(TARGET_OUT_VENDOR)/$(LOCAL_TOOLS_DIR)/registers) $(shell cp $(LOCAL_PATH)/registers/* $(TARGET_OUT_VENDOR)/$(LOCAL_TOOLS_DIR)/registers) +bin_PROGRAMS := $(tools_prog_lists) skip_tools_list := \ intel_framebuffer_dump \ diff --git a/tools/Makefile.am b/tools/Makefile.am index f8ac0d8..d324321 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,5 +1,7 @@ include Makefile.sources +bin_PROGRAMS = $(tools_prog_lists) + if HAVE_LIBDRM_INTEL bin_PROGRAMS += $(LIBDRM_INTEL_BIN) intel_error_decode_LDFLAGS = -lz diff --git a/tools/Makefile.sources b/tools/Makefile.sources index 7ed5fe5..2bb6c8e 100644 --- a/tools/Makefile.sources +++ b/tools/Makefile.sources @@ -4,7 +4,7 @@ noinst_PROGRAMS = \ skl_ddb_allocation \ $(NULL) -bin_PROGRAMS = \ +tools_prog_lists = \ igt_stats \ intel_audio_dump\ intel_reg \ -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PACTH i-g-t v4 12/13] lib/tests/Makefile: Replace automake specific names of listings in Makefile.sources
From: Robert Foss <robert.f...@collabora.com> Replace the automake specific names of listings with something that isn't automake specific. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/tests/Android.mk | 2 +- lib/tests/Makefile.am | 3 +++ lib/tests/Makefile.sources | 8 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/tests/Android.mk b/lib/tests/Android.mk index df8e159..026f17f 100644 --- a/lib/tests/Android.mk +++ b/lib/tests/Android.mk @@ -37,5 +37,5 @@ IGT_LOCAL_C_INCLUDES += ${ANDROID_BUILD_TOP}/external/PRIVATE/drm/include/drm IGT_LOCAL_STATIC_LIBRARIES := libintel_gpu_tools IGT_LOCAL_SHARED_LIBRARIES := libpciaccess libdrm libdrm_intel -$(foreach item,$(check_PROGRAMS),$(eval $(call add_test,$(item +$(foreach item,$($(check_prog_list)),$(eval $(call add_test,$(item diff --git a/lib/tests/Makefile.am b/lib/tests/Makefile.am index 582cc3e..c2fa2eb 100644 --- a/lib/tests/Makefile.am +++ b/lib/tests/Makefile.am @@ -1,5 +1,8 @@ include Makefile.sources +check_PROGRAMS = $(check_prog_list) +check_SCRIPTS = $(check_script_list) + AM_TESTS_ENVIRONMENT = \ top_builddir=$(top_builddir) \ top_srcdir=$(top_srcdir) diff --git a/lib/tests/Makefile.sources b/lib/tests/Makefile.sources index 707c445..5d8c785 100644 --- a/lib/tests/Makefile.sources +++ b/lib/tests/Makefile.sources @@ -1,4 +1,4 @@ -check_PROGRAMS = \ +check_prog_list = \ igt_no_exit \ igt_no_exit_list_only \ igt_fork_helper \ @@ -15,13 +15,13 @@ check_PROGRAMS = \ igt_exit_handler \ $(NULL) -check_SCRIPTS = \ +check_script_list = \ igt_command_line.sh \ $(NULL) TESTS = \ - $(check_PROGRAMS) \ - $(check_SCRIPTS) \ + $(check_prog_list) \ + $(check_script_list) \ $(NULL) # Test that exercise specific asserts in the test framework library and are -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PACTH i-g-t v4 09/13] demos/Makefile: Replace automake specific name of listing in Makfile.sources
From: Robert Foss <robert.f...@collabora.com> Replace the automake specific name of listings in Makefile.sources with something not automake specific. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- demos/Android.mk | 2 +- demos/Makefile.am | 2 ++ demos/Makefile.sources | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/demos/Android.mk b/demos/Android.mk index add2414..90d8b37 100644 --- a/demos/Android.mk +++ b/demos/Android.mk @@ -4,7 +4,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_SRC_FILES := +LOCAL_SRC_FILES := $(demos_prog_lists) ifeq ($(HAVE_LIBDRM_INTEL),true) LOCAL_SRC_FILES += $(LIBDRM_INTEL_BIN) diff --git a/demos/Makefile.am b/demos/Makefile.am index 48eb6c2..fe0ff1f 100644 --- a/demos/Makefile.am +++ b/demos/Makefile.am @@ -1,5 +1,7 @@ include Makefile.sources +bin_PROGRAMS = $(demos_prog_list) + if HAVE_LIBDRM_INTEL bin_PROGRAMS += $(LIBDRM_INTEL_BIN) endif diff --git a/demos/Makefile.sources b/demos/Makefile.sources index 302f6d9..31f7f83 100644 --- a/demos/Makefile.sources +++ b/demos/Makefile.sources @@ -1,4 +1,4 @@ -bin_PROGRAMS = \ +demos_prog_list = \ $(NULL) HAVE_LIBDRM_INTEL_BIN =\ -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PACTH i-g-t v4 02/13] configure.ac: Harmonize HAVE_XXX flag for all drm platforms to HAVE_LIBDRM_XXX.
From: Robert Foss <robert.f...@collabora.com> Replace the automake flag HAVE_XXX for VC4/NOUVEAU with HAVE_LIBDRM_XXX in order for the flags to be more descriptive and also follow the same convention as HAVE_LIBDRM_INTEL. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- configure.ac | 8 lib/Makefile.am | 2 +- tests/Makefile.am | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 49903e4..a6210ae 100644 --- a/configure.ac +++ b/configure.ac @@ -174,9 +174,9 @@ if test "x$NOUVEAU" = xauto; then fi if test "x$NOUVEAU" = xyes; then PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33]) - AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau support]) + AC_DEFINE(HAVE_LIBDRM_NOUVEAU, 1, [Have nouveau support]) fi -AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes]) +AM_CONDITIONAL(HAVE_LIBDRM_NOUVEAU, [test "x$NOUVEAU" = xyes]) AC_ARG_ENABLE(vc4, AS_HELP_STRING([--disable-vc4], [Enable building of vc4 tests (default: auto)]), @@ -186,9 +186,9 @@ if test "x$VC4" = xauto; then fi if test "x$VC4" = xyes; then PKG_CHECK_MODULES(DRM_VC4, [libdrm_vc4]) - AC_DEFINE(HAVE_VC4, 1, [Have vc4 support]) + AC_DEFINE(HAVE_LIBDRM_VC4, 1, [Have vc4 support]) fi -AM_CONDITIONAL(HAVE_VC4, [test "x$VC4" = xyes]) +AM_CONDITIONAL(HAVE_LIBDRM_VC4, [test "x$VC4" = xyes]) # Define a configure option for the shader debugger AC_ARG_ENABLE(shader-debugger, AS_HELP_STRING([--enable-shader-debugger], diff --git a/lib/Makefile.am b/lib/Makefile.am index d2f2e16..d2ae98d 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -8,7 +8,7 @@ include Makefile.sources noinst_LTLIBRARIES = libintel_tools.la noinst_HEADERS = check-ndebug.h -if HAVE_VC4 +if HAVE_LIBDRM_VC4 libintel_tools_la_SOURCES += \ igt_vc4.c \ igt_vc4.h diff --git a/tests/Makefile.am b/tests/Makefile.am index c2c2025..737afbe 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,10 +1,10 @@ include Makefile.sources -if HAVE_NOUVEAU +if HAVE_LIBDRM_NOUVEAU TESTS_progs_M += $(NOUVEAU_TESTS_M) endif -if HAVE_VC4 +if HAVE_LIBDRM_VC4 TESTS_progs_M += $(VC4_TESTS_M) endif -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PACTH i-g-t v4 13/13] lib/Makefile: Replace automake specific names of listings in Makefile.sources
From: Robert Foss <robert.f...@collabora.com> Replace the automake specific variable names for listings in Makefile.sources with something not automake specific. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/Android.mk | 2 +- lib/Makefile.am | 2 ++ lib/Makefile.sources | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Android.mk b/lib/Android.mk index badec1e..eb72f84 100644 --- a/lib/Android.mk +++ b/lib/Android.mk @@ -44,7 +44,7 @@ skip_lib_list := \ -DANDROID_HAS_CAIRO=0 endif -LOCAL_SRC_FILES := $(filter-out $(skip_lib_list),$(libintel_tools_la_SOURCES)) +LOCAL_SRC_FILES := $(filter-out $(skip_lib_list),$(lib_source_list)) include $(BUILD_STATIC_LIBRARY) diff --git a/lib/Makefile.am b/lib/Makefile.am index 365d7d9..4c0893d 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -5,6 +5,8 @@ SUBDIRS = . tests include Makefile.sources +libintel_tools_la_SOURCES = $(lib_source_list) + noinst_LTLIBRARIES = libintel_tools.la noinst_HEADERS = check-ndebug.h diff --git a/lib/Makefile.sources b/lib/Makefile.sources index f50ff4d..3cc33f4 100644 --- a/lib/Makefile.sources +++ b/lib/Makefile.sources @@ -1,4 +1,4 @@ -libintel_tools_la_SOURCES =\ +lib_source_list = \ debug.h \ drmtest.c \ drmtest.h \ -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PACTH i-g-t v4 05/13] tools/Makefile: Don't build tools that depend on libdrm_intel.
From: Robert Foss <robert.f...@collabora.com> Use the HAS_INTEL automake flag to avoid building tools that won't compile unless libdrm_intel is available in the build system. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tools/Android.mk | 5 + tools/Makefile.am | 5 + tools/Makefile.sources | 16 ++-- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/tools/Android.mk b/tools/Android.mk index 5f64184..306a4b5 100644 --- a/tools/Android.mk +++ b/tools/Android.mk @@ -67,6 +67,11 @@ ifneq ("${ANDROID_HAS_CAIRO}", "1") skip_tools_list += intel_residency endif +ifeq ($(HAVE_LIBDRM_INTEL),true) +bin_PROGRAMS += $(LIBDRM_INTEL_BIN) +intel_error_decode_LDFLAGS = -lz +endif + tools_list := $(filter-out $(skip_tools_list),$(bin_PROGRAMS)) $(foreach item,$(tools_list),$(eval $(call add_tool,$(item diff --git a/tools/Makefile.am b/tools/Makefile.am index 5f45144..f8ac0d8 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,5 +1,10 @@ include Makefile.sources +if HAVE_LIBDRM_INTEL + bin_PROGRAMS += $(LIBDRM_INTEL_BIN) + intel_error_decode_LDFLAGS = -lz +endif + SUBDIRS = null_state_gen registers AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib diff --git a/tools/Makefile.sources b/tools/Makefile.sources index 5d5958d..07d8d9b 100644 --- a/tools/Makefile.sources +++ b/tools/Makefile.sources @@ -13,11 +13,8 @@ bin_PROGRAMS = \ intel_bios_reader \ intel_display_crc \ intel_display_poller\ - intel_dump_decode \ - intel_error_decode \ intel_forcewaked\ intel_gpu_frequency \ - intel_framebuffer_dump \ intel_firmware_decode \ intel_gpu_time \ intel_gpu_top \ @@ -27,7 +24,6 @@ bin_PROGRAMS =\ intel_lid \ intel_opregion_decode \ intel_panel_fitter \ - intel_perf_counters \ intel_reg_checker \ intel_residency \ intel_stepping \ @@ -35,8 +31,12 @@ bin_PROGRAMS = \ dist_bin_SCRIPTS = intel_gpu_abrt -intel_dump_decode_SOURCES =\ - intel_dump_decode.c +LIBDRM_INTEL_BIN = \ + intel_dump_decode \ + intel_error_decode \ + intel_framebuffer_dump \ + intel_perf_counters \ + $(NULL) intel_reg_SOURCES =\ intel_reg.c \ @@ -44,10 +44,6 @@ intel_reg_SOURCES = \ intel_reg_spec.c\ intel_reg_spec.h -intel_error_decode_SOURCES = \ - intel_error_decode.c -intel_error_decode_LDFLAGS = -lz - intel_bios_reader_SOURCES =\ intel_bios_reader.c \ intel_bios.h -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PACTH i-g-t v4 07/13] demos/Makefile: Don't build tools that depend on libdrm_intel.
From: Robert Foss <robert.f...@collabora.com> Use the HAS_INTEL automake flag to avoid building tools that won't compile unless libdrm_intel is available in the build system. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- demos/Android.mk | 5 - demos/Makefile.am | 8 +--- demos/Makefile.sources | 7 +++ 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 demos/Makefile.sources diff --git a/demos/Android.mk b/demos/Android.mk index 7d06c9a..add2414 100644 --- a/demos/Android.mk +++ b/demos/Android.mk @@ -4,8 +4,11 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_SRC_FILES := intel_sprite_on.c +LOCAL_SRC_FILES := +ifeq ($(HAVE_LIBDRM_INTEL),true) +LOCAL_SRC_FILES += $(LIBDRM_INTEL_BIN) +endif LOCAL_CFLAGS += -DHAVE_TERMIOS_H LOCAL_CFLAGS += -DANDROID -UNDEBUG diff --git a/demos/Makefile.am b/demos/Makefile.am index f5725f4..48eb6c2 100644 --- a/demos/Makefile.am +++ b/demos/Makefile.am @@ -1,6 +1,8 @@ -bin_PROGRAMS = \ - intel_sprite_on \ - $(NULL) +include Makefile.sources + +if HAVE_LIBDRM_INTEL + bin_PROGRAMS += $(LIBDRM_INTEL_BIN) +endif AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \ diff --git a/demos/Makefile.sources b/demos/Makefile.sources new file mode 100644 index 000..302f6d9 --- /dev/null +++ b/demos/Makefile.sources @@ -0,0 +1,7 @@ +bin_PROGRAMS = \ + $(NULL) + +HAVE_LIBDRM_INTEL_BIN =\ + intel_sprite_on \ + $(NULL) + -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PACTH i-g-t v1] lib/drmtest: Change DRIVER_INTEL check to avoid running GEM on non-Intel
From: Robert Foss <robert.f...@collabora.com> Avoid running gem_quiescent_gpu() on non-Intel hardware. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/drmtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/drmtest.c b/lib/drmtest.c index 632fec4..6427657 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -338,7 +338,7 @@ int drm_open_driver(int chipset) if (__sync_fetch_and_add(_count, 1)) return fd; - if(chipset & DRIVER_INTEL){ + if(chipset == DRIVER_INTEL){ gem_quiescent_gpu(fd); igt_install_exit_handler(quiescent_gpu_at_exit); } -- 2.7.4 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PACTH i-g-t v1] lib/drmtest: Change DRIVER_INTEL check to avoid running GEM on non-Intel
Thanks Chris! On 2016-06-28 05:06 AM, Chris Wilson wrote: On Mon, Jun 27, 2016 at 01:53:13PM -0400, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> Avoid running gem_quiescent_gpu() on non-Intel hardware. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/drmtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/drmtest.c b/lib/drmtest.c index 632fec4..6427657 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -338,7 +338,7 @@ int drm_open_driver(int chipset) if (__sync_fetch_and_add(_count, 1)) return fd; - if(chipset & DRIVER_INTEL){ + if(chipset == DRIVER_INTEL){ That doesn't work. You need an is_i915_device() Took the liberty of making that change and pushing with your credit. -Chris ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v2 3/6] kms_panel_fitting: Remove un-used variable.
From: Robert Foss <robert.f...@collabora.com> ref_crc is never assigned or read, and can be safely removed. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 7bfd980..099816b 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -31,7 +31,6 @@ IGT_TEST_DESCRIPTION("Test display panel fitting"); typedef struct { int drm_fd; igt_display_t display; - igt_crc_t ref_crc; int image_w; int image_h; -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v2 5/6] kms_panel_fitting: Enabled test on non-Intel hardware.
From: Robert Foss <robert.f...@collabora.com> Switched from DRIVER_INTEL to DRIVER_ANY to enable test on all hardware. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 427bfc6..272a531 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -212,7 +212,7 @@ igt_simple_main igt_skip_on_simulation(); - data.drm_fd = drm_open_driver(DRIVER_INTEL); + data.drm_fd = drm_open_driver(DRIVER_ANY); igt_display_init(, data.drm_fd); test_panel_fitting(); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v2 4/6] kms_panel_fitting: Switched DRM format to a hardware agnostic alternative.
From: Robert Foss <robert.f...@collabora.com> Changed the DRM format to LOCAL_DRM_FORMAT_MOD_NONE since it is hardware agnostic. Also fixed formatting/tabs. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 099816b..427bfc6 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -65,10 +65,10 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe, /* allocate fb for plane 1 */ data->fb_id1 = igt_create_pattern_fb(data->drm_fd, -mode->hdisplay, mode->vdisplay, -DRM_FORMAT_XRGB, -LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */ ->fb1); + mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB, + LOCAL_DRM_FORMAT_MOD_NONE, + >fb1); igt_assert(data->fb_id1); /* @@ -159,7 +159,7 @@ static void test_panel_fitting(data_t *d) d->fb_id2 = igt_create_image_fb(d->drm_fd, 0, 0, DRM_FORMAT_XRGB, - LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */ + LOCAL_DRM_FORMAT_MOD_NONE, FILE_NAME, >fb2); igt_assert(d->fb_id2); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v2 0/6] Improve kms_panel_fitting.
From: Robert Foss <robert.f...@collabora.com> Changes since v1: - Squash patches - Based patch on https://lists.freedesktop.org/archives/intel-gfx/2016-March/090617.html Robert Foss (6): kms_panel_fitting: Remove un-read variable. kms_panel_fitting: Remove un-read variable pipe_crc. kms_panel_fitting: Remove un-used variable. kms_panel_fitting: Switched DRM format to a hardware agnostic alternative. kms_panel_fitting: Enabled test on non-Intel hardware. kms_panel_fitting: Add support for LVDS and DSI connectors. tests/kms_panel_fitting.c | 37 - 1 file changed, 16 insertions(+), 21 deletions(-) -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v2 6/6] kms_panel_fitting: Add support for LVDS and DSI connectors.
From: Robert Foss <robert.f...@collabora.com> Add support for DRM_MODE_CONNECTOR_LVDS and DRM_MODE_CONNECTOR_DSI connectors. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 272a531..f59d042 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -140,9 +140,16 @@ static void test_panel_fitting(data_t *d) for_each_connected_output(display, output) { drmModeModeInfo *mode, native_mode; - if (output->config.connector->connector_type != - DRM_MODE_CONNECTOR_eDP) - continue; + /* Ignore over incompatible connectors. */ + switch (output->config.connector->connector_type) + { + case DRM_MODE_CONNECTOR_LVDS: + case DRM_MODE_CONNECTOR_eDP: + case DRM_MODE_CONNECTOR_DSI: + break; + default: + continue; + } pipe = output->config.pipe; igt_output_set_pipe(output, pipe); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v2 1/6] kms_panel_fitting: Remove un-read variable.
From: Robert Foss <robert.f...@collabora.com> Remove devid from data_t since it is never read. Also remove one assignment to devid. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 1f9412f..43ad770 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -29,7 +29,6 @@ IGT_TEST_DESCRIPTION("Test display panel fitting"); typedef struct { - uint32_t devid; int drm_fd; igt_display_t display; igt_crc_t ref_crc; @@ -225,7 +224,6 @@ igt_simple_main data.drm_fd = drm_open_driver(DRIVER_INTEL); igt_require_pipe_crc(); igt_display_init(, data.drm_fd); - data.devid = intel_get_drm_devid(data.drm_fd); test_panel_fitting(); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v2 2/6] kms_panel_fitting: Remove un-read variable pipe_crc.
From: Robert Foss <robert.f...@collabora.com> pipe_crc in data_t is assigned an allocated memory space and then later free'd. But it is never used for any comparisons. It should therefore be safe to remove pipe_crc and the crc requirement. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 9 - 1 file changed, 9 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 43ad770..7bfd980 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -32,7 +32,6 @@ typedef struct { int drm_fd; igt_display_t display; igt_crc_t ref_crc; - igt_pipe_crc_t *pipe_crc; int image_w; int image_h; @@ -59,10 +58,6 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe, igt_output_set_pipe(output, pipe); - /* create the pipe_crc object for this pipe */ - igt_pipe_crc_free(data->pipe_crc); - data->pipe_crc = igt_pipe_crc_new(pipe, INTEL_PIPE_CRC_SOURCE_AUTO); - /* before allocating, free if any older fb */ if (data->fb_id1) { igt_remove_fb(data->drm_fd, >fb1); @@ -109,9 +104,6 @@ static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane) { igt_display_t *display = >display; - igt_pipe_crc_free(data->pipe_crc); - data->pipe_crc = NULL; - if (data->fb_id1) { igt_remove_fb(data->drm_fd, >fb1); data->fb_id1 = 0; @@ -222,7 +214,6 @@ igt_simple_main igt_skip_on_simulation(); data.drm_fd = drm_open_driver(DRIVER_INTEL); - igt_require_pipe_crc(); igt_display_init(, data.drm_fd); test_panel_fitting(); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v3 2/4] lib/igt_kms: Fix plane counting in igt_display_init.
From: Robert Foss <robert.f...@collabora.com> Fix issue where the plane counting fails due to the number and configuration of planes being unlike the intel configuration. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/igt_kms.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 36ecd4a..5751913 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1289,6 +1289,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) igt_plane_t *plane; int p = IGT_PLANE_2; int j, type; + uint8_t n_planes = 0; pipe->crtc_id = resources->crtcs[i]; pipe->display = display; @@ -1336,8 +1337,10 @@ void igt_display_init(igt_display_t *display, int drm_fd) break; } + n_planes++; plane->pipe = pipe; plane->drm_plane = drm_plane; + if (is_atomic == 0) { display->is_atomic = 1; igt_atomic_fill_plane_props(display, plane, IGT_NUM_PLANE_PROPS, igt_plane_prop_names); @@ -1386,8 +1389,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) plane->is_cursor = true; } - /* planes = 1 primary, (p-1) sprites, 1 cursor */ - pipe->n_planes = p + 1; + pipe->n_planes = n_planes; /* make sure we don't overflow the plane array */ igt_assert(pipe->n_planes <= IGT_MAX_PLANES); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v3 4/4] kms_vblank: Switch from using crtc0 statically to explicitly setting mode.
From: Robert Foss <robert.f...@collabora.com> Previously crtc0 was statically used for VBLANK tests, but that assumption is not valid for the VC4 platform. Instead we're now explicitly setting the mode. Also add support for testing all connected connectors during the same test. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_vblank.c | 179 + 1 file changed, 140 insertions(+), 39 deletions(-) diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c index 40ab6fd..970fefe 100644 --- a/tests/kms_vblank.c +++ b/tests/kms_vblank.c @@ -44,6 +44,14 @@ IGT_TEST_DESCRIPTION("Test speed of WaitVblank."); +typedef struct { + int drm_fd; + igt_display_t display; + struct igt_fb primary_fb; + igt_output_t *output; + enum pipe pipe; +} data_t; + static double elapsed(const struct timespec *start, const struct timespec *end, int loop) @@ -51,75 +59,164 @@ static double elapsed(const struct timespec *start, return (1e6*(end->tv_sec - start->tv_sec) + (end->tv_nsec - start->tv_nsec)/1000)/loop; } -static bool crtc0_active(int fd) +static uint32_t crtc_id_to_flag(uint32_t crtc_id) { - union drm_wait_vblank vbl; + if (crtc_id == 0) + return 0; + else if (crtc_id == 1) + return 1 | _DRM_VBLANK_SECONDARY; + else + return crtc_id << 1; +} - memset(, 0, sizeof(vbl)); - vbl.request.type = DRM_VBLANK_RELATIVE; - return drmIoctl(fd, DRM_IOCTL_WAIT_VBLANK, ) == 0; +static bool prepare_crtc(data_t *data, igt_output_t *output) +{ + drmModeModeInfo *mode; + igt_display_t *display = >display; + igt_plane_t *primary; + + /* select the pipe we want to use */ + igt_output_set_pipe(output, data->pipe); + igt_display_commit(display); + + if (!output->valid) { + igt_output_set_pipe(output, PIPE_ANY); + igt_display_commit(display); + return false; + } + + /* create and set the primary plane fb */ + mode = igt_output_get_mode(output); + igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB, + LOCAL_DRM_FORMAT_MOD_NONE, + 0.0, 0.0, 0.0, + >primary_fb); + + primary = igt_output_get_plane(output, IGT_PLANE_PRIMARY); + igt_plane_set_fb(primary, >primary_fb); + + igt_display_commit(display); + + igt_wait_for_vblank(data->drm_fd, data->pipe); + + return true; +} + +static void cleanup_crtc(data_t *data, igt_output_t *output) +{ + igt_display_t *display = >display; + igt_plane_t *primary; + + igt_remove_fb(data->drm_fd, >primary_fb); + + primary = igt_output_get_plane(output, IGT_PLANE_PRIMARY); + igt_plane_set_fb(primary, NULL); + + igt_output_set_pipe(output, PIPE_ANY); + igt_display_commit(display); } -static void accuracy(int fd) +static void run_test(data_t *data, void (*testfunc)(data_t *, bool), bool boolean) +{ + igt_display_t *display = >display; + igt_output_t *output; + enum pipe p; + int valid_tests = 0; + + for_each_connected_output(display, output) { + for_each_pipe(display, p) { + data->pipe = p; + + if (!prepare_crtc(data, output)) + continue; + + valid_tests++; + + igt_info("Beginning %s on pipe %s, connector %s\n", +igt_subtest_name(), +kmstest_pipe_name(data->pipe), +igt_output_name(output)); + + testfunc(data, boolean); + + igt_info("\n%s on pipe %s, connector %s: PASSED\n\n", +igt_subtest_name(), +kmstest_pipe_name(data->pipe), +igt_output_name(output)); + + /* cleanup what prepare_crtc() has done */ + cleanup_crtc(data, output); + } + } + + igt_require_f(valid_tests, "no valid crtc/connector combinations found\n"); +} + +static void accuracy(data_t *data, bool busy) { union drm_wait_vblank vbl; unsigned long target; + uint32_t crtc_id_flag; int n; memset(, 0, sizeof(vbl)); + crtc_id_flag = crtc_id_to_flag(data->pipe); - vbl.request.type = DRM_VBLANK_RELATIVE; + vbl.request.type = DRM_VBLANK_RELATIVE | crtc_id_flag; vbl.request.sequence = 1; - do_ioctl(fd, DRM_IOCTL_WAIT_VBLANK, ); +
[Intel-gfx] [PATCH i-g-t v3 1/4] lib/igt_kms: Add support for up to 10 planes.
From: Robert Foss <robert.f...@collabora.com> Increase the number of planes supported to 10. kmstest_plane_name only previously supported 4 planes, this patch adds support for up to 10 planes. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/igt_kms.c | 6 ++ lib/igt_kms.h | 11 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index ef24a49..36ecd4a 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -320,6 +320,12 @@ const char *kmstest_plane_name(enum igt_plane plane) [IGT_PLANE_1] = "plane1", [IGT_PLANE_2] = "plane2", [IGT_PLANE_3] = "plane3", + [IGT_PLANE_4] = "plane4", + [IGT_PLANE_5] = "plane5", + [IGT_PLANE_6] = "plane6", + [IGT_PLANE_7] = "plane7", + [IGT_PLANE_8] = "plane8", + [IGT_PLANE_9] = "plane9", [IGT_PLANE_CURSOR] = "cursor", }; diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 5c83401..b3fe1b2 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -48,12 +48,21 @@ enum pipe { }; const char *kmstest_pipe_name(enum pipe pipe); -/* We namespace this enum to not conflict with the Android i915_drm.h */ +/** + * We namespace this enum to not conflict with the Android i915_drm.h + * IGT_PLANE_CURSOR is always the last plane. + */ enum igt_plane { IGT_PLANE_1 = 0, IGT_PLANE_PRIMARY = IGT_PLANE_1, IGT_PLANE_2, IGT_PLANE_3, + IGT_PLANE_4, + IGT_PLANE_5, + IGT_PLANE_6, + IGT_PLANE_7, + IGT_PLANE_8, + IGT_PLANE_9, IGT_PLANE_CURSOR, IGT_MAX_PLANES, }; -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v3 3/4] lib/igt_kms: Switch to verbose assert.
From: Robert Foss <robert.f...@collabora.com> Switch igt_assert to igt_assert_lte to provide more diagnostic information. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/igt_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 5751913..99b6279 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1392,7 +1392,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) pipe->n_planes = n_planes; /* make sure we don't overflow the plane array */ - igt_assert(pipe->n_planes <= IGT_MAX_PLANES); + igt_assert_lte(pipe->n_planes, IGT_MAX_PLANES); } /* -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v3 0/4] kms_flip_event_leak and kms_vblank fixes for VC4.
From: Robert Foss <robert.f...@collabora.com> Changes since v2: - Rebased onto trunk which already contains kms_flip_event_leak changes. Changes since v1: - kms_vblank: Removed un-used members of data_t struct. - Rename plane_counter to n_planes. - Removed un-needed handling CURSOR plane location. - Added names for additional planes in update kmstest_plane_name. Robert Foss (4): lib/igt_kms: Add support for up to 10 planes. lib/igt_kms: Fix plane counting in igt_display_init. lib/igt_kms: Switch to verbose assert. kms_vblank: Switch from using crtc0 statically to explicitly setting mode. lib/igt_kms.c | 14 - lib/igt_kms.h | 11 +++- tests/kms_vblank.c | 179 + 3 files changed, 161 insertions(+), 43 deletions(-) -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t v2 6/6] kms_panel_fitting: Add support for LVDS and DSI connectors.
On 04/25/2016 11:10 AM, Ville Syrjälä wrote: On Mon, Apr 25, 2016 at 10:35:51AM -0400, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> Add support for DRM_MODE_CONNECTOR_LVDS and DRM_MODE_CONNECTOR_DSI connectors. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 272a531..f59d042 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -140,9 +140,16 @@ static void test_panel_fitting(data_t *d) for_each_connected_output(display, output) { drmModeModeInfo *mode, native_mode; - if (output->config.connector->connector_type != - DRM_MODE_CONNECTOR_eDP) - continue; + /* Ignore over incompatible connectors. */ + switch (output->config.connector->connector_type) + { + case DRM_MODE_CONNECTOR_LVDS: + case DRM_MODE_CONNECTOR_eDP: + case DRM_MODE_CONNECTOR_DSI: + break; + default: + continue; + } What happened to looking for the property? The "scaling mode" property? I was intentionally leaving it out. If desired, I could look into adding that too. I've looked for and not found the "scaling mode" property id, but I still haven't found it. Do you know what it is? pipe = output->config.pipe; igt_output_set_pipe(output, pipe); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 1/7] kms_panel_fitting: Remove un-read variable.
From: Robert Foss <robert.f...@collabora.com> Remove devid from data_t since it is never read. Also remove one assignment to devid. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 829d9cd..ab06d25 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -29,7 +29,6 @@ IGT_TEST_DESCRIPTION("Test display panel fitting"); typedef struct { - uint32_t devid; int drm_fd; igt_display_t display; igt_crc_t ref_crc; @@ -224,7 +223,6 @@ igt_simple_main data.drm_fd = drm_open_driver(DRIVER_INTEL); igt_require_pipe_crc(); igt_display_init(, data.drm_fd); - data.devid = intel_get_drm_devid(data.drm_fd); test_panel_fitting(); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 4/7] kms_panel_fitting: Switched DRM format to a hardware agnostic alternative.
From: Robert Foss <robert.f...@collabora.com> Changed the DRM format to LOCAL_DRM_FORMAT_MOD_NONE since it is hardware agnostic. Also fixed formatting/tabs. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index dface97..ec7ce21 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -65,10 +65,10 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe, /* allocate fb for plane 1 */ data->fb_id1 = igt_create_pattern_fb(data->drm_fd, -mode->hdisplay, mode->vdisplay, -DRM_FORMAT_XRGB, -LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */ ->fb1); + mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB, + LOCAL_DRM_FORMAT_MOD_NONE, + >fb1); igt_assert(data->fb_id1); /* @@ -158,7 +158,7 @@ static void test_panel_fitting(data_t *d) d->fb_id2 = igt_create_image_fb(d->drm_fd, 0, 0, DRM_FORMAT_XRGB, - LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */ + LOCAL_DRM_FORMAT_MOD_NONE, FILE_NAME, >fb2); igt_assert(d->fb_id2); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 3/7] kms_panel_fitting: Remove un-used variable.
From: Robert Foss <robert.f...@collabora.com> ref_crc is never assigned or read, and can be safely removed. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index b64e829..dface97 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -31,7 +31,6 @@ IGT_TEST_DESCRIPTION("Test display panel fitting"); typedef struct { int drm_fd; igt_display_t display; - igt_crc_t ref_crc; int image_w; int image_h; -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 6/7] kms_panel_fitting: Don't skip test after finding an incompatible connector.
From: Robert Foss <robert.f...@collabora.com> If an incompatible connector is found, don't skip the test, but rather keep looking for valid connectors. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 2398a5e..60a22b0 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -140,8 +140,9 @@ static void test_panel_fitting(data_t *d) for_each_connected_output(display, output) { drmModeModeInfo *mode, native_mode; - igt_require(output->config.connector->connector_type == - DRM_MODE_CONNECTOR_eDP); + if (output->config.connector->connector_type != + DRM_MODE_CONNECTOR_eDP) + continue; pipe = output->config.pipe; igt_output_set_pipe(output, pipe); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 0/7] Improve kms_panel_fitting.
From: Robert Foss <robert.f...@collabora.com> This series removes some dead code from kms_panel_fitting and enables support for LVDS and DSI connectors. Robert Foss (7): kms_panel_fitting: Remove un-read variable. kms_panel_fitting: Remove un-read variable pipe_crc. kms_panel_fitting: Remove un-used variable. kms_panel_fitting: Switched DRM format to a hardware agnostic alternative. kms_panel_fitting: Enabled test on non-Intel hardware. kms_panel_fitting: Don't skip test after finding an incompatible connector. kms_panel_fitting: Add support for LVDS and DSI connectors. tests/kms_panel_fitting.c | 35 +++ 1 file changed, 15 insertions(+), 20 deletions(-) -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 7/7] kms_panel_fitting: Add support for LVDS and DSI connectors.
From: Robert Foss <robert.f...@collabora.com> Add support for DRM_MODE_CONNECTOR_LVDS and DRM_MODE_CONNECTOR_DSI connectors. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 60a22b0..933776c 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -140,9 +140,15 @@ static void test_panel_fitting(data_t *d) for_each_connected_output(display, output) { drmModeModeInfo *mode, native_mode; - if (output->config.connector->connector_type != - DRM_MODE_CONNECTOR_eDP) - continue; + switch (output->config.connector->connector_type) + { + case DRM_MODE_CONNECTOR_LVDS: + case DRM_MODE_CONNECTOR_eDP: + case DRM_MODE_CONNECTOR_DSI: + break; + default: + continue; + } pipe = output->config.pipe; igt_output_set_pipe(output, pipe); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 5/7] kms_panel_fitting: Enabled test on non-Intel hardware.
From: Robert Foss <robert.f...@collabora.com> Switched from DRIVER_INTEL to DRIVER_ANY to enable test on all hardware. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index ec7ce21..2398a5e 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -211,7 +211,7 @@ igt_simple_main igt_skip_on_simulation(); - data.drm_fd = drm_open_driver(DRIVER_INTEL); + data.drm_fd = drm_open_driver(DRIVER_ANY); igt_display_init(, data.drm_fd); test_panel_fitting(); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 2/7] kms_panel_fitting: Remove un-read variable pipe_crc.
From: Robert Foss <robert.f...@collabora.com> pipe_crc in data_t is assigned an allocated memory space and then later free'd. But it is never used for any comparisons. It should therefore be safe to remove pipe_crc and the crc requirement. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 9 - 1 file changed, 9 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index ab06d25..b64e829 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -32,7 +32,6 @@ typedef struct { int drm_fd; igt_display_t display; igt_crc_t ref_crc; - igt_pipe_crc_t *pipe_crc; int image_w; int image_h; @@ -59,10 +58,6 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe, igt_output_set_pipe(output, pipe); - /* create the pipe_crc object for this pipe */ - igt_pipe_crc_free(data->pipe_crc); - data->pipe_crc = igt_pipe_crc_new(pipe, INTEL_PIPE_CRC_SOURCE_AUTO); - /* before allocating, free if any older fb */ if (data->fb_id1) { igt_remove_fb(data->drm_fd, >fb1); @@ -109,9 +104,6 @@ static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane) { igt_display_t *display = >display; - igt_pipe_crc_free(data->pipe_crc); - data->pipe_crc = NULL; - if (data->fb_id1) { igt_remove_fb(data->drm_fd, >fb1); data->fb_id1 = 0; @@ -221,7 +213,6 @@ igt_simple_main igt_skip_on_simulation(); data.drm_fd = drm_open_driver(DRIVER_INTEL); - igt_require_pipe_crc(); igt_display_init(, data.drm_fd); test_panel_fitting(); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t 3/7] lib/igt_kms: Make sure that default planes aren't overwritten.
On 04/21/2016 10:50 AM, Daniel Vetter wrote: On Wed, Apr 20, 2016 at 10:59:45AM -0400, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> Avoid overwriting planes with statically asigned indices with planes that have dynamically assigned indices. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/igt_kms.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 07fb73b..3f953ec 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1326,6 +1326,8 @@ void igt_display_init(igt_display_t *display, int drm_fd) display->has_universal_planes = 1; break; default: + while (p == IGT_PLANE_PRIMARY || p == IGT_PLANE_CURSOR) + p++; What we might need to do is to actually make primary and cursor dynamically assigned. Since with most drivers that's the case that happens. Otoh we have a variable number of planes on i915 too, so not entirely sure now what's going on here ... -Daniel Since PRIMARY and CURSOR planes are statically assigned and that the other cases in this switch statement used the static assignments, the loop simply makes sure the we don't overwrite the PRIMARY or CURSOR plane. plane = >planes[p]; plane->index = p++; break; -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t] lib/igt_kms: Move IGT_MAX_PLANES into the igt_plane enum
Makes sure we automatically extend that when adding more planes. Inspired by a patch from Robert Foss who extended the max, but forgot all about the enum. While at it, also fix up the whitespace damage. Cc: robert.f...@collabora.com Signed-off-by: Daniel Vetter <daniel.vet...@intel.com> This looks reasonable to me and is definitely an improvement. Ack on this patch. --- lib/igt_kms.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 2c189ed47d04..5c8340171ab6 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -50,11 +50,12 @@ const char *kmstest_pipe_name(enum pipe pipe); /* We namespace this enum to not conflict with the Android i915_drm.h */ enum igt_plane { -IGT_PLANE_1 = 0, -IGT_PLANE_PRIMARY = IGT_PLANE_1, -IGT_PLANE_2, -IGT_PLANE_3, -IGT_PLANE_CURSOR, + IGT_PLANE_1 = 0, + IGT_PLANE_PRIMARY = IGT_PLANE_1, + IGT_PLANE_2, + IGT_PLANE_3, + IGT_PLANE_CURSOR, + IGT_MAX_PLANES, }; const char *kmstest_plane_name(enum igt_plane plane); @@ -267,7 +268,6 @@ struct igt_pipe { igt_display_t *display; enum pipe pipe; bool enabled; -#define IGT_MAX_PLANES 4 int n_planes; igt_plane_t planes[IGT_MAX_PLANES]; uint64_t background; /* Background color MSB BGR 16bpc LSB */ ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t 4/7] lib/igt_kms: Only move the in cursor plane for Intel hw.
On 04/21/2016 10:48 AM, Daniel Vetter wrote: On Wed, Apr 20, 2016 at 10:59:46AM -0400, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> Avoid moving the cursor plane when on non-intel hardware. Running the move block on hardware with more than IGT_PLANE_CURSOR number of planes causes planes do be zeroed out. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/igt_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 3f953ec..522ede5 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1363,7 +1363,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) * only 1 sprite, that's the wrong slot and we need to * move it down. */ - if (p != IGT_PLANE_CURSOR) { + if (IS_INTEL(drm_fd) && p != IGT_PLANE_CURSOR) { Reading this again, isn't the problem that on some hw there's simply no cursor plane? With universal planes the cursor plane should alias with some of the real planes, and we simply need to make sure that we get that aliasing right. But if there's no cursor registered, well there's no cursor ... -Daniel From my point of view the problem is differentiating between the cases when IGT_PLANE_CURSOR is aliasing with IGT_PLANE_4 (IGT_PLANE_3+1). IGT_PLANE_CURSOR is assumed to be the last plane in the if statement, which isn't the case for platform with more than 4 planes. So identifying which platforms this assumption is true (IS_INTEL()) and only proceeding for those platforms seemed like reasonable fix. Maybe a more generic solution is preferable. pipe->planes[p] = pipe->planes[IGT_PLANE_CURSOR]; pipe->planes[p].index = p; memset(>planes[IGT_PLANE_CURSOR], 0, -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v2 1/6] lib/igt_kms: Move IGT_MAX_PLANES into the igt_plane enum
From: Robert Foss <robert.f...@collabora.com> Makes sure we automatically extend that when adding more planes. Inspired by a patch from Robert Foss who extended the max, but forgot all about the enum. While at it, also fix up the whitespace damage. Cc: robert.f...@collabora.com Author: Daniel Vetter <daniel.vet...@intel.com> Signed-off-by: Daniel Vetter <daniel.vet...@intel.com> --- lib/igt_kms.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 2c189ed..5c83401 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -50,11 +50,12 @@ const char *kmstest_pipe_name(enum pipe pipe); /* We namespace this enum to not conflict with the Android i915_drm.h */ enum igt_plane { -IGT_PLANE_1 = 0, -IGT_PLANE_PRIMARY = IGT_PLANE_1, -IGT_PLANE_2, -IGT_PLANE_3, -IGT_PLANE_CURSOR, + IGT_PLANE_1 = 0, + IGT_PLANE_PRIMARY = IGT_PLANE_1, + IGT_PLANE_2, + IGT_PLANE_3, + IGT_PLANE_CURSOR, + IGT_MAX_PLANES, }; const char *kmstest_plane_name(enum igt_plane plane); @@ -267,7 +268,6 @@ struct igt_pipe { igt_display_t *display; enum pipe pipe; bool enabled; -#define IGT_MAX_PLANES 4 int n_planes; igt_plane_t planes[IGT_MAX_PLANES]; uint64_t background; /* Background color MSB BGR 16bpc LSB */ -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v2 6/6] kms_vblank: Switch from using crtc0 statically to explicitly setting mode.
From: Robert Foss <robert.f...@collabora.com> Previously crtc0 was statically used for VBLANK tests, but that assumption is not valid for the VC4 platform. Instead we're now explicitly setting the mode. Also add support for testing all connected connectors during the same test. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_vblank.c | 179 + 1 file changed, 140 insertions(+), 39 deletions(-) diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c index 40ab6fd..970fefe 100644 --- a/tests/kms_vblank.c +++ b/tests/kms_vblank.c @@ -44,6 +44,14 @@ IGT_TEST_DESCRIPTION("Test speed of WaitVblank."); +typedef struct { + int drm_fd; + igt_display_t display; + struct igt_fb primary_fb; + igt_output_t *output; + enum pipe pipe; +} data_t; + static double elapsed(const struct timespec *start, const struct timespec *end, int loop) @@ -51,75 +59,164 @@ static double elapsed(const struct timespec *start, return (1e6*(end->tv_sec - start->tv_sec) + (end->tv_nsec - start->tv_nsec)/1000)/loop; } -static bool crtc0_active(int fd) +static uint32_t crtc_id_to_flag(uint32_t crtc_id) { - union drm_wait_vblank vbl; + if (crtc_id == 0) + return 0; + else if (crtc_id == 1) + return 1 | _DRM_VBLANK_SECONDARY; + else + return crtc_id << 1; +} - memset(, 0, sizeof(vbl)); - vbl.request.type = DRM_VBLANK_RELATIVE; - return drmIoctl(fd, DRM_IOCTL_WAIT_VBLANK, ) == 0; +static bool prepare_crtc(data_t *data, igt_output_t *output) +{ + drmModeModeInfo *mode; + igt_display_t *display = >display; + igt_plane_t *primary; + + /* select the pipe we want to use */ + igt_output_set_pipe(output, data->pipe); + igt_display_commit(display); + + if (!output->valid) { + igt_output_set_pipe(output, PIPE_ANY); + igt_display_commit(display); + return false; + } + + /* create and set the primary plane fb */ + mode = igt_output_get_mode(output); + igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB, + LOCAL_DRM_FORMAT_MOD_NONE, + 0.0, 0.0, 0.0, + >primary_fb); + + primary = igt_output_get_plane(output, IGT_PLANE_PRIMARY); + igt_plane_set_fb(primary, >primary_fb); + + igt_display_commit(display); + + igt_wait_for_vblank(data->drm_fd, data->pipe); + + return true; +} + +static void cleanup_crtc(data_t *data, igt_output_t *output) +{ + igt_display_t *display = >display; + igt_plane_t *primary; + + igt_remove_fb(data->drm_fd, >primary_fb); + + primary = igt_output_get_plane(output, IGT_PLANE_PRIMARY); + igt_plane_set_fb(primary, NULL); + + igt_output_set_pipe(output, PIPE_ANY); + igt_display_commit(display); } -static void accuracy(int fd) +static void run_test(data_t *data, void (*testfunc)(data_t *, bool), bool boolean) +{ + igt_display_t *display = >display; + igt_output_t *output; + enum pipe p; + int valid_tests = 0; + + for_each_connected_output(display, output) { + for_each_pipe(display, p) { + data->pipe = p; + + if (!prepare_crtc(data, output)) + continue; + + valid_tests++; + + igt_info("Beginning %s on pipe %s, connector %s\n", +igt_subtest_name(), +kmstest_pipe_name(data->pipe), +igt_output_name(output)); + + testfunc(data, boolean); + + igt_info("\n%s on pipe %s, connector %s: PASSED\n\n", +igt_subtest_name(), +kmstest_pipe_name(data->pipe), +igt_output_name(output)); + + /* cleanup what prepare_crtc() has done */ + cleanup_crtc(data, output); + } + } + + igt_require_f(valid_tests, "no valid crtc/connector combinations found\n"); +} + +static void accuracy(data_t *data, bool busy) { union drm_wait_vblank vbl; unsigned long target; + uint32_t crtc_id_flag; int n; memset(, 0, sizeof(vbl)); + crtc_id_flag = crtc_id_to_flag(data->pipe); - vbl.request.type = DRM_VBLANK_RELATIVE; + vbl.request.type = DRM_VBLANK_RELATIVE | crtc_id_flag; vbl.request.sequence = 1; - do_ioctl(fd, DRM_IOCTL_WAIT_VBLANK, ); +
[Intel-gfx] [PATCH i-g-t v2 2/6] lib/igt_kms: Add support for up to 10 planes.
From: Robert Foss <robert.f...@collabora.com> Increase the number of planes supported to 10. kmstest_plane_name only previously supported 4 planes, this patch adds support for up to 10 planes. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/igt_kms.c | 6 ++ lib/igt_kms.h | 11 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index ef24a49..36ecd4a 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -320,6 +320,12 @@ const char *kmstest_plane_name(enum igt_plane plane) [IGT_PLANE_1] = "plane1", [IGT_PLANE_2] = "plane2", [IGT_PLANE_3] = "plane3", + [IGT_PLANE_4] = "plane4", + [IGT_PLANE_5] = "plane5", + [IGT_PLANE_6] = "plane6", + [IGT_PLANE_7] = "plane7", + [IGT_PLANE_8] = "plane8", + [IGT_PLANE_9] = "plane9", [IGT_PLANE_CURSOR] = "cursor", }; diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 5c83401..b3fe1b2 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -48,12 +48,21 @@ enum pipe { }; const char *kmstest_pipe_name(enum pipe pipe); -/* We namespace this enum to not conflict with the Android i915_drm.h */ +/** + * We namespace this enum to not conflict with the Android i915_drm.h + * IGT_PLANE_CURSOR is always the last plane. + */ enum igt_plane { IGT_PLANE_1 = 0, IGT_PLANE_PRIMARY = IGT_PLANE_1, IGT_PLANE_2, IGT_PLANE_3, + IGT_PLANE_4, + IGT_PLANE_5, + IGT_PLANE_6, + IGT_PLANE_7, + IGT_PLANE_8, + IGT_PLANE_9, IGT_PLANE_CURSOR, IGT_MAX_PLANES, }; -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v2 0/6] kms_flip_event_leak and kms_vblank fixes for VC4
From: Robert Foss <robert.f...@collabora.com> Changes since v1: - Removed un-used members of data_t struct in kms_vblank.c. - Renamed plane_counter to n_planes. - Removed un-needed handling CURSOR plane location. - Added names for additional planes in update kmstest_plane_name. Robert Foss (6): lib/igt_kms: Move IGT_MAX_PLANES into the igt_plane enum lib/igt_kms: Add support for up to 10 planes. lib/igt_kms: Fix plane counting in igt_display_init. lib/igt_kms: Switch to verbose assert. kms_flip_event_leak: Enable test on DRIVER_ANY. kms_vblank: Switch from using crtc0 statically to explicitly setting mode. lib/igt_kms.c | 14 +++- lib/igt_kms.h | 23 -- tests/kms_flip_event_leak.c | 8 +- tests/kms_vblank.c | 179 ++-- 4 files changed, 171 insertions(+), 53 deletions(-) -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v2 3/6] lib/igt_kms: Fix plane counting in igt_display_init.
From: Robert Foss <robert.f...@collabora.com> Fix issue where the plane counting fails due to the number and configuration of planes being unlike the intel configuration. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/igt_kms.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 36ecd4a..5751913 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1289,6 +1289,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) igt_plane_t *plane; int p = IGT_PLANE_2; int j, type; + uint8_t n_planes = 0; pipe->crtc_id = resources->crtcs[i]; pipe->display = display; @@ -1336,8 +1337,10 @@ void igt_display_init(igt_display_t *display, int drm_fd) break; } + n_planes++; plane->pipe = pipe; plane->drm_plane = drm_plane; + if (is_atomic == 0) { display->is_atomic = 1; igt_atomic_fill_plane_props(display, plane, IGT_NUM_PLANE_PROPS, igt_plane_prop_names); @@ -1386,8 +1389,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) plane->is_cursor = true; } - /* planes = 1 primary, (p-1) sprites, 1 cursor */ - pipe->n_planes = p + 1; + pipe->n_planes = n_planes; /* make sure we don't overflow the plane array */ igt_assert(pipe->n_planes <= IGT_MAX_PLANES); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v2 4/6] lib/igt_kms: Switch to verbose assert.
From: Robert Foss <robert.f...@collabora.com> Switch igt_assert to igt_assert_lte to provide more diagnostic information. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/igt_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 5751913..99b6279 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1392,7 +1392,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) pipe->n_planes = n_planes; /* make sure we don't overflow the plane array */ - igt_assert(pipe->n_planes <= IGT_MAX_PLANES); + igt_assert_lte(pipe->n_planes, IGT_MAX_PLANES); } /* -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v2 5/6] kms_flip_event_leak: Enable test on DRIVER_ANY.
From: Robert Foss <robert.f...@collabora.com> Change DRIVER_INTEL to DRIVER_ANY to enable tests/kms_flip_event_leak on any driver. Switch the tiling format to something intel indenpendant. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_flip_event_leak.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/kms_flip_event_leak.c b/tests/kms_flip_event_leak.c index c19ed98..a1389b4 100644 --- a/tests/kms_flip_event_leak.c +++ b/tests/kms_flip_event_leak.c @@ -62,13 +62,13 @@ static bool test(data_t *data, enum pipe pipe, igt_output_t *output) igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB, - LOCAL_I915_FORMAT_MOD_X_TILED, + LOCAL_DRM_FORMAT_MOD_NONE, 0.0, 0.0, 0.0, [0]); igt_plane_set_fb(primary, [0]); igt_display_commit2(>display, COMMIT_LEGACY); - fd = drm_open_driver(DRIVER_INTEL); + fd = drm_open_driver(DRIVER_ANY); ret = drmDropMaster(data->drm_fd); igt_assert_eq(ret, 0); @@ -78,7 +78,7 @@ static bool test(data_t *data, enum pipe pipe, igt_output_t *output) igt_create_color_fb(fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB, - LOCAL_I915_FORMAT_MOD_X_TILED, + LOCAL_DRM_FORMAT_MOD_NONE, 0.0, 0.0, 0.0, [1]); ret = drmModePageFlip(fd, output->config.crtc->crtc_id, fb[1].fb_id, DRM_MODE_PAGE_FLIP_EVENT, @@ -109,7 +109,7 @@ igt_simple_main igt_skip_on_simulation(); - data.drm_fd = drm_open_driver_master(DRIVER_INTEL); + data.drm_fd = drm_open_driver_master(DRIVER_ANY); kmstest_set_vt_graphics_mode(); igt_display_init(, data.drm_fd); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t 3/7] lib/igt_kms: Make sure that default planes aren't overwritten.
On 04/22/2016 08:53 AM, Daniel Vetter wrote: On Thu, Apr 21, 2016 at 01:31:48PM -0400, Robert Foss wrote: On 04/21/2016 10:50 AM, Daniel Vetter wrote: On Wed, Apr 20, 2016 at 10:59:45AM -0400, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> Avoid overwriting planes with statically asigned indices with planes that have dynamically assigned indices. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/igt_kms.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 07fb73b..3f953ec 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1326,6 +1326,8 @@ void igt_display_init(igt_display_t *display, int drm_fd) display->has_universal_planes = 1; break; default: + while (p == IGT_PLANE_PRIMARY || p == IGT_PLANE_CURSOR) + p++; What we might need to do is to actually make primary and cursor dynamically assigned. Since with most drivers that's the case that happens. Otoh we have a variable number of planes on i915 too, so not entirely sure now what's going on here ... -Daniel Since PRIMARY and CURSOR planes are statically assigned and that the other cases in this switch statement used the static assignments, the loop simply makes sure the we don't overwrite the PRIMARY or CURSOR plane. Well primary should be first, cursor last ... Are there drivers which register planes in a funny order that we need this? If so a comment would be good I think. -Daniel I wasn't aware of the cursor plane always being last one. I'll have the v2 patches reflect this. plane = >planes[p]; plane->index = p++; break; -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v5 1/6] kms_panel_fitting: Remove un-read variable.
From: Robert Foss <robert.f...@collabora.com> Remove devid from data_t since it is never read. Also remove one assignment to devid. Signed-off-by: Robert Foss <robert.f...@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.viz...@collabora.com> --- tests/kms_panel_fitting.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 1f9412f..43ad770 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -29,7 +29,6 @@ IGT_TEST_DESCRIPTION("Test display panel fitting"); typedef struct { - uint32_t devid; int drm_fd; igt_display_t display; igt_crc_t ref_crc; @@ -225,7 +224,6 @@ igt_simple_main data.drm_fd = drm_open_driver(DRIVER_INTEL); igt_require_pipe_crc(); igt_display_init(, data.drm_fd); - data.devid = intel_get_drm_devid(data.drm_fd); test_panel_fitting(); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v5 3/6] kms_panel_fitting: Remove un-used variable.
From: Robert Foss <robert.f...@collabora.com> ref_crc is never assigned or read, and can be safely removed. Signed-off-by: Robert Foss <robert.f...@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.viz...@collabora.com> --- tests/kms_panel_fitting.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 7bfd980..099816b 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -31,7 +31,6 @@ IGT_TEST_DESCRIPTION("Test display panel fitting"); typedef struct { int drm_fd; igt_display_t display; - igt_crc_t ref_crc; int image_w; int image_h; -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v5 2/6] kms_panel_fitting: Remove un-read variable pipe_crc.
From: Robert Foss <robert.f...@collabora.com> pipe_crc in data_t is assigned an allocated memory space and then later free'd. But it is never used for any comparisons. It should therefore be safe to remove pipe_crc and the crc requirement. Signed-off-by: Robert Foss <robert.f...@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.viz...@collabora.com> --- tests/kms_panel_fitting.c | 9 - 1 file changed, 9 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 43ad770..7bfd980 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -32,7 +32,6 @@ typedef struct { int drm_fd; igt_display_t display; igt_crc_t ref_crc; - igt_pipe_crc_t *pipe_crc; int image_w; int image_h; @@ -59,10 +58,6 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe, igt_output_set_pipe(output, pipe); - /* create the pipe_crc object for this pipe */ - igt_pipe_crc_free(data->pipe_crc); - data->pipe_crc = igt_pipe_crc_new(pipe, INTEL_PIPE_CRC_SOURCE_AUTO); - /* before allocating, free if any older fb */ if (data->fb_id1) { igt_remove_fb(data->drm_fd, >fb1); @@ -109,9 +104,6 @@ static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane) { igt_display_t *display = >display; - igt_pipe_crc_free(data->pipe_crc); - data->pipe_crc = NULL; - if (data->fb_id1) { igt_remove_fb(data->drm_fd, >fb1); data->fb_id1 = 0; @@ -222,7 +214,6 @@ igt_simple_main igt_skip_on_simulation(); data.drm_fd = drm_open_driver(DRIVER_INTEL); - igt_require_pipe_crc(); igt_display_init(, data.drm_fd); test_panel_fitting(); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v5 0/6] Improve kms_panel_fitting.
From: Robert Foss <robert.f...@collabora.com> Changes since v4: - Added reviewed-by danvet to patch 6, all patches are now reviewed. Changes since v3: - kms_panel_fitting.c: Pass NULL arguments instead - Added bugzilla link: https://bugs.freedesktop.org/show_bug.cgi?id=93012 Changes since v2: - Added reviewed-by tomeu to patch 1-5. - kms_panel_fitting.c: Replaced connector type checking with "scaling mode" property check. Changes since v1: - Squash patches - Based patch on https://lists.freedesktop.org/archives/intel-gfx/2016-March/090617.html Robert Foss (6): kms_panel_fitting: Remove un-read variable. kms_panel_fitting: Remove un-read variable pipe_crc. kms_panel_fitting: Remove un-used variable. kms_panel_fitting: Switched DRM format to a hardware agnostic alternative. kms_panel_fitting: Enabled test on non-Intel hardware. kms_panel_fitting: Enable connectors with "scaling mode" property set. tests/kms_panel_fitting.c | 39 ++- 1 file changed, 18 insertions(+), 21 deletions(-) -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v5 5/6] kms_panel_fitting: Enabled test on non-Intel hardware.
From: Robert Foss <robert.f...@collabora.com> Switched from DRIVER_INTEL to DRIVER_ANY to enable test on all hardware. Signed-off-by: Robert Foss <robert.f...@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.viz...@collabora.com> --- tests/kms_panel_fitting.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 427bfc6..272a531 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -212,7 +212,7 @@ igt_simple_main igt_skip_on_simulation(); - data.drm_fd = drm_open_driver(DRIVER_INTEL); + data.drm_fd = drm_open_driver(DRIVER_ANY); igt_display_init(, data.drm_fd); test_panel_fitting(); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t 7/7] kms_panel_fitting: Add support for LVDS and DSI connectors.
On 04/28/2016 04:02 AM, Daniel Vetter wrote: On Tue, Apr 26, 2016 at 01:08:35PM -0400, Robert Foss wrote: On 04/26/2016 01:00 PM, Ville Syrjälä wrote: On Tue, Apr 26, 2016 at 12:55:54PM -0400, Robert Foss wrote: On 04/26/2016 10:11 AM, Daniel Vetter wrote: On Fri, Apr 22, 2016 at 05:25:00PM -0400, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> Add support for DRM_MODE_CONNECTOR_LVDS and DRM_MODE_CONNECTOR_DSI connectors. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 60a22b0..933776c 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -140,9 +140,15 @@ static void test_panel_fitting(data_t *d) for_each_connected_output(display, output) { drmModeModeInfo *mode, native_mode; - if (output->config.connector->connector_type != - DRM_MODE_CONNECTOR_eDP) - continue; + switch (output->config.connector->connector_type) + { + case DRM_MODE_CONNECTOR_LVDS: + case DRM_MODE_CONNECTOR_eDP: + case DRM_MODE_CONNECTOR_DSI: + break; + default: + continue; + } I think ville commented that we should instead check for "scaling mode", and we discussed this on irc. Am I accidentally looking at an old patch series? -Daniel No, this isn't an old patch, I misunderstood where our conversation ended. "scaling mode" is an intel specific extension as far as I understand it, which is somewhat the opposite of generalizing i-g-t tests. Is there an architecture independent way forward? A quick poke at cscope tells me "scaling mode" is used by amdgpu, gma500, i915, nouveau, and radeon. Seems fairly independent to me. If that is the case, and it seems to be, "scaling mode" is definitely worth pursuing. Perhaps also send in a kernel patch to update the docbook table? It's awful, but the best thing we have right now ... -Daniel Other than a Description/Restrictions entry for "scaling mode", is there anything you'd like to see added? ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v5 4/6] kms_panel_fitting: Switched DRM format to a hardware agnostic alternative.
From: Robert Foss <robert.f...@collabora.com> Changed the DRM format to LOCAL_DRM_FORMAT_MOD_NONE since it is hardware agnostic. Also fixed formatting/tabs. Signed-off-by: Robert Foss <robert.f...@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.viz...@collabora.com> --- tests/kms_panel_fitting.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 099816b..427bfc6 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -65,10 +65,10 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe, /* allocate fb for plane 1 */ data->fb_id1 = igt_create_pattern_fb(data->drm_fd, -mode->hdisplay, mode->vdisplay, -DRM_FORMAT_XRGB, -LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */ ->fb1); + mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB, + LOCAL_DRM_FORMAT_MOD_NONE, + >fb1); igt_assert(data->fb_id1); /* @@ -159,7 +159,7 @@ static void test_panel_fitting(data_t *d) d->fb_id2 = igt_create_image_fb(d->drm_fd, 0, 0, DRM_FORMAT_XRGB, - LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */ + LOCAL_DRM_FORMAT_MOD_NONE, FILE_NAME, >fb2); igt_assert(d->fb_id2); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v5 6/6] kms_panel_fitting: Enable connectors with "scaling mode" property set.
From: Robert Foss <robert.f...@collabora.com> Enable testing on all connectors that have the "scaling mode" property set. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93012 Signed-off-by: Robert Foss <robert.f...@collabora.com> Reviewed-by: Daniel Vetter <daniel.vet...@ffwll.ch> --- tests/kms_panel_fitting.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 272a531..b796c68 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -139,9 +139,18 @@ static void test_panel_fitting(data_t *d) for_each_connected_output(display, output) { drmModeModeInfo *mode, native_mode; - - if (output->config.connector->connector_type != - DRM_MODE_CONNECTOR_eDP) + bool scaling_mode_set; + + scaling_mode_set = kmstest_get_property(d->drm_fd, + output->config.connector->connector_id, + DRM_MODE_OBJECT_CONNECTOR, + "scaling mode", + NULL, + NULL, + NULL); + + /* Check that the "scaling mode" property has been set. */ + if (!scaling_mode_set) continue; pipe = output->config.pipe; -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t 6/7] kms_panel_fitting: Don't skip test after finding an incompatible connector.
On 04/26/2016 10:10 AM, Daniel Vetter wrote: On Fri, Apr 22, 2016 at 05:24:59PM -0400, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> If an incompatible connector is found, don't skip the test, but rather keep looking for valid connectors. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 2398a5e..60a22b0 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -140,8 +140,9 @@ static void test_panel_fitting(data_t *d) for_each_connected_output(display, output) { drmModeModeInfo *mode, native_mode; - igt_require(output->config.connector->connector_type == - DRM_MODE_CONNECTOR_eDP); + if (output->config.connector->connector_type != + DRM_MODE_CONNECTOR_eDP) + continue; Needs a counter to make sure we end up at least with one successful run. See e.g kms_cursor_crc. for_each_config { if (unsuitable_conntector) continue; /* test code */ valid_configs++; } igt_require(valid_configs); I thought about extracting this into an igt block as a helper, but every tests has it's own idea of how to write for_each_config and when to skip. So hand-rolling everywhere unfortunately :( -Daniel But isn't there already a check like that in trunk? int valid_tests = 0; for_each_connected_output { /* test code */ valid_tests++; } igt_require_f(valid_tests, "no valid crtc/connector\n"); pipe = output->config.pipe; igt_output_set_pipe(output, pipe); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t 7/7] kms_panel_fitting: Add support for LVDS and DSI connectors.
On 04/26/2016 01:00 PM, Ville Syrjälä wrote: On Tue, Apr 26, 2016 at 12:55:54PM -0400, Robert Foss wrote: On 04/26/2016 10:11 AM, Daniel Vetter wrote: On Fri, Apr 22, 2016 at 05:25:00PM -0400, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> Add support for DRM_MODE_CONNECTOR_LVDS and DRM_MODE_CONNECTOR_DSI connectors. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 60a22b0..933776c 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -140,9 +140,15 @@ static void test_panel_fitting(data_t *d) for_each_connected_output(display, output) { drmModeModeInfo *mode, native_mode; - if (output->config.connector->connector_type != - DRM_MODE_CONNECTOR_eDP) - continue; + switch (output->config.connector->connector_type) + { + case DRM_MODE_CONNECTOR_LVDS: + case DRM_MODE_CONNECTOR_eDP: + case DRM_MODE_CONNECTOR_DSI: + break; + default: + continue; + } I think ville commented that we should instead check for "scaling mode", and we discussed this on irc. Am I accidentally looking at an old patch series? -Daniel No, this isn't an old patch, I misunderstood where our conversation ended. "scaling mode" is an intel specific extension as far as I understand it, which is somewhat the opposite of generalizing i-g-t tests. Is there an architecture independent way forward? A quick poke at cscope tells me "scaling mode" is used by amdgpu, gma500, i915, nouveau, and radeon. Seems fairly independent to me. If that is the case, and it seems to be, "scaling mode" is definitely worth pursuing. pipe = output->config.pipe; igt_output_set_pipe(output, pipe); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t 7/7] kms_panel_fitting: Add support for LVDS and DSI connectors.
On 04/26/2016 10:11 AM, Daniel Vetter wrote: On Fri, Apr 22, 2016 at 05:25:00PM -0400, robert.f...@collabora.com wrote: From: Robert Foss <robert.f...@collabora.com> Add support for DRM_MODE_CONNECTOR_LVDS and DRM_MODE_CONNECTOR_DSI connectors. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- tests/kms_panel_fitting.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 60a22b0..933776c 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -140,9 +140,15 @@ static void test_panel_fitting(data_t *d) for_each_connected_output(display, output) { drmModeModeInfo *mode, native_mode; - if (output->config.connector->connector_type != - DRM_MODE_CONNECTOR_eDP) - continue; + switch (output->config.connector->connector_type) + { + case DRM_MODE_CONNECTOR_LVDS: + case DRM_MODE_CONNECTOR_eDP: + case DRM_MODE_CONNECTOR_DSI: + break; + default: + continue; + } I think ville commented that we should instead check for "scaling mode", and we discussed this on irc. Am I accidentally looking at an old patch series? -Daniel No, this isn't an old patch, I misunderstood where our conversation ended. "scaling mode" is an intel specific extension as far as I understand it, which is somewhat the opposite of generalizing i-g-t tests. Is there an architecture independent way forward? pipe = output->config.pipe; igt_output_set_pipe(output, pipe); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v4 0/5] kms_flip_event_leak and kms_vblank fixes for VC4.
From: Robert Foss <robert.f...@collabora.com> Changes since v3: - kms_flip.c: Removed drm_fd from data_t, to decrease the number of unrelated changes in the patch. - kms_flip.c: Changed "int valid_tests" to "unsigned valid_tests". - kms_flip.c: Changed crtc_id_flag/crtc_id_to_flag to pipe_id_flag/pipe_id_to_flag. - kms_flip.c: Changed to "vbl.request.type |= crtc_id_flag;". - kms_flip.c: Moved crtc_id_to_flag to igt_kms.c. - kms_flip.c: Renamed crtc_id_to_flag to pipe_id_to_vbl_flag. - kms_flip.c: Changed test busy_mode boolean into mode_busy bitfield in struct data. - igt_kms.h: Moved IGT_PLANE_CURSOR position comment. Changes since v2: - Rebased onto trunk which already contains kms_flip_event_leak changes. Changes since v1: - kms_vblank: Removed un-used members of data_t struct. - Rename plane_counter to n_planes. - Removed un-needed handling CURSOR plane location. - Added names for additional planes in update kmstest_plane_name. Robert Foss (5): lib/igt_kms: Add support for up to 10 planes. lib/igt_kms: Fix plane counting in igt_display_init. lib/igt_kms: Switch to verbose assert. kms_vblank: Switch from using crtc0 statically to explicitly setting mode. lib/igt_kms: Added pipe_id_to_vbl_flag() to igt_kms. lib/igt_kms.c | 30 +- lib/igt_kms.h | 9 ++- tests/kms_vblank.c | 162 - 3 files changed, 172 insertions(+), 29 deletions(-) -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v4 1/5] lib/igt_kms: Add support for up to 10 planes.
From: Robert Foss <robert.f...@collabora.com> Increase the number of planes supported to 10. kmstest_plane_name only previously supported 4 planes, this patch adds support for up to 10 planes. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/igt_kms.c | 6 ++ lib/igt_kms.h | 8 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index ef24a49..36ecd4a 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -320,6 +320,12 @@ const char *kmstest_plane_name(enum igt_plane plane) [IGT_PLANE_1] = "plane1", [IGT_PLANE_2] = "plane2", [IGT_PLANE_3] = "plane3", + [IGT_PLANE_4] = "plane4", + [IGT_PLANE_5] = "plane5", + [IGT_PLANE_6] = "plane6", + [IGT_PLANE_7] = "plane7", + [IGT_PLANE_8] = "plane8", + [IGT_PLANE_9] = "plane9", [IGT_PLANE_CURSOR] = "cursor", }; diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 5c83401..d9a4e11 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -54,7 +54,13 @@ enum igt_plane { IGT_PLANE_PRIMARY = IGT_PLANE_1, IGT_PLANE_2, IGT_PLANE_3, - IGT_PLANE_CURSOR, + IGT_PLANE_4, + IGT_PLANE_5, + IGT_PLANE_6, + IGT_PLANE_7, + IGT_PLANE_8, + IGT_PLANE_9, + IGT_PLANE_CURSOR, /* IGT_PLANE_CURSOR is always the last plane. */ IGT_MAX_PLANES, }; -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t v4 2/5] lib/igt_kms: Fix plane counting in igt_display_init.
From: Robert Foss <robert.f...@collabora.com> Fix issue where the plane counting fails due to the number and configuration of planes being unlike the intel configuration. Signed-off-by: Robert Foss <robert.f...@collabora.com> --- lib/igt_kms.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 36ecd4a..5751913 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1289,6 +1289,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) igt_plane_t *plane; int p = IGT_PLANE_2; int j, type; + uint8_t n_planes = 0; pipe->crtc_id = resources->crtcs[i]; pipe->display = display; @@ -1336,8 +1337,10 @@ void igt_display_init(igt_display_t *display, int drm_fd) break; } + n_planes++; plane->pipe = pipe; plane->drm_plane = drm_plane; + if (is_atomic == 0) { display->is_atomic = 1; igt_atomic_fill_plane_props(display, plane, IGT_NUM_PLANE_PROPS, igt_plane_prop_names); @@ -1386,8 +1389,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) plane->is_cursor = true; } - /* planes = 1 primary, (p-1) sprites, 1 cursor */ - pipe->n_planes = p + 1; + pipe->n_planes = n_planes; /* make sure we don't overflow the plane array */ igt_assert(pipe->n_planes <= IGT_MAX_PLANES); -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx