From: Todd Previte <tprevite@gmail.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 07/10] drm/i915: Add structures for Displayport compliance testing parameters
Date: Thu, 9 Oct 2014 08:38:07 -0700 [thread overview]
Message-ID: <1412869090-48010-8-git-send-email-tprevite@gmail.com> (raw)
In-Reply-To: <1412869090-48010-1-git-send-email-tprevite@gmail.com>
Adds a struct to hold link configuration parameters and several other
variables for use during Displayport compliance testing. Adding these
items here allows for efficient handling of compliance test data and
configuration parameters where necessary in the driver.
Also updates the debugfs interface to use these new parameters instead
of storing them in an intermediate structure. Values are stored on a
per-connector basis in the intel_dp struct.
Signed-off-by: Todd Previte <tprevite@gmail.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 35 +++++++++++++----------------------
drivers/gpu/drm/i915/intel_drv.h | 16 +++++++++++++++-
2 files changed, 28 insertions(+), 23 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index d16612c..8fb3232 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -3684,7 +3684,7 @@ int tokenize_dp_config(char *input_buffer, char *output[])
static int displayport_parse_config(char *input_buffer,
ssize_t buffer_size,
- struct intel_dp_link_config *dp_conf)
+ struct intel_dp *intel_dp)
{
int status = 0;
char *lines[MAX_DP_CONFIG_LINE_COUNT];
@@ -3715,19 +3715,11 @@ static int displayport_parse_config(char *input_buffer,
}
}
- for (i = 1; i < DP_PARAMETER_COUNT; i++)
- DRM_DEBUG_DRIVER("%s = %lu\n",
- dp_conf_tokens[parms[i].type],
- parms[i].value);
-
/* Validate any/all incoming parameters */
- strcpy(dp_conf->connector_name,
- (char *)parms[DP_CONFIG_PARAM_CONNECTOR].value);
-
if (parms[DP_CONFIG_PARAM_LINK_RATE].value == 0x06 ||
parms[DP_CONFIG_PARAM_LINK_RATE].value == 0x0a ||
parms[DP_CONFIG_PARAM_LINK_RATE].value == 0x14) {
- dp_conf->link_rate =
+ intel_dp->compliance_config.link_rate =
parms[DP_CONFIG_PARAM_LINK_RATE].value;
} else
return -EINVAL;
@@ -3735,21 +3727,21 @@ static int displayport_parse_config(char *input_buffer,
if (parms[DP_CONFIG_PARAM_LANE_COUNT].value == 0x01 ||
parms[DP_CONFIG_PARAM_LANE_COUNT].value == 0x02 ||
parms[DP_CONFIG_PARAM_LANE_COUNT].value == 0x04) {
- dp_conf->lane_count =
+ intel_dp->compliance_config.lane_count =
parms[DP_CONFIG_PARAM_LANE_COUNT].value;
} else
return -EINVAL;
if (parms[DP_CONFIG_PARAM_VOLTAGE_SWING].value <= 0x03 &&
parms[DP_CONFIG_PARAM_VOLTAGE_SWING].value >= 0x00) {
- dp_conf->vswing_level =
+ intel_dp->compliance_config.vswing_level =
parms[DP_CONFIG_PARAM_VOLTAGE_SWING].value;
} else
return -EINVAL;
if (parms[DP_CONFIG_PARAM_PREEMPHASIS].value <= 0x03 &&
parms[DP_CONFIG_PARAM_PREEMPHASIS].value >= 0x00) {
- dp_conf->preemp_level =
+ intel_dp->compliance_config.preemp_level =
parms[DP_CONFIG_PARAM_PREEMPHASIS].value;
} else
return -EINVAL;
@@ -3758,21 +3750,21 @@ static int displayport_parse_config(char *input_buffer,
parms[DP_CONFIG_PARAM_BPP].value == 24 ||
parms[DP_CONFIG_PARAM_BPP].value == 30 ||
parms[DP_CONFIG_PARAM_BPP].value == 36) {
- dp_conf->bits_per_pixel =
+ intel_dp->compliance_config.bits_per_pixel =
parms[DP_CONFIG_PARAM_PREEMPHASIS].value;
} else
return -EINVAL;
if (parms[DP_CONFIG_PARAM_HRES].value > 0 &&
parms[DP_CONFIG_PARAM_HRES].value <= 8192) {
- dp_conf->hres =
+ intel_dp->compliance_config.hres =
parms[DP_CONFIG_PARAM_HRES].value;
} else
return -EINVAL;
if (parms[DP_CONFIG_PARAM_VRES].value > 0 &&
parms[DP_CONFIG_PARAM_VRES].value <= 8192) {
- dp_conf->vres =
+ intel_dp->compliance_config.vres =
parms[DP_CONFIG_PARAM_VRES].value;
} else
return -EINVAL;
@@ -3830,7 +3822,6 @@ static ssize_t displayport_config_ctl_write(struct file *file,
struct intel_encoder *intel_encoder;
struct intel_connector *intel_connector;
struct intel_dp *intel_dp;
- struct intel_dp_link_config dp_conf;
m = file->private_data;
if (!m) {
@@ -3857,9 +3848,7 @@ static ssize_t displayport_config_ctl_write(struct file *file,
}
input_buffer[len] = '\0';
- memset(&dp_conf, 0, sizeof(struct intel_dp_link_config));
DRM_DEBUG_DRIVER("Copied %d bytes from user\n", (unsigned int)len);
- status = displayport_parse_config(input_buffer, len, &dp_conf);
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
intel_connector = to_intel_connector(connector);
@@ -3868,9 +3857,11 @@ static ssize_t displayport_config_ctl_write(struct file *file,
if (intel_encoder->type == INTEL_OUTPUT_DISPLAYPORT ||
intel_encoder->type == INTEL_OUTPUT_UNKNOWN) {
intel_dp = enc_to_intel_dp(&intel_encoder->base);
- memcpy(&intel_dp->compliance_config,
- &dp_conf,
- sizeof(struct intel_dp_link_config));
+ status = displayport_parse_config(input_buffer,
+ len,
+ intel_dp);
+ if (status < 0)
+ goto out;
}
}
}
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 29d51f9..bd32d98 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -554,6 +554,18 @@ enum edp_drrs_refresh_rate_type {
DRRS_MAX_RR, /* RR count */
};
+struct intel_dp_link_config {
+ uint8_t lane_count;
+ uint8_t link_rate;
+ uint8_t vswing_level;
+ uint8_t preemp_level;
+ uint32_t hres;
+ uint32_t vres;
+ uint8_t bits_per_pixel;
+ struct drm_display_mode *compliance_mode;
+ char connector_name[12];
+};
+
struct intel_dp {
uint32_t output_reg;
uint32_t aux_ch_ctl_reg;
@@ -613,11 +625,13 @@ struct intel_dp {
enum edp_drrs_refresh_rate_type refresh_rate_type;
struct mutex mutex;
} drrs_state;
+
/* Displayport compliance testing */
unsigned long compliance_app_pid;
unsigned long compliance_test_data;
bool compliance_testing_active;
-
+ struct intel_dp_link_config compliance_config;
+ struct intel_dp_link_config saved_config;
};
struct intel_digital_port {
--
1.9.1
next prev parent reply other threads:[~2014-10-09 15:38 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-09 15:38 [intel-gfx] Displayport compliance testing Todd Previte
2014-10-09 15:38 ` [PATCH 01/10] drm/i915: Add automated testing support for " Todd Previte
2014-10-20 17:48 ` Paulo Zanoni
2014-10-23 16:58 ` Todd Previte
2014-10-24 8:24 ` Daniel Vetter
2014-10-21 13:02 ` Daniel Vetter
2014-11-04 22:31 ` Todd Previte
2014-10-09 15:38 ` [PATCH 02/10] drm/i915: Add counters in the drm_dp_aux struct for I2C NACKs and DEFERs Todd Previte
2014-10-21 17:10 ` [Intel-gfx] " Paulo Zanoni
2014-11-04 22:12 ` Todd Previte
2014-11-04 22:19 ` Daniel Vetter
2014-10-09 15:38 ` [PATCH 03/10] drm/i915: Update intel_dp_check_link_status() for Displayport compliance testing Todd Previte
2014-10-09 15:38 ` [PATCH 04/10] drm/i915: Add a delay in Displayport AUX transactions for " Todd Previte
2014-10-09 15:38 ` [PATCH 05/10] drm/i915: Add debugfs interface for Displayport debug and " Todd Previte
2014-10-23 12:50 ` Daniel Vetter
2014-10-23 12:58 ` Paulo Zanoni
2014-10-23 15:43 ` Daniel Vetter
2014-11-13 18:44 ` Jesse Barnes
2014-11-13 20:44 ` Daniel Vetter
2014-11-13 21:00 ` Dave Airlie
2014-11-13 21:07 ` Jesse Barnes
2014-10-09 15:38 ` [PATCH 06/10] drm/i915: Add debugfs interface and support functions to notify userspace apps for Displayport " Todd Previte
2014-10-09 15:38 ` Todd Previte [this message]
2014-10-09 15:38 ` [PATCH 08/10] drm/i915: Update the EDID automated compliance test function Todd Previte
2014-10-09 15:38 ` [PATCH 09/10] drm/i915: Update intel_dp_compute_config() to respond to Displayport compliance test requests appropriately Todd Previte
2014-10-09 15:38 ` [PATCH 10/10] drm/i915: Fix intel_dp_hot_plug() Todd Previte
2014-10-09 15:49 ` Chris Wilson
2014-10-10 3:38 ` Dave Airlie
2014-10-11 0:20 ` Todd Previte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1412869090-48010-8-git-send-email-tprevite@gmail.com \
--to=tprevite@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox