From patchwork Mon Jan 14 14:15:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 1972161 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 61310DF23A for ; Mon, 14 Jan 2013 14:20:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5278FE626E for ; Mon, 14 Jan 2013 06:20:27 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id 015E0E5F3E; Mon, 14 Jan 2013 06:15:24 -0800 (PST) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 14 Jan 2013 06:15:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,468,1355126400"; d="scan'208";a="243566188" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.168]) by azsmga001.ch.intel.com with SMTP; 14 Jan 2013 06:15:22 -0800 Received: by stinkbox (sSMTP sendmail emulation); Mon, 14 Jan 2013 16:15:21 +0200 From: ville.syrjala@linux.intel.com To: intel-gfx@lists.freedesktop.org Subject: [PATCH 2/5] drm/i915: Add has_hdmi_monitor to intel_hdmi Date: Mon, 14 Jan 2013 16:15:07 +0200 Message-Id: <1358172910-7820-3-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1358172910-7820-1-git-send-email-ville.syrjala@linux.intel.com> References: <1358172910-7820-1-git-send-email-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Cc: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Ville Syrjälä intel_hdmi.has_hdmi_sink is tied into the force audio property, so it doesn't seem like the correct way to detect HDMI monitors. Instead add a new has_hdmi_monitor member which simply tells whether a HDMI monitor was detected. Not sure if this is the best way, or if we should just use has_hdmi_sink for the CEA-861 automatic color range property... At least the infoframe stuff already depends on has_hdmi_sink. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_hdmi.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 4df47be..aed7478 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -344,6 +344,7 @@ struct intel_hdmi { int ddc_bus; uint32_t color_range; bool has_hdmi_sink; + bool has_hdmi_monitor; bool has_audio; enum hdmi_force_audio force_audio; void (*write_infoframe)(struct drm_encoder *encoder, diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index f194d75..e663dec 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c @@ -815,6 +815,7 @@ intel_hdmi_detect(struct drm_connector *connector, bool force) return status; intel_hdmi->has_hdmi_sink = false; + intel_hdmi->has_hdmi_monitor = false; intel_hdmi->has_audio = false; edid = drm_get_edid(connector, intel_gmbus_get_adapter(dev_priv, @@ -823,9 +824,10 @@ intel_hdmi_detect(struct drm_connector *connector, bool force) if (edid) { if (edid->input & DRM_EDID_INPUT_DIGITAL) { status = connector_status_connected; + intel_hdmi->has_hdmi_monitor = + drm_detect_hdmi_monitor(edid); if (intel_hdmi->force_audio != HDMI_AUDIO_OFF_DVI) - intel_hdmi->has_hdmi_sink = - drm_detect_hdmi_monitor(edid); + intel_hdmi->has_hdmi_sink = intel_hdmi->has_hdmi_monitor; intel_hdmi->has_audio = drm_detect_monitor_audio(edid); } kfree(edid);