From: Ander Conselvan de Oliveira <conselvan2@gmail.com>
To: Matt Roper <matthew.d.roper@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 07/10] drm/i915: Add atomic_get_property entrypoint for connectors (v2)
Date: Fri, 23 Jan 2015 07:43:15 +0200 [thread overview]
Message-ID: <54C1DF73.1000805@gmail.com> (raw)
In-Reply-To: <1421974287-25129-1-git-send-email-matthew.d.roper@intel.com>
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
On 01/23/2015 02:51 AM, Matt Roper wrote:
> Even though we only support atomic plane updates at the moment, we still
> need to add an .atomic_get_property() entrypoint for connectors before
> we allow the driver to flip on the DRIVER_ATOMIC bit. As soon as that
> bit gets set, the DRM core will start adding atomic connector properties
> (in addition to the plane properties we care about at the moment), so we
> need to be able to handle the new way the DRM core will interact with
> us.
>
> For simplicity, we just lookup driver-specific connector properties in
> the usual shadow array maintained by the core. Once we get real atomic
> modeset support for crtc's and planes, this code should be re-written to
> pull the data out of crtc/connector state structures.
>
> v2: Fix intel_dvo and intel_dsi that I missed on the first pass (Ander)
>
> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> ---
> drivers/gpu/drm/i915/intel_atomic.c | 38 +++++++++++++++++++++++++++++++++++++
> drivers/gpu/drm/i915/intel_crt.c | 1 +
> drivers/gpu/drm/i915/intel_dp.c | 1 +
> drivers/gpu/drm/i915/intel_dp_mst.c | 1 +
> drivers/gpu/drm/i915/intel_drv.h | 4 ++++
> drivers/gpu/drm/i915/intel_dsi.c | 1 +
> drivers/gpu/drm/i915/intel_dvo.c | 1 +
> drivers/gpu/drm/i915/intel_hdmi.c | 1 +
> drivers/gpu/drm/i915/intel_lvds.c | 1 +
> drivers/gpu/drm/i915/intel_sdvo.c | 1 +
> drivers/gpu/drm/i915/intel_tv.c | 1 +
> 11 files changed, 51 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
> index 5c31f54..52ef6f4 100644
> --- a/drivers/gpu/drm/i915/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/intel_atomic.c
> @@ -162,3 +162,41 @@ int intel_atomic_commit(struct drm_device *dev,
>
> return 0;
> }
> +
> +/**
> + * intel_connector_atomic_get_property - fetch connector property value
> + * @connector: connector to fetch property for
> + * @state: state containing the property value
> + * @property: property to look up
> + * @val: pointer to write property value into
> + *
> + * The DRM core does not store shadow copies of properties for
> + * atomic-capable drivers. This entrypoint is used to fetch
> + * the current value of a driver-specific connector property.
> + */
> +int
> +intel_connector_atomic_get_property(struct drm_connector *connector,
> + const struct drm_connector_state *state,
> + struct drm_property *property,
> + uint64_t *val)
> +{
> + int i;
> +
> + /*
> + * TODO: We only have atomic modeset for planes at the moment, so the
> + * crtc/connector code isn't quite ready yet. Until it's ready,
> + * continue to look up all property values in the DRM's shadow copy
> + * in obj->properties->values[].
> + *
> + * When the crtc/connector state work matures, this function should
> + * be updated to read the values out of the state structure instead.
> + */
> + for (i = 0; i < connector->base.properties->count; i++) {
> + if (connector->base.properties->properties[i] == property) {
> + *val = connector->base.properties->values[i];
> + return 0;
> + }
> + }
> +
> + return -EINVAL;
> +}
> diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
> index 18ee41e..e66e17a 100644
> --- a/drivers/gpu/drm/i915/intel_crt.c
> +++ b/drivers/gpu/drm/i915/intel_crt.c
> @@ -794,6 +794,7 @@ static const struct drm_connector_funcs intel_crt_connector_funcs = {
> .destroy = intel_crt_destroy,
> .set_property = intel_crt_set_property,
> .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
> + .atomic_get_property = intel_connector_atomic_get_property,
> };
>
> static const struct drm_connector_helper_funcs intel_crt_connector_helper_funcs = {
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 1b1917b..bac55dd 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -4402,6 +4402,7 @@ static const struct drm_connector_funcs intel_dp_connector_funcs = {
> .force = intel_dp_force,
> .fill_modes = drm_helper_probe_single_connector_modes,
> .set_property = intel_dp_set_property,
> + .atomic_get_property = intel_connector_atomic_get_property,
> .destroy = intel_dp_connector_destroy,
> .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
> };
> diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
> index f86da0f..2856b0b 100644
> --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> @@ -314,6 +314,7 @@ static const struct drm_connector_funcs intel_dp_mst_connector_funcs = {
> .detect = intel_dp_mst_detect,
> .fill_modes = drm_helper_probe_single_connector_modes,
> .set_property = intel_dp_mst_set_property,
> + .atomic_get_property = intel_connector_atomic_get_property,
> .destroy = intel_dp_mst_connector_destroy,
> .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
> };
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 833f44c..b068d7a 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1249,6 +1249,10 @@ int intel_atomic_check(struct drm_device *dev,
> int intel_atomic_commit(struct drm_device *dev,
> struct drm_atomic_state *state,
> bool async);
> +int intel_connector_atomic_get_property(struct drm_connector *connector,
> + const struct drm_connector_state *state,
> + struct drm_property *property,
> + uint64_t *val);
>
> /* intel_atomic_plane.c */
> struct intel_plane_state *intel_create_plane_state(struct drm_plane *plane);
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index e9226ac..6271d24 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -792,6 +792,7 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = {
> .detect = intel_dsi_detect,
> .destroy = intel_dsi_destroy,
> .fill_modes = drm_helper_probe_single_connector_modes,
> + .atomic_get_property = intel_connector_atomic_get_property,
> .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
> };
>
> diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
> index 1cf2e352..d857951 100644
> --- a/drivers/gpu/drm/i915/intel_dvo.c
> +++ b/drivers/gpu/drm/i915/intel_dvo.c
> @@ -391,6 +391,7 @@ static const struct drm_connector_funcs intel_dvo_connector_funcs = {
> .detect = intel_dvo_detect,
> .destroy = intel_dvo_destroy,
> .fill_modes = drm_helper_probe_single_connector_modes,
> + .atomic_get_property = intel_connector_atomic_get_property,
> .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
> };
>
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index b8fab8c..995c5b2 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -1615,6 +1615,7 @@ static const struct drm_connector_funcs intel_hdmi_connector_funcs = {
> .force = intel_hdmi_force,
> .fill_modes = drm_helper_probe_single_connector_modes,
> .set_property = intel_hdmi_set_property,
> + .atomic_get_property = intel_connector_atomic_get_property,
> .destroy = intel_hdmi_destroy,
> .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
> };
> diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
> index 908bd42..071b96d 100644
> --- a/drivers/gpu/drm/i915/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/intel_lvds.c
> @@ -532,6 +532,7 @@ static const struct drm_connector_funcs intel_lvds_connector_funcs = {
> .detect = intel_lvds_detect,
> .fill_modes = drm_helper_probe_single_connector_modes,
> .set_property = intel_lvds_set_property,
> + .atomic_get_property = intel_connector_atomic_get_property,
> .destroy = intel_lvds_destroy,
> .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
> };
> diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
> index ae00bf9..64ad2b4 100644
> --- a/drivers/gpu/drm/i915/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/intel_sdvo.c
> @@ -2191,6 +2191,7 @@ static const struct drm_connector_funcs intel_sdvo_connector_funcs = {
> .detect = intel_sdvo_detect,
> .fill_modes = drm_helper_probe_single_connector_modes,
> .set_property = intel_sdvo_set_property,
> + .atomic_get_property = intel_connector_atomic_get_property,
> .destroy = intel_sdvo_destroy,
> .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
> };
> diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
> index d450054..892d23c 100644
> --- a/drivers/gpu/drm/i915/intel_tv.c
> +++ b/drivers/gpu/drm/i915/intel_tv.c
> @@ -1513,6 +1513,7 @@ static const struct drm_connector_funcs intel_tv_connector_funcs = {
> .detect = intel_tv_detect,
> .destroy = intel_tv_destroy,
> .set_property = intel_tv_set_property,
> + .atomic_get_property = intel_connector_atomic_get_property,
> .fill_modes = drm_helper_probe_single_connector_modes,
> .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
> };
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-01-23 5:43 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-22 0:35 [PATCH 00/10] i915 nuclear pageflip (v2) Matt Roper
2015-01-22 0:35 ` [PATCH 01/10] drm: Add rotation value to plane state Matt Roper
2015-01-22 0:35 ` [PATCH 02/10] drm/i915: Move rotation from intel_plane to drm_plane_state Matt Roper
2015-01-22 10:54 ` Ander Conselvan de Oliveira
2015-01-22 0:35 ` [PATCH 03/10] drm/i915: Consolidate plane handler vtables Matt Roper
2015-01-22 0:35 ` [PATCH 04/10] drm/i915: Add .atomic_{get, set}_property() entrypoints to planes Matt Roper
2015-01-22 11:09 ` Ander Conselvan de Oliveira
2015-01-22 0:35 ` [PATCH 05/10] drm/i915: Add main atomic entrypoints (v2) Matt Roper
2015-01-22 12:52 ` Ander Conselvan de Oliveira
2015-01-22 0:35 ` [PATCH 06/10] drm/i915: Setup dummy atomic state for connectors (v2) Matt Roper
2015-01-22 16:00 ` Ander Conselvan de Oliveira
2015-01-23 0:50 ` [PATCH 06/10] drm/i915: Setup dummy atomic state for connectors (v3) Matt Roper
2015-01-23 5:42 ` Ander Conselvan de Oliveira
2015-01-22 0:35 ` [PATCH 07/10] drm/i915: Add atomic_get_property entrypoint for connectors Matt Roper
2015-01-22 16:55 ` Ander Conselvan de Oliveira
2015-01-23 0:51 ` [PATCH 07/10] drm/i915: Add atomic_get_property entrypoint for connectors (v2) Matt Roper
2015-01-23 5:43 ` Ander Conselvan de Oliveira [this message]
2015-01-22 0:35 ` [PATCH 08/10] drm/i915: Add crtc state duplication/destruction functions Matt Roper
2015-01-22 17:08 ` Ander Conselvan de Oliveira
2015-01-22 0:35 ` [PATCH 09/10] drm/i915: Switch plane properties to full atomic helper Matt Roper
2015-01-22 17:16 ` Ander Conselvan de Oliveira
2015-01-22 0:35 ` [PATCH 10/10] drm/i915: Add i915.nuclear_pageflip command line param to force atomic (v3) Matt Roper
2015-01-22 17:32 ` Ander Conselvan de Oliveira
2015-01-23 0:53 ` [PATCH 10/10] drm/i915: Add i915.nuclear_pageflip command line param to force atomic (v4) Matt Roper
2015-01-27 9:22 ` 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=54C1DF73.1000805@gmail.com \
--to=conselvan2@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=matthew.d.roper@intel.com \
/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