summaryrefslogtreecommitdiff
path: root/tools/intel_watermark.c
AgeCommit message (Collapse)Author
2019-03-29Revert "lib/igt_device: Move intel_get_pci_device under igt_device"Ville Syrjälä
One significant usecase for intel_reg/etc. is to be able to examine the hardware state *before* loading the driver. If the tool forces the driver to load we've totally lost that capability. This reverts commit 8ae86621d6fff60b6e20c6b0f9b336785c935b0f. Cc: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Michał Winiarski <michal.winiarski@intel.com>
2019-03-20lib/igt_device: Move intel_get_pci_device under igt_deviceMichał Winiarski
It allows us to make things a little bit more generic. Also, we now require fd rather than doing guesswork when it comes to pci address. v2: Use readlinkat rather than string concat, move stuff around, provide a version that does not assert. (Chris) v3: Print addr on failure, avoid assignment in conditionals. (Chris) Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-02-07tools/intel_watermark: Dump NV12_BUF_CFGVille Syrjälä
On pre-icl we have two registers for the DDB allocations for NV12. Dump the second set of allocations as well. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2019-02-05tools/intel_watermark: Clean up the platform checks in the ilk+ codeVille Syrjälä
Replace the old hand rolled platform check funcs with somehting more standard. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2019-02-05tools/intel_watermark: Show whether each plane is enabledVille Syrjälä
To make it easier to spot errors with watermarks vs. plane being enabled/disabled indicate which planes are actually enabled and which are not. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2019-02-05tools/intel_watermark: Decode wm blocks correctlyVille Syrjälä
Bump up the width of the wm blocks to 11 bits, which it is on icl. On earlier platforms it was actually 10 bits but the code decoded it as 9 bits. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2019-02-05tools/intel_watermark: More bits for PLANE_BUF_CFGVille Syrjälä
On icl PLANE_BUF_CFG fields are 11 bits. Decode them correctly. v2: s/biths/bits/ in the subject (José) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2019-02-05tools/intel_watermark: Bump number of planes to 8 for iclVille Syrjälä
icl has 8 planes per pipe. Bump the limits to match. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2018-10-25tools/intel_watermark: Recognize cnl+Ville Syrjälä
Pick the skl+ code path for cnl+. And since this tool has nothing to do with pch let's also replace the has_pch_split check with gen>=5 check. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-01-11include inttypes.h for PRI definesMike Frysinger
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96620 Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-11-29tools/intel_watermark: Right justify register namesVille Syrjälä
I think the dump is a more legible when the register names are right justified. That way the register name and its value are right next to each other. Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-11-29tools/intel_watermark: Clean up formattingVille Syrjälä
Align the comlums properly, and replace some of the whitespace in the printf()s with properly sized fields. Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-11-29tools/intel_watermark: Clean up SKL plane namesVille Syrjälä
Only print the plane name for planes that actually exist. Also Also include the pipe in the plane name. Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-11-29tools/intel_watermark: Refactor reg name stuffVille Syrjälä
Pull the code to generate the SKL register names into small helper to declutter the main code. Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-11-29tools/intel_watermark: Silence gcc7 snprintf() warningsVille Syrjälä
Bump the snprintf() buffer size to 32 bytes to silence gcc. intel_watermark.c:203:57: warning: ‘%c’ directive output may be truncated writing 1 byte into a region of size between 0 and 9 [-Wformat-truncation=] snprintf(reg_name, sizeof(reg_name), "PLANE_WM_%1d_%c_%1d", ^~ intel_watermark.c:203:43: note: directive argument in the range [0, 8] snprintf(reg_name, sizeof(reg_name), "PLANE_WM_%1d_%c_%1d", ^~~~~~~~~~~~~~~~~~~~~ etc. Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Reported-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Tested-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-11-21tools/intel_watermark: Try not to dump nonexistent planes on SKL+Dhinakaran Pandiyan
Having registers for nonexistent planes in the dumpo might end up being rather confusing. Try to only include real planes. Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-11-21tools/intel_watermark: Dump WM_LINETIME on SKL+Ville Syrjälä
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-11-21tools/intel_watermark: Polish SKL+ register dump output a bitVille Syrjälä
Print hex numbers with "0x" prefix, and make the output a bit more compact. Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-11-21tools/intel_watermark: Eliminate pointless %s in printf()Ville Syrjälä
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-11-21tools/intel_watermark: Update intel_watermark with SKL supportDhinakaran Pandiyan
Added support to print SKL watermark and DDB registers. v2: Printed raw register data, renamed planes and combined two printf()'s (Ville) v3: s/drm_fd/-1/ for intel_register_access_init() Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> [vsyrjala: make it build, fix indentation, etc.] Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-11-21tools/intel_watermark: Print linetime wms in usecVille Syrjälä
Let's print the linetime watermarks un usecs. Might make it easier to spot bogus values. Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-11-21tools: Stop opening the driver just to find the debugfsChris Wilson
Since the tools want to work without the module loaded, remove the assumption that we want to load the driver to find debugfs. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjala <ville.syrjala@linux.intel.com>
2017-09-05intel_watermark: Fix a warning about "const char" return being silly.Eric Anholt
Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-03-21Restore "lib: Open debugfs files for the given DRM device"Chris Wilson
This reverts commit 25fbae15262cf570e207e62f50e7c5233e06bc67, restoring commit 301ad44cdf1b868b1ab89096721da91fa8541fdc Author: Tomeu Vizoso <tomeu.vizoso@collabora.com> Date: Thu Mar 2 10:37:11 2017 +0100 lib: Open debugfs files for the given DRM device with fixes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-21Revert "lib: Open debugfs files for the given DRM device"Tomeu Vizoso
This reverts commit 301ad44cdf1b868b1ab89096721da91fa8541fdc. When a render-only device is opened and gem_quiescent_gpu is called, we need to use the debugfs dir for the master device instead. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2017-03-21lib: Open debugfs files for the given DRM deviceTomeu Vizoso
When opening a DRM debugfs file, locate the right path based on the given DRM device FD. This is needed so, in setups with more than one DRM device, any operations on debugfs files affect the expected DRM device. v2: - rebased and fixed new API additions v3: - updated chamelium test, which was missed previously - use the minor of the device for the debugfs path, not the major - have a proper exit handler for calling igt_hpd_storm_reset with the right device fd. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Robert Foss <robert.foss@collabora.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-25intel_chipset: Fixup HAS_PCH_SPLIT() to exclude AtomsChris Wilson
The Atoms do not have the PCH split, exclude them from HAS_PCH_SPLIT(). At the time, I was planning to add the feature flag and make intel_pch_type() useful, but for now take the simple option of expanding th predicate. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-30intel_chipset: Convert IS_PINEVIEW to device infoChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-02tools/intel_watermark: Dump linetime watermarks on hsw/bdwVille Syrjälä
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-05-05intel_watermark: switch to INREGJani Nikula
Use INREG instead of using mmio directly. Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-03-24tools/intel_watermark: Tool to decode watermark registersVille Syrjälä
The watermark registers on the gmch platform are a bit of a mess. Add a tool to make some sense of them. While at it decode the ilk-bdw wm registers as well. SKL+ is left out for now since it's a very different beast. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>