All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 7/7] drm/i915/sdvo: Add dot crawl property
Date: Mon, 19 Jul 2010 14:25:48 +0100	[thread overview]
Message-ID: <1279545948-24378-8-git-send-email-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <1279545948-24378-1-git-send-email-chris@chris-wilson.co.uk>

This property is slightly unusual in that it is a boolean and so has no
GET_MAX command.

Reference:

  Bug 28636 - missing TV parameter "Dot Crawl freeze"
  https://bugs.freedesktop.org/show_bug.cgi?id=28636

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_sdvo.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 39ef9ce..b07d2d4 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -161,6 +161,7 @@ struct intel_sdvo_connector {
 	struct drm_property *flicker_filter_2d;
 	struct drm_property *tv_chroma_filter;
 	struct drm_property *tv_luma_filter;
+	struct drm_property *dot_crawl;
 
 	/* add the property for the SDVO-TV/LVDS */
 	struct drm_property *brightness;
@@ -182,6 +183,7 @@ struct intel_sdvo_connector {
 	u32	cur_flicker_filter_2d,		max_flicker_filter_2d;
 	u32	cur_tv_chroma_filter,	max_tv_chroma_filter;
 	u32	cur_tv_luma_filter,	max_tv_luma_filter;
+	u32	cur_dot_crawl,	max_dot_crawl;
 };
 
 static struct intel_sdvo *enc_to_intel_sdvo(struct drm_encoder *encoder)
@@ -1749,6 +1751,8 @@ intel_sdvo_destroy_enhance_property(struct drm_connector *connector)
 		drm_property_destroy(dev, intel_sdvo_connector->tv_luma_filter);
 	if (intel_sdvo_connector->tv_chroma_filter)
 		drm_property_destroy(dev, intel_sdvo_connector->tv_chroma_filter);
+	if (intel_sdvo_connector->dot_crawl)
+		drm_property_destroy(dev, intel_sdvo_connector->dot_crawl);
 	if (intel_sdvo_connector->brightness)
 		drm_property_destroy(dev, intel_sdvo_connector->brightness);
 }
@@ -1865,6 +1869,7 @@ intel_sdvo_set_property(struct drm_connector *connector,
 		CHECK_PROPERTY(flicker_filter_adaptive, FLICKER_FILTER_ADAPTIVE)
 		CHECK_PROPERTY(tv_chroma_filter, TV_CHROMA_FILTER)
 		CHECK_PROPERTY(tv_luma_filter, TV_LUMA_FILTER)
+		CHECK_PROPERTY(dot_crawl, DOT_CRAWL)
 	}
 
 	return -EINVAL; /* unknown property */
@@ -2437,6 +2442,25 @@ intel_sdvo_create_enhance_property_tv(struct intel_sdvo *intel_sdvo,
 	ENHANCEMENT(tv_chroma_filter, TV_CHROMA_FILTER);
 	ENHANCEMENT(tv_luma_filter, TV_LUMA_FILTER);
 
+	if (enhancements.dot_crawl) {
+		if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_DOT_CRAWL, &response, 2))
+			return false;
+
+		intel_sdvo_connector->max_dot_crawl = 1;
+		intel_sdvo_connector->cur_dot_crawl = response & 0x1;
+		intel_sdvo_connector->dot_crawl =
+			drm_property_create(dev, DRM_MODE_PROP_RANGE, "dot_crawl", 2);
+		if (!intel_sdvo_connector->dot_crawl)
+			return false;
+
+		intel_sdvo_connector->dot_crawl->values[0] = 0;
+		intel_sdvo_connector->dot_crawl->values[1] = 1;
+		drm_connector_attach_property(connector,
+					      intel_sdvo_connector->dot_crawl,
+					      intel_sdvo_connector->cur_dot_crawl);
+		DRM_DEBUG_KMS("dot crawl: current %d\n", response);
+	}
+
 	return true;
 }
 
-- 
1.7.1

  parent reply	other threads:[~2010-07-19 13:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-19 13:25 Revamp intel_sdvo and add missing properties Chris Wilson
2010-07-19 13:25 ` [PATCH 1/7] drm/i915: Subclass intel_encoder Chris Wilson
2010-08-02  2:43   ` Eric Anholt
2010-07-19 13:25 ` [PATCH 2/7] drm/i915: Subclass intel_connector Chris Wilson
2010-07-19 13:25 ` [PATCH 3/7] drm/i915/sdvo: Propagate errors from reading/writing control bus Chris Wilson
2010-07-19 13:25 ` [PATCH 4/7] drm/i915/sdvo: Use an integer mapping for supported tv format modes Chris Wilson
2010-07-19 13:25 ` [PATCH 5/7] drm/i915/sdvo: Check for allocation failure when constructing properties Chris Wilson
2010-07-19 13:25 ` [PATCH 6/7] drm/i915/sdvo: Add missing TV filters Chris Wilson
2010-07-19 13:25 ` Chris Wilson [this message]
2010-08-04 12:50 SVDO properties patchset Chris Wilson
2010-08-04 12:50 ` [PATCH 7/7] drm/i915/sdvo: Add dot crawl property Chris Wilson

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=1279545948-24378-8-git-send-email-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.