From: Jani Nikula <jani.nikula@linux.intel.com>
To: Bob Paauwe <bob.j.paauwe@intel.com>,
intel-gfx <intel-gfx@lists.freedesktop.org>
Subject: Re: [RFC 02/12] drm/i915/config: Introduce intel_output_name
Date: Fri, 13 Feb 2015 10:12:07 +0200 [thread overview]
Message-ID: <87r3tus014.fsf@intel.com> (raw)
In-Reply-To: <1423784498-11272-3-git-send-email-bob.j.paauwe@intel.com>
On Fri, 13 Feb 2015, Bob Paauwe <bob.j.paauwe@intel.com> wrote:
> Human readable name for each output type to correspond with names
> used in the ACPI property tables.
Could you not use drm_connector and drm_encoder type and name fields?
BR,
Jani.
>
> Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 57 ++++++++++++++++++++++++++++++++++++
> drivers/gpu/drm/i915/intel_drv.h | 1 +
> 2 files changed, 58 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 3b0fe9f..de6de83 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12440,6 +12440,63 @@ static bool intel_crt_present(struct drm_device *dev)
> return true;
> }
>
> +/*
> + * Provide a name for the various outputs.
> + */
> +const char *intel_output_name(struct intel_connector *connector)
> +{
> + int output;
> + static const char *names[] = {
> + [INTEL_OUTPUT_UNUSED] = "Unused",
> + [INTEL_OUTPUT_ANALOG] = "Analog",
> + [INTEL_OUTPUT_DVO] = "DVO",
> + [INTEL_OUTPUT_SDVO] = "SDVO",
> + [INTEL_OUTPUT_LVDS] = "LVDS",
> + [INTEL_OUTPUT_TVOUT] = "TV",
> + [INTEL_OUTPUT_HDMI] = "HDMI",
> + [INTEL_OUTPUT_DISPLAYPORT] = "DisplayPort",
> + [INTEL_OUTPUT_EDP] = "eDP",
> + [INTEL_OUTPUT_DSI] = "DSI",
> + [INTEL_OUTPUT_UNKNOWN] = "Unknown",
> + };
> + static const char *name_ex[] = {
> + [0] = "HDMI_A",
> + [1] = "HDMI_B",
> + [2] = "HDMI_C",
> + [3] = "HDMI_D",
> + [4] = "DisplayPort_A",
> + [5] = "DisplayPort_B",
> + [6] = "DisplayPort_C",
> + [7] = "DisplayPort_D",
> + [8] = "eDP_A",
> + [9] = "eDP_B",
> + [10] = "eDP_C",
> + [11] = "eDP_D",
> + };
> +
> + if (!connector || !connector->encoder)
> + return "Unknown";
> +
> + switch (connector->encoder->type) {
> + case INTEL_OUTPUT_HDMI:
> + case INTEL_OUTPUT_DISPLAYPORT:
> + case INTEL_OUTPUT_EDP:
> + output = ((connector->encoder->type - INTEL_OUTPUT_HDMI) * 4) +
> + enc_to_dig_port(&connector->encoder->base)->port;
> +
> + if (output < 0 || output >= ARRAY_SIZE(name_ex))
> + return "Invalid";
> +
> + return name_ex[output];
> + default:
> + if (output < 0 || output >= ARRAY_SIZE(names) || !names[output])
> + return "Invalid";
> +
> + return names[output];
> + }
> +}
> +
> +
> static void intel_setup_outputs(struct drm_device *dev)
> {
> struct drm_i915_private *dev_priv = dev->dev_private;
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index aefd95e..4c81ee9 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -893,6 +893,7 @@ void i915_audio_component_cleanup(struct drm_i915_private *dev_priv);
>
> /* intel_display.c */
> extern const struct drm_plane_funcs intel_plane_funcs;
> +const char *intel_output_name(struct intel_connector *intel_connector);
> bool intel_has_pending_fb_unpin(struct drm_device *dev);
> int intel_pch_rawclk(struct drm_device *dev);
> void intel_mark_busy(struct drm_device *dev);
> --
> 2.1.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-02-13 8:11 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-12 23:41 [RFC 00/12] i915 init-time configuration Bob Paauwe
2015-02-12 23:41 ` [RFC 01/12] drm/i915/config: Initial framework Bob Paauwe
2015-02-13 8:19 ` Jani Nikula
2015-02-24 16:17 ` Daniel Vetter
2015-02-24 17:41 ` Bob Paauwe
2015-02-24 20:47 ` Daniel Vetter
2015-02-12 23:41 ` [RFC 02/12] drm/i915/config: Introduce intel_output_name Bob Paauwe
2015-02-13 8:12 ` Jani Nikula [this message]
2015-02-12 23:41 ` [RFC 03/12] drm/i915/config: Add init-time configuration of bits per color Bob Paauwe
2015-02-12 23:41 ` [RFC 04/12] drm/i915/config: Set dp panel fitter property based on init-time config Bob Paauwe
2015-02-12 23:41 ` [RFC 05/12] drm/i915/config: Set general connector properties using config Bob Paauwe
2015-02-12 23:41 ` [RFC 06/12] drm/i915/config: Split out allocation of list nodes Bob Paauwe
2015-02-13 8:15 ` Jani Nikula
2015-02-12 23:41 ` [RFC 07/12] drm/i915/config: Get workaround information from configuration Bob Paauwe
2015-02-24 13:51 ` Daniel Vetter
2015-02-24 17:54 ` Bob Paauwe
2015-02-12 23:41 ` [RFC 08/12] drm/i915/config: Use workarounds list " Bob Paauwe
2015-02-12 23:41 ` [RFC 09/12] drm/i915/config: Add VBT settings configuration Bob Paauwe
2015-02-24 13:57 ` Daniel Vetter
2015-02-24 18:37 ` Bob Paauwe
2015-02-24 20:52 ` Daniel Vetter
2015-02-24 22:23 ` Bob Paauwe
2015-05-15 9:39 ` Ville Syrjälä
2015-05-20 17:07 ` Bob Paauwe
2015-05-21 8:37 ` Daniel Vetter
2015-05-26 21:20 ` Bob Paauwe
2015-05-27 12:23 ` Daniel Vetter
2015-02-12 23:41 ` [RFC 10/12] drm/i915/config: Introduce a test table and code to make use of it Bob Paauwe
2015-02-12 23:41 ` [RFC 11/12] drm/i915/config: Add workaround properties to ACPI table Bob Paauwe
2015-02-12 23:41 ` [RFC 12/12] drm/i915/config: Add ACPI device examples for VBT configuration Bob Paauwe
2015-02-13 8:08 ` [RFC 00/12] i915 init-time configuration Jani Nikula
2015-02-13 17:17 ` Bob Paauwe
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=87r3tus014.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=bob.j.paauwe@intel.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