aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimon Ser <simon.ser@intel.com>2019-07-19 14:01:13 +0300
committerSimon Ser <simon.ser@intel.com>2019-08-15 13:03:59 +0300
commit7b759f271519af74afa4f2f1d85e64cf367644dc (patch)
tree18069c65b26afd3c624b043a918e98eef252745c /tests
parent8a7b044493e8dcdd7df02a124ea14daf95752cec (diff)
downloadplatform_external_igt-gpu-tools-7b759f271519af74afa4f2f1d85e64cf367644dc.tar.gz
platform_external_igt-gpu-tools-7b759f271519af74afa4f2f1d85e64cf367644dc.tar.bz2
platform_external_igt-gpu-tools-7b759f271519af74afa4f2f1d85e64cf367644dc.zip
lib/igt_kms: drop EDID_LENGTH, replace with EDID_BLOCK_SIZE
EDID_LENGTH is misleading because EDIDs are a variable size (they contain one or more 128-byte EDID blocks). This commit renames it to EDID_BLOCK_SIZE which makes it clear users need to call edid_get_size to get the total size. The declaration has also been moved to igt_edid. ("Size" has been chosen over "length" because it's clearer that it's a number of bytes, not a number of elements) Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/i915/i915_pm_rpm.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c
index e2c7ba21..2168ff72 100644
--- a/tests/i915/i915_pm_rpm.c
+++ b/tests/i915/i915_pm_rpm.c
@@ -50,6 +50,7 @@
#include "igt_sysfs.h"
#include "igt_debugfs.h"
#include "igt_device.h"
+#include "igt_edid.h"
#define MSR_PKG_CST_CONFIG_CONTROL 0xE2
/* HSW/BDW: */
@@ -655,10 +656,10 @@ static bool i2c_read_edid(const char *connector_name, unsigned char *edid)
return rc >= 0;
}
-static void format_hex_string(const unsigned char edid[static EDID_LENGTH],
- char buf[static EDID_LENGTH * 5 + 1])
+static void format_hex_string(const unsigned char edid[static EDID_BLOCK_SIZE],
+ char buf[static EDID_BLOCK_SIZE * 5 + 1])
{
- for (int i = 0; i < EDID_LENGTH; ++i)
+ for (int i = 0; i < EDID_BLOCK_SIZE; ++i)
sprintf(buf+i*5, "0x%02x ", edid[i]);
}
@@ -670,7 +671,7 @@ static void test_i2c(struct mode_set_data *data)
for (int i = 0; i < data->res->count_connectors; i++) {
unsigned char *drm_edid = data->edids[i] ? data->edids[i]->data : NULL;
- unsigned char i2c_edid[EDID_LENGTH] = {};
+ unsigned char i2c_edid[EDID_BLOCK_SIZE] = {};
igt_output_t *output = igt_output_from_connector(&display,
data->connectors[i]);
@@ -694,13 +695,13 @@ static void test_i2c(struct mode_set_data *data)
continue;
if (got_i2c_edid && got_drm_edid)
- edids_equal = (0 == memcmp(drm_edid, i2c_edid, EDID_LENGTH));
+ edids_equal = (0 == memcmp(drm_edid, i2c_edid, EDID_BLOCK_SIZE));
else
edids_equal = false;
if (!edids_equal) {
- char buf[5 * EDID_LENGTH + 1];
+ char buf[5 * EDID_BLOCK_SIZE + 1];
igt_critical("Detected EDID mismatch on connector %s\n",
connector_name);