From: Egbert Eich <eich@suse.de>
To: intel-gfx@lists.freedesktop.org
Cc: Egbert Eich <eich@suse.de>
Subject: [PATCH 2/5] drm/DP: Create pointer to generic DPCD access function
Date: Mon, 24 Nov 2014 18:16:24 +0100 [thread overview]
Message-ID: <1416849387-20984-3-git-send-email-eich@suse.de> (raw)
In-Reply-To: <1416849387-20984-1-git-send-email-eich@suse.de>
This way a driver can replace this function with its own version.
Signed-off-by: Egbert Eich <eich@suse.de>
---
drivers/gpu/drm/drm_dp_helper.c | 5 +++--
include/drm/drm_dp_helper.h | 8 ++++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index 959e207..d132838 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -238,7 +238,7 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request,
ssize_t drm_dp_dpcd_read(struct drm_dp_aux *aux, unsigned int offset,
void *buffer, size_t size)
{
- return drm_dp_dpcd_access(aux, DP_AUX_NATIVE_READ, offset, buffer,
+ return aux->dpcd_access(aux, DP_AUX_NATIVE_READ, offset, buffer,
size);
}
EXPORT_SYMBOL(drm_dp_dpcd_read);
@@ -260,7 +260,7 @@ EXPORT_SYMBOL(drm_dp_dpcd_read);
ssize_t drm_dp_dpcd_write(struct drm_dp_aux *aux, unsigned int offset,
void *buffer, size_t size)
{
- return drm_dp_dpcd_access(aux, DP_AUX_NATIVE_WRITE, offset, buffer,
+ return aux->dpcd_access(aux, DP_AUX_NATIVE_WRITE, offset, buffer,
size);
}
EXPORT_SYMBOL(drm_dp_dpcd_write);
@@ -552,6 +552,7 @@ static const struct i2c_algorithm drm_dp_i2c_algo = {
int drm_dp_aux_register(struct drm_dp_aux *aux)
{
mutex_init(&aux->hw_mutex);
+ aux->dpcd_access = drm_dp_dpcd_access;
aux->ddc.algo = &drm_dp_i2c_algo;
aux->ddc.algo_data = aux;
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 11f8c84..cd7b464 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -497,6 +497,8 @@ struct drm_dp_aux_msg {
* @dev: pointer to struct device that is the parent for this AUX channel
* @hw_mutex: internal mutex used for locking transfers
* @transfer: transfers a message representing a single AUX transaction
+ * @dp_dpcd_access: hook to optionally wrap or replace high level dpcd message
+ * function.
*
* The .dev field should be set to a pointer to the device that implements
* the AUX channel.
@@ -519,6 +521,10 @@ struct drm_dp_aux_msg {
* transactions. The drm_dp_aux_register_i2c_bus() function registers an
* I2C adapter that can be passed to drm_probe_ddc(). Upon removal, drivers
* should call drm_dp_aux_unregister_i2c_bus() to remove the I2C adapter.
+ * dpcd_access() can be used by the driver to wrap or replace the generic
+ * dpcd access function in case certain operations should be performed before
+ * a dpcd transaction is started if this cannot reasonably performed in
+ * .transfer(). It is initialized to its default value by drm_dp_aux_register().
*
* Note that the aux helper code assumes that the .transfer() function
* only modifies the reply field of the drm_dp_aux_msg structure. The
@@ -531,6 +537,8 @@ struct drm_dp_aux {
struct mutex hw_mutex;
ssize_t (*transfer)(struct drm_dp_aux *aux,
struct drm_dp_aux_msg *msg);
+ int (*dpcd_access)(struct drm_dp_aux *aux, u8 request,
+ unsigned int offset, void *buffer, size_t size);
unsigned i2c_nack_count, i2c_defer_count;
};
--
1.8.4.5
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-11-24 17:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-24 17:16 [PATCH 0/5] drm/i915 Avoid long delays when reading EDID on eDP Egbert Eich
2014-11-24 17:16 ` [PATCH 1/5] drm/i915: Try to avoid pps_{lock, unlock}() on DP ports Egbert Eich
2014-11-24 18:28 ` Jani Nikula
2014-11-24 17:16 ` Egbert Eich [this message]
2014-11-24 17:16 ` [PATCH 3/5] drm/DP: Export drm_dp_i2c_xfer() DP helper function Egbert Eich
2014-11-24 17:16 ` [PATCH 4/5] drm/DP: Export drm_dp_dpcd_access() " Egbert Eich
2014-11-24 17:16 ` [PATCH 5/5] drm/i915/eDP: Move pps_lock() and edp_panel_vdd_on() to top Egbert Eich
2014-11-25 9:08 ` [PATCH 0/5] drm/i915 Avoid long delays when reading EDID on eDP Jani Nikula
2014-11-25 13:13 ` Daniel Vetter
2014-11-25 17:20 ` Egbert Eich
2014-11-26 8:57 ` Daniel Vetter
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=1416849387-20984-3-git-send-email-eich@suse.de \
--to=eich@suse.de \
--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