intel-gpu-tools: Changes to 'upstream-unstable'
Android.mk | 2
CONTRIBUTING | 45
MAINTAINERS | 2
Makefile.am | 4
NEWS | 57
README | 49
assembler/brw_defines.h | 9
assembler/disasm-main.c | 4
assembler/gen8_instruction.c | 20
assembler/gen8_instruction.h | 2
assembler/gram.y | 78 +
assembler/main.c | 4
benchmarks/Android.mk | 2
configure.ac | 17
demos/Android.mk | 28
demos/intel_sprite_on.c | 138 +-
docs/reference/intel-gpu-tools/.gitignore | 1
docs/reference/intel-gpu-tools/Makefile.am | 91 +
docs/reference/intel-gpu-tools/igt_test_programs.xml | 305 ++++
docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml | 6
lib/Android.mk | 6
lib/Makefile.am | 6
lib/Makefile.sources | 18
lib/drmtest.c | 38
lib/drmtest.h | 2
lib/gen6_render.h | 5
lib/gen7_media.h | 2
lib/gen8_media.h | 14
lib/gen8_render.h | 24
lib/gen9_render.h | 17
lib/igt.cocci | 82 +
lib/igt_aux.c | 264 +++-
lib/igt_aux.h | 27
lib/igt_core.c | 496 +++++--
lib/igt_core.h | 127 +
lib/igt_debugfs.c | 154 --
lib/igt_debugfs.h | 35
lib/igt_edid.h | 125 -
lib/igt_fb.c | 163 ++
lib/igt_fb.h | 10
lib/igt_gt.c | 341 +++++
lib/igt_gt.h | 77 +
lib/igt_kms.c | 278 ++--
lib/igt_kms.h | 30
lib/instdone.c | 10
lib/intel_batchbuffer.c | 304 ++++
lib/intel_batchbuffer.h | 67 -
lib/intel_chipset.c | 27
lib/intel_chipset.h | 58
lib/intel_mmio.c | 10
lib/intel_os.c | 32
lib/intel_reg.h | 21
lib/ioctl_wrappers.c | 265 +++-
lib/ioctl_wrappers.h | 81 +
lib/media_fill.c | 16
lib/media_fill.h | 14
lib/media_fill_gen7.c | 161 ++
lib/media_fill_gen9.c | 392 ++++++
lib/rendercopy.h | 5
lib/rendercopy_gen8.c | 109 -
lib/rendercopy_gen9.c | 1032 ++++++++++++++++
lib/tests/.gitignore | 10
lib/tests/Makefile.am | 19
lib/tests/Makefile.sources | 31
lib/tests/igt_command_line.sh | 76 +
lib/tests/igt_fork_helper.c | 37
lib/tests/igt_invalid_subtest_name.c | 31
lib/tests/igt_list_only.c | 43
lib/tests/igt_no_exit.c | 40
lib/tests/igt_no_exit_list_only.c | 41
lib/tests/igt_no_subtest.c | 39
lib/tests/igt_simple_test_subtests.c | 31
lib/tests/igt_simulation.c | 169 ++
lib/tests/igt_timeout.c | 8
man/Makefile.am | 1
man/intel_gpu_frequency.man | 58
overlay/chart.c | 6
overlay/config.c | 1
overlay/gem-objects.c | 6
overlay/gpu-perf.c | 3
overlay/gpu-perf.h | 2
overlay/overlay.c | 22
overlay/x11/position.c | 3
scripts/list-workarounds | 2
shaders/gpgpu/README | 4
shaders/gpgpu/gpgpu_fill.gxa | 51
tests/.gitignore | 20
tests/1080p-left.png |binary
tests/1080p-right.png |binary
tests/Android.mk | 5
tests/Makefile.am | 10
tests/Makefile.sources | 31
tests/NAMING-CONVENTION | 71 -
tests/core_get_client_auth.c | 8
tests/core_getclient.c | 5
tests/core_getstats.c | 3
tests/core_getversion.c | 6
tests/ddi_compute_wrpll.c | 626 ---------
tests/drm_import_export.c | 183 ++
tests/drm_lib.sh | 16
tests/drm_read.c | 223 +++
tests/drm_vma_limiter.c | 2
tests/drv_hangman.c | 110 -
tests/drv_module_reload | 15
tests/drv_suspend.c | 62
tests/eviction_common.c | 29
tests/gem_alive.c | 2
tests/gem_bad_blit.c | 2
tests/gem_bad_length.c | 4
tests/gem_bad_reloc.c | 91 +
tests/gem_caching.c | 3
tests/gem_close_race.c | 2
tests/gem_concurrent_blit.c | 490 +++++--
tests/gem_cpu_reloc.c | 4
tests/gem_cs_prefetch.c | 4
tests/gem_cs_tlb.c | 7
tests/gem_ctx_bad_destroy.c | 61
tests/gem_ctx_bad_exec.c | 3
tests/gem_ctx_basic.c | 10
tests/gem_ctx_create.c | 47
tests/gem_ctx_exec.c | 28
tests/gem_ctx_param_basic.c | 137 ++
tests/gem_ctx_thrash.c | 313 ++++
tests/gem_double_irq_loop.c | 2
tests/gem_dummy_reloc_loop.c | 19
tests/gem_evict_alignment.c | 27
tests/gem_evict_everything.c | 27
tests/gem_exec_bad_domains.c | 5
tests/gem_exec_big.c | 105 +
tests/gem_exec_blt.c | 59
tests/gem_exec_faulting_reloc.c | 5
tests/gem_exec_lut_handle.c | 5
tests/gem_exec_nop.c | 2
tests/gem_exec_params.c | 41
tests/gem_exec_parse.c | 143 ++
tests/gem_fence_thrash.c | 6
tests/gem_fence_upload.c | 73 +
tests/gem_fenced_exec_thrash.c | 2
tests/gem_flink.c | 20
tests/gem_flink_race.c | 21
tests/gem_gpgpu_fill.c | 141 ++
tests/gem_gtt_cpu_tlb.c | 3
tests/gem_gtt_hog.c | 2
tests/gem_gtt_speed.c | 75 +
tests/gem_hang.c | 2
tests/gem_hangcheck_forcewake.c | 3
tests/gem_linear_blits.c | 43
tests/gem_lut_handle.c | 5
tests/gem_madvise.c | 4
tests/gem_media_fill.c | 5
tests/gem_mmap.c | 2
tests/gem_mmap_gtt.c | 2
tests/gem_mmap_offset_exhaustion.c | 3
tests/gem_mmap_wc.c | 467 +++++++
tests/gem_multi_bsd_sync_loop.c | 2
tests/gem_non_secure_batch.c | 2
tests/gem_partial_pwrite_pread.c | 3
tests/gem_persistent_relocs.c | 4
tests/gem_pin.c | 2
tests/gem_pipe_control_store_loop.c | 2
tests/gem_ppgtt.c | 233 +++
tests/gem_pread_after_blit.c | 85 -
tests/gem_pwrite_pread.c | 8
tests/gem_reloc_overflow.c | 2
tests/gem_reloc_vs_gpu.c | 115 -
tests/gem_render_copy.c | 36
tests/gem_render_copy_redux.c | 4
tests/gem_render_linear_blits.c | 76 -
tests/gem_render_tiled_blits.c | 74 -
tests/gem_reset_stats.c | 251 +--
tests/gem_ring_sync_copy.c | 27
tests/gem_ring_sync_loop.c | 2
tests/gem_ringfill.c | 2
tests/gem_seqno_wrap.c | 35
tests/gem_set_tiling_vs_blt.c | 9
tests/gem_set_tiling_vs_gtt.c | 2
tests/gem_set_tiling_vs_pwrite.c | 2
tests/gem_storedw_batches_loop.c | 2
tests/gem_storedw_loop_blt.c | 2
tests/gem_storedw_loop_bsd.c | 2
tests/gem_storedw_loop_render.c | 2
tests/gem_storedw_loop_vebox.c | 2
tests/gem_stress.c | 17
tests/gem_threaded_access_tiled.c | 4
tests/gem_tiled_blits.c | 44
tests/gem_tiled_fence_blits.c | 2
tests/gem_tiled_partial_pwrite_pread.c | 3
tests/gem_tiled_pread.c | 4
tests/gem_tiled_pread_pwrite.c | 5
tests/gem_tiled_swapping.c | 158 +-
tests/gem_tiled_wb.c | 243 +++
tests/gem_tiled_wc.c | 240 +++
tests/gem_tiling_max_stride.c | 2
tests/gem_unfence_active_buffers.c | 2
tests/gem_unref_active_buffers.c | 2
tests/gem_userptr_blits.c | 242 ++-
tests/gem_wait.c | 278 ++++
tests/gem_wait_render_timeout.c | 230 ---
tests/gem_workarounds.c | 130 +-
tests/gem_write_read_ring_switch.c | 2
tests/gen3_mixed_blits.c | 6
tests/gen3_render_linear_blits.c | 4
tests/gen3_render_mixed_blits.c | 4
tests/gen3_render_tiledx_blits.c | 4
tests/gen3_render_tiledy_blits.c | 4
tests/gen7_forcewake_mt.c | 7
tests/igt_fork_helper.c | 37
tests/igt_list_only.c | 42
tests/igt_no_exit.c | 39
tests/igt_no_exit_list_only.c | 40
tests/igt_no_subtest.c | 38
tests/igt_simulation.c | 164 --
tests/kms_3d.c | 11
tests/kms_addfb.c | 147 ++
tests/kms_cursor_crc.c | 186 ++
tests/kms_fbc_crc.c | 25
tests/kms_fence_pin_leak.c | 13
tests/kms_flip.c | 297 +++-
tests/kms_flip_event_leak.c | 30
tests/kms_flip_tiling.c | 40
tests/kms_force_connector.c | 162 +-
tests/kms_mmio_vs_cs_flip.c | 99 -
tests/kms_pipe_crc_basic.c | 9
tests/kms_plane.c | 45
tests/kms_psr_sink_crc.c | 628 ++++-----
tests/kms_pwrite_crc.c | 212 +++
tests/kms_render.c | 25
tests/kms_rotation_crc.c | 96 -
tests/kms_setmode.c | 10
tests/kms_sink_crc_basic.c | 183 +-
tests/kms_universal_plane.c | 265 ++--
tests/pm_lpsp.c | 8
tests/pm_psr.c | 86 -
tests/pm_rc6_residency.c | 101 -
tests/pm_rpm.c | 223 ++-
tests/pm_rps.c | 112 +
tests/prime_nv_api.c | 8
tests/prime_nv_pcopy.c | 8
tests/prime_nv_test.c | 2
tests/prime_self_import.c | 36
tests/sysfs_l3_parity | 6
tests/testdisplay.c | 43
tools/.gitignore | 9
tools/Android.mk | 2
tools/Makefile.sources | 36
tools/ddi_compute_wrpll.c | 649 ++++++++++
tools/intel_audio_dump.c | 210 +++
tools/intel_display_poller.c | 4
tools/intel_dpio_read.c | 2
tools/intel_dpio_write.c | 2
tools/intel_dump_decode.c | 3
tools/intel_error_decode.c | 58
tools/intel_gpu_abrt | 2
tools/intel_gpu_frequency.c | 359 +++++
tools/intel_gtt.c | 81 -
tools/intel_infoframes.c | 1
tools/intel_iosf_sb_read.c | 26
tools/intel_iosf_sb_write.c | 28
tools/intel_l3_udev_listener.c | 23
tools/intel_nc_read.c | 71 -
tools/intel_nc_write.c | 76 -
tools/intel_punit_read.c | 71 -
tools/intel_punit_write.c | 76 -
tools/intel_reg_dumper.c | 2
tools/null_state_gen/Makefile.am | 15
tools/null_state_gen/intel_batchbuffer.c | 15
tools/null_state_gen/intel_batchbuffer.h | 11
tools/null_state_gen/intel_null_state_gen.c | 71 -
tools/null_state_gen/intel_renderstate_gen6.c | 26
tools/null_state_gen/intel_renderstate_gen7.c | 9
tools/null_state_gen/intel_renderstate_gen8.c | 876 ++++---------
tools/null_state_gen/intel_renderstate_gen9.c | 477 +++++++
tools/quick_dump/Makefile.am | 28
tools/quick_dump/base_display.txt | 197 ---
tools/quick_dump/broadwell | 1
tools/quick_dump/chipset.i | 2
tools/quick_dump/chipset_macro_wrap.c | 40
tools/quick_dump/common_display.txt | 197 +++
tools/quick_dump/haswell | 1
tools/quick_dump/ivybridge | 1
tools/quick_dump/quick_dump.py | 2
tools/quick_dump/sandybridge | 1
tools/quick_dump/skl_display.txt | 285 ++++
tools/quick_dump/skylake | 3
tools/skl_ddb_allocation.c | 447 ++++++
285 files changed, 15601 insertions(+), 5491 deletions(-)
New commits:
commit e3e659163f0dcb4bc5de852190a0478092784234
Author: Thomas Wood <thomas.wood@intel.com>
Date: Thu Mar 12 17:06:54 2015 +0000
Update version to 1.10 and add the release date
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
diff --git a/NEWS b/NEWS
index 21af20e..a1aa526 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-Release 1.10 (XXXX-XX-XX)
+Release 1.10 (2015-03-12)
-------------------------
- New frequency manipulation tool (intel_gpu_frequency)
diff --git a/configure.ac b/configure.ac
index 16d6a2e..9b646dd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
AC_PREREQ([2.60])
AC_INIT([intel-gpu-tools],
- [1.9],
+ [1.10],
[https://bugs.freedesktop.org/enter_bug.cgi?product=DRI&component=DRM/Intel],
[intel-gpu-tools])
commit 3b8e121552b2bd0c9023fbec0b88da36a27ce42c
Author: Thomas Wood <thomas.wood@intel.com>
Date: Thu Mar 12 17:01:57 2015 +0000
lib: small documentation fixes
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index bd0bcbc..666c323 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -661,7 +661,6 @@ void igt_blitter_fast_copy__raw(int fd,
/**
* igt_blitter_fast_copy:
* @batch: batchbuffer object
- * @context: libdrm hardware context to use
* @src: source i-g-t buffer object
* @src_x: source pixel x-coordination
* @src_y: source pixel y-coordination
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index c90b5e7..fa8875b 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -187,7 +187,7 @@ void intel_copy_bo(struct intel_batchbuffer *batch,
drm_intel_bo *dst_bo, drm_intel_bo *src_bo,
long int size);
-/**
+/*
* Yf/Ys tiling
*
* Tiling mode in the I915_TILING_... namespace for new tiling modes which are
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index baebf5c..ff78ef1 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -699,6 +699,7 @@ void gem_context_set_param(int fd, struct local_i915_gem_context_param *p)
/**
* gem_context_require_param:
* @fd: open i915 drm file descriptor
+ * @param: i915 hw context parameter
*
* Feature test macro to query whether hw context parameter support for @param
* is available. Automatically skips through igt_require() if not.
commit 595575b9cbdc705edc6f1ac6a3fbf2ceb45bf5ba
Author: Thomas Wood <thomas.wood@intel.com>
Date: Thu Mar 12 16:32:17 2015 +0000
Remove old entries from .gitignore files
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
diff --git a/tests/.gitignore b/tests/.gitignore
index 7b4dd94..426cc67 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -140,7 +140,6 @@ kms_sink_crc_basic
kms_universal_plane
multi-tests.txt
pm_lpsp
-pm_psr
pm_rc6_residency
pm_rpm
pm_rps
diff --git a/tools/.gitignore b/tools/.gitignore
index fa3c7a1..ba7464c 100644
--- a/tools/.gitignore
+++ b/tools/.gitignore
@@ -1,6 +1,5 @@
# Please keep sorted alphabetically
ddi_compute_wrpll
-forcewaked
intel_audio_dump
intel_backlight
intel_bios_dumper
@@ -12,7 +11,6 @@ intel_dump_decode
intel_error_decode
intel_forcewaked
intel_framebuffer_dump
-intel_gpu_dump
intel_gpu_frequency
intel_gpu_time
intel_gpu_top
@@ -22,13 +20,9 @@ intel_iosf_sb_read
intel_iosf_sb_write
intel_l3_parity
intel_lid
-intel_nc_read
-intel_nc_write
intel_opregion_decode
intel_panel_fitter
intel_perf_counters
-intel_punit_read
-intel_punit_write
intel_reg_checker
intel_reg_dumper
intel_reg_read
commit a6c40c7665287305fe838b6871a26bcfecad9c0a
Author: Thomas Wood <thomas.wood@intel.com>
Date: Thu Mar 12 14:59:20 2015 +0000
lib: move igt_interactive_debug into igt_core.c
igt_interactive_debug should be defined in igt_core.c, rather than the
header, to avoid it being defined more than once.
Reported-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
diff --git a/lib/igt_core.c b/lib/igt_core.c
index c217a01..4ae3524 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -209,6 +209,7 @@
*/
static unsigned int exit_handler_count;
+const char *igt_interactive_debug;
/* subtests helpers */
static bool list_subtests = false;
diff --git a/lib/igt_core.h b/lib/igt_core.h
index c2c820d..0716000 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -557,7 +557,7 @@ bool igt_run_in_simulation(void);
void igt_skip_on_simulation(void);
-const char *igt_interactive_debug;
+extern const char *igt_interactive_debug;
/* structured logging */
enum igt_log_level {
commit dde047fe2c84e2519a8ed24db4ac9c794285bbd1
Author: Damien Lespiau <damien.lespiau@intel.com>
Date: Thu Mar 12 14:31:15 2015 +0000
lib/fb: Use PRIx64 for uint64_t in format string
Fix the following warning:
igt_fb.c: In function 'igt_create_fb_with_bo_size':
igt_fb.c:414:2: warning: format '%llx' expects argument of type
'long long unsigned int', but argument 9 has type 'uint64_t' [-Wformat=]
igt_debug("%s(width=%d, height=%d, format=0x%x [bpp=%d], tiling=%llx, size=%d\n",
introduced by commit:
commit e36091d1c7010e825897dc4487f9985ab353973b
Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Date: Tue Mar 3 14:11:01 2015 +0000
tiling: Convert framebuffer helpers to use fb modifiers
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 5c92fac..ce5a102 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -411,7 +411,7 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
bpp = igt_drm_format_to_bpp(format);
- igt_debug("%s(width=%d, height=%d, format=0x%x [bpp=%d], tiling=%llx, size=%d\n",
+ igt_debug("%s(width=%d, height=%d, format=0x%x [bpp=%d], tiling=0x%"PRIx64", size=%d\n",
__func__, width, height, format, bpp, tiling, bo_size);
do_or_die(create_bo_for_fb(fd, width, height, bpp, tiling, bo_size,
&fb->gem_handle, &fb->size, &fb->stride));
commit b1177831abedbf7dac323c6e67c2ec7c56c88009
Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Date: Tue Mar 3 14:11:06 2015 +0000
tests/kms_flip_tiling: Exercise Y tiling modes on Gen9+
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
diff --git a/tests/kms_flip_tiling.c b/tests/kms_flip_tiling.c
index 7d6998b..3181260 100644
--- a/tests/kms_flip_tiling.c
+++ b/tests/kms_flip_tiling.c
@@ -33,6 +33,7 @@
#include "igt_debugfs.h"
#include "igt_kms.h"
#include "ioctl_wrappers.h"
+#include "intel_chipset.h"
IGT_TEST_DESCRIPTION("Test that a page flip from a tiled buffer to a linear"
" one works correctly.");
@@ -40,6 +41,7 @@ IGT_TEST_DESCRIPTION("Test that a page flip from a tiled buffer to a linear"
typedef struct {
int drm_fd;
igt_display_t display;
+ int gen;
} data_t;
/*
@@ -61,7 +63,7 @@ fill_linear_fb(struct igt_fb *fb, data_t *data, drmModeModeInfo *mode)
}
static void
-test_flip_changes_tiling(data_t *data, igt_output_t *output)
+test_flip_changes_tiling(data_t *data, igt_output_t *output, uint64_t tiling)
{
struct igt_fb linear, tiled;
drmModeModeInfo *mode;
@@ -97,7 +99,7 @@ test_flip_changes_tiling(data_t *data, igt_output_t *output)
/* allocate a tiled buffer and set the crtc with it */
igt_create_color_fb(data->drm_fd, width, mode->vdisplay,
- DRM_FORMAT_XRGB8888, LOCAL_I915_FORMAT_MOD_X_TILED,
+ DRM_FORMAT_XRGB8888, tiling,
0.0, 0.0, 0.0, &tiled);
igt_plane_set_fb(primary, &tiled);
igt_display_commit(&data->display);
@@ -132,6 +134,7 @@ igt_main
igt_fixture {
data.drm_fd = drm_open_any_master();
+ data.gen = intel_gen(intel_get_drm_devid(data.drm_fd));
kmstest_set_vt_graphics_mode();
@@ -141,7 +144,26 @@ igt_main
igt_subtest_f("flip-changes-tiling") {
for_each_connected_output(&data.display, output)
- test_flip_changes_tiling(&data, output);
+ test_flip_changes_tiling(&data, output,
+ LOCAL_I915_FORMAT_MOD_X_TILED);
+ }
+
+ igt_subtest_f("flip-changes-tiling-Y") {
+ igt_require_fb_modifiers(data.drm_fd);
+ igt_require(data.gen >= 9);
+
+ for_each_connected_output(&data.display, output)
+ test_flip_changes_tiling(&data, output,
+ LOCAL_I915_FORMAT_MOD_Y_TILED);
+ }
+
+ igt_subtest_f("flip-changes-tiling-Yf") {
+ igt_require_fb_modifiers(data.drm_fd);
+ igt_require(data.gen >= 9);
+
+ for_each_connected_output(&data.display, output)
+ test_flip_changes_tiling(&data, output,
+ LOCAL_I915_FORMAT_MOD_Yf_TILED);
}
igt_fixture {
commit 7b8ba120b956e706f2cdea831233973f0ee079fa
Author: Damien Lespiau <damien.lespiau@intel.com>
Date: Tue Mar 3 14:11:05 2015 +0000
testdisplay/skl: Add command line options for Yb/Yf tiled fbs
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index 6b1f265..f864940 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -51,6 +51,7 @@
#include <cairo.h>
#include <errno.h>
+#include <getopt.h>
#include <math.h>
#include <stdint.h>
#include <stdbool.h>
@@ -71,8 +72,10 @@
#include <stdlib.h>
#include <signal.h>
-#define SUBTEST_OPTS 1
+#define SUBTEST_OPTS 1
#define HELP_DESCRIPTION 2
+#define Yb_OPT 3
+#define Yf_OPT 4
static int tio_fd;
struct termios saved_tio;
@@ -544,7 +547,7 @@ int update_display(void)
return 1;
}
-static char optstr[] = "3hiaf:s:d:p:mrto:j:";
+static char optstr[] = "3hiaf:s:d:p:mrto:j:y";
static void __attribute__((noreturn)) usage(char *name, char opt)
{
@@ -645,6 +648,8 @@ int main(int argc, char **argv)
{"run-subtest", 1, 0, SUBTEST_OPTS},
{"help-description", 0, 0, HELP_DESCRIPTION},
{"help", 0, 0, 'h'},
+ {"yb", 0, 0, Yb_OPT},
+ {"yf", 0, 0, Yf_OPT},
{ 0, 0, 0, 0 }
};
@@ -697,6 +702,13 @@ int main(int argc, char **argv)
case 't':
tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
break;
+ case 'y':
+ case Yb_OPT:
+ tiling = LOCAL_I915_FORMAT_MOD_Y_TILED;
+ break;
+ case Yf_OPT:
+ tiling = LOCAL_I915_FORMAT_MOD_Yf_TILED;
+ break;
case 'r':
qr_code = 1;
break;
commit ff451a6d439f76ddc51cc0a374f086ace4dab680
Author: Damien Lespiau <damien.lespiau@intel.com>
Date: Tue Mar 3 14:11:04 2015 +0000
lib: Allow the creation of Ys/Yf tiled FBs
There's no fencing for those tiling layouts, so we create a linear bo
for cairo to play with, and when cairo is finished with it, we do a fast
copy blit to the fb BO with its final tiling.
v2: Move to correct domain after CPU is done with the object (-EINVAL). (Tvrtko Ursulin)
Correct arguments passed in to framebuffer creation (segfault). (Tvrtko Ursulin)
Pass zero stride to kernel as it expects for Yf&Ys. (Tvrtko Ursulin)
v3: Rebase for gem_mmap__cpu changes. (Tvrtko Ursulin)
v4: Rebase for addfb2.5. (Tvrtko Ursulin)
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index c54907e..5c92fac 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -112,7 +112,7 @@ static int create_bo_for_fb(int fd, int width, int height, int bpp,
bo_size = size;
gem_handle = gem_create(fd, bo_size);
- if (tiling != LOCAL_DRM_FORMAT_MOD_NONE)
+ if (tiling == LOCAL_I915_FORMAT_MOD_X_TILED)
ret = __gem_set_tiling(fd, gem_handle, I915_TILING_X, stride);
*stride_ret = stride;
@@ -629,6 +629,104 @@ static cairo_format_t drm_format_to_cairo(uint32_t drm_format)
drm_format, igt_format_str(drm_format));
}
+struct fb_blit_upload {
+ int fd;
+ struct igt_fb *fb;
+ struct {
+ uint32_t handle;
+ unsigned size, stride;
+ uint8_t *map;
+ } linear;
+};
+
+static void destroy_cairo_surface__blit(void *arg)
+{
+ struct fb_blit_upload *blit = arg;
+ struct igt_fb *fb = blit->fb;
+ unsigned int obj_tiling = I915_TILING_NONE;
+
+ munmap(blit->linear.map, blit->linear.size);
+ fb->cairo_surface = NULL;
+
+ gem_set_domain(blit->fd, blit->linear.handle,
+ I915_GEM_DOMAIN_GTT, 0);
+
+ switch (fb->tiling) {
+ case LOCAL_I915_FORMAT_MOD_X_TILED:
+ obj_tiling = I915_TILING_X;
+ break;
+ case LOCAL_I915_FORMAT_MOD_Y_TILED:
+ obj_tiling = I915_TILING_Y;
+ break;
+ case LOCAL_I915_FORMAT_MOD_Yf_TILED:
+ obj_tiling = I915_TILING_Yf;
+ break;
+ }
+
+ igt_blitter_fast_copy__raw(blit->fd,
+ blit->linear.handle,
+ blit->linear.stride,
+ I915_TILING_NONE,
+ 0, 0, /* src_x, src_y */
+ fb->width, fb->height,
+ fb->gem_handle,
+ fb->stride,
+ obj_tiling,
+ 0, 0 /* dst_x, dst_y */);
+
+ gem_sync(blit->fd, blit->linear.handle);
+ gem_close(blit->fd, blit->linear.handle);
+
+ free(blit);
+}
+
+static void create_cairo_surface__blit(int fd, struct igt_fb *fb)
+{
+ struct fb_blit_upload *blit;
+ cairo_format_t cairo_format;
+ int bpp, ret;
+
+ blit = malloc(sizeof(*blit));
+ igt_assert(blit);
+
+ /*
+ * We create a linear BO that we'll map for the CPU to write to (using
+ * cairo). This linear bo will be then blitted to its final
+ * destination, tiling it at the same time.
+ */
+ bpp = igt_drm_format_to_bpp(fb->drm_format);
+ ret = create_bo_for_fb(fd, fb->width, fb->height, bpp,
+ LOCAL_DRM_FORMAT_MOD_NONE, 0,
+ &blit->linear.handle,
+ &blit->linear.size,
+ &blit->linear.stride);
+
+ igt_assert(ret == 0);
+
+ blit->fd = fd;
+ blit->fb = fb;
+ blit->linear.map = gem_mmap__cpu(fd,
+ blit->linear.handle,
+ 0,
+ blit->linear.size,
+ PROT_READ | PROT_WRITE);
+ igt_assert(blit->linear.map);
+
+ gem_set_domain(fd, blit->linear.handle,
+ I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
+
+ cairo_format = drm_format_to_cairo(fb->drm_format);
+ fb->cairo_surface =
+ cairo_image_surface_create_for_data(blit->linear.map,
+ cairo_format,
+ fb->width, fb->height,
+ blit->linear.stride);
+
+ cairo_surface_set_user_data(fb->cairo_surface,
+ (cairo_user_data_key_t *)create_cairo_surface__blit,
+ blit, destroy_cairo_surface__blit);
+}
+
static void destroy_cairo_surface__gtt(void *arg)
{
struct igt_fb *fb = arg;
@@ -651,8 +749,13 @@ static void create_cairo_surface__gtt(int fd, struct igt_fb *fb)
static cairo_surface_t *get_cairo_surface(int fd, struct igt_fb *fb)
{
- if (fb->cairo_surface == NULL)
- create_cairo_surface__gtt(fd, fb);
+ if (fb->cairo_surface == NULL) {
+ if (fb->tiling == LOCAL_I915_FORMAT_MOD_Y_TILED ||
+ fb->tiling == LOCAL_I915_FORMAT_MOD_Yf_TILED)
+ create_cairo_surface__blit(fd, fb);
+ else
+ create_cairo_surface__gtt(fd, fb);
+ }
gem_set_domain(fd, fb->gem_handle,
I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
commit eb93c1b33ef6eebe53646003e951e54a3e68bc5e
Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Date: Tue Mar 3 14:11:03 2015 +0000
lib/igt_fb: Use new ADDFB2 extension for new tiling modes
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 853b2f9..c54907e 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -404,16 +404,10 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
uint32_t format, uint64_t tiling,
struct igt_fb *fb, unsigned bo_size)
{
- uint32_t handles[4];
- uint32_t pitches[4];
- uint32_t offsets[4];
uint32_t fb_id;
int bpp;
memset(fb, 0, sizeof(*fb));
- memset(handles, 0, sizeof(handles));
- memset(pitches, 0, sizeof(pitches));
- memset(offsets, 0, sizeof(offsets));
bpp = igt_drm_format_to_bpp(format);
@@ -422,14 +416,30 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
do_or_die(create_bo_for_fb(fd, width, height, bpp, tiling, bo_size,
&fb->gem_handle, &fb->size, &fb->stride));
- handles[0] = fb->gem_handle;
- pitches[0] = fb->stride;
-
igt_debug("%s(handle=%d, pitch=%d)\n",
- __func__, handles[0], pitches[0]);
- do_or_die(drmModeAddFB2(fd, width, height, format,
- handles, pitches, offsets,
- &fb_id, 0));
+ __func__, fb->gem_handle, fb->stride);
+
+ if (tiling != LOCAL_DRM_FORMAT_MOD_NONE &&
+ tiling != LOCAL_I915_FORMAT_MOD_X_TILED) {
+ do_or_die(__kms_addfb(fd, fb->gem_handle, width, height,
+ fb->stride, format, tiling,
+ LOCAL_DRM_MODE_FB_MODIFIERS, &fb_id));
+ } else {
+ uint32_t handles[4];
+ uint32_t pitches[4];
+ uint32_t offsets[4];
+
+ memset(handles, 0, sizeof(handles));
+ memset(pitches, 0, sizeof(pitches));
+ memset(offsets, 0, sizeof(offsets));
+
+ handles[0] = fb->gem_handle;
+ pitches[0] = fb->stride;
+
+ do_or_die(drmModeAddFB2(fd, width, height, format,
+ handles, pitches, offsets,
+ &fb_id, 0));
+ }
fb->width = width;
fb->height = height;
commit c7bac3c62ab27045ceec898787435bbb5678b015
Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Date: Tue Mar 3 14:11:02 2015 +0000
lib: Add support for new extension to the ADDFB2 ioctl.
New functionality accessesed via the __kms_addfb wrapper.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 5cbb873..baebf5c 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -1165,3 +1165,29 @@ void igt_require_fb_modifiers(int fd)
igt_require(has_modifiers);
}
+
+int __kms_addfb(int fd, uint32_t handle, uint32_t width, uint32_t height,
+ uint32_t stride, uint32_t pixel_format, uint64_t modifier,
+ uint32_t flags, uint32_t *buf_id)
+{
+ struct local_drm_mode_fb_cmd2 f;
+ int ret;
+
+ igt_require_fb_modifiers(fd);
+
+ memset(&f, 0, sizeof(f));
+
+ f.width = width;
+ f.height = height;
+ f.pixel_format = pixel_format;
+ f.flags = flags;
+ f.handles[0] = handle;
+ f.pitches[0] = stride;
+ f.modifier[0] = modifier;
+
+ ret = drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f);
+
+ *buf_id = f.fb_id;
+
+ return ret < 0 ? -errno : ret;
+}
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index 99fc7fd..ced7ef3 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -167,4 +167,13 @@ struct local_drm_mode_fb_cmd2 {
void igt_require_fb_modifiers(int fd);
+/**
+ * __kms_addfb:
+ *
+ * Creates a framebuffer object.
+ */
+int __kms_addfb(int fd, uint32_t handle, uint32_t width, uint32_t height,
+ uint32_t stride, uint32_t pixel_format, uint64_t modifier,
+ uint32_t flags, uint32_t *buf_id);
+
#endif /* IOCTL_WRAPPERS_H */
commit e36091d1c7010e825897dc4487f9985ab353973b
Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Date: Tue Mar 3 14:11:01 2015 +0000
tiling: Convert framebuffer helpers to use fb modifiers
This converts the IGT API only, underneath legacy set_tiling is still used.
v2: One got away in kms_flip.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 9b41301..853b2f9 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -75,7 +75,7 @@ static struct format_desc_struct {
/* helpers to create nice-looking framebuffers */
static int create_bo_for_fb(int fd, int width, int height, int bpp,
- unsigned int tiling, unsigned bo_size,
+ uint64_t tiling, unsigned bo_size,
uint32_t *gem_handle_ret,
unsigned *size_ret,
unsigned *stride_ret)
@@ -84,7 +84,7 @@ static int create_bo_for_fb(int fd, int width, int height, int bpp,
int size, ret = 0;
unsigned stride;
- if (tiling) {
+ if (tiling != LOCAL_DRM_FORMAT_MOD_NONE) {
int v;
/* Round the tiling up to the next power-of-two and the
@@ -112,8 +112,8 @@ static int create_bo_for_fb(int fd, int width, int height, int bpp,
bo_size = size;
gem_handle = gem_create(fd, bo_size);
- if (tiling)
- ret = __gem_set_tiling(fd, gem_handle, tiling, stride);
+ if (tiling != LOCAL_DRM_FORMAT_MOD_NONE)
+ ret = __gem_set_tiling(fd, gem_handle, I915_TILING_X, stride);
*stride_ret = stride;
*size_ret = size;
@@ -385,7 +385,7 @@ void igt_paint_image(cairo_t *cr, const char *filename,
* @width: width of the framebuffer in pixel
* @height: height of the framebuffer in pixel
* @format: drm fourcc pixel format code
- * @tiling: tiling layout of the framebuffer
+ * @tiling: tiling layout of the framebuffer (as framebuffer modifier)
* @fb: pointer to an #igt_fb structure
* @bo_size: size of the backing bo (0 for minimum needed size)
*
@@ -401,7 +401,7 @@ void igt_paint_image(cairo_t *cr, const char *filename,
*/
unsigned int
igt_create_fb_with_bo_size(int fd, int width, int height,
- uint32_t format, unsigned int tiling,
+ uint32_t format, uint64_t tiling,
struct igt_fb *fb, unsigned bo_size)
{
uint32_t handles[4];
@@ -417,7 +417,7 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
bpp = igt_drm_format_to_bpp(format);
Reply to: