From patchwork Mon May 16 13:19:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kahola X-Patchwork-Id: 9110351 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D3196BF29F for ; Tue, 17 May 2016 08:08:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 06F52201ED for ; Tue, 17 May 2016 08:08:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 33C38202FF for ; Tue, 17 May 2016 08:08:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 16E1D6E637; Tue, 17 May 2016 08:08:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 8966B6E42B; Mon, 16 May 2016 13:19:48 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 16 May 2016 06:19:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,627,1455004800"; d="scan'208";a="982011272" Received: from sorvi.fi.intel.com ([10.237.72.50]) by fmsmga002.fm.intel.com with ESMTP; 16 May 2016 06:19:47 -0700 From: Mika Kahola To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 4/7] drm: Read DPCD receiver capability for DP to HDMI converter Date: Mon, 16 May 2016 16:19:30 +0300 Message-Id: <1463404773-5167-5-git-send-email-mika.kahola@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1463404773-5167-1-git-send-email-mika.kahola@intel.com> References: <1463404773-5167-1-git-send-email-mika.kahola@intel.com> X-Mailman-Approved-At: Tue, 17 May 2016 08:08:36 +0000 Cc: daniel.vetter@intel.com, intel-gfx@lists.freedesktop.org, jim.bish@intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Read from DPCD receiver capability field for DP to HDMI converter. The features for DP to HDMI converter are - max TMDS characther clock rate - max bits per component - support for conversion from 3D frame sequential to frame pack - support for YCBCR422 pass through - support for YCBCR420 pass through - support for conversion from YCBCR444 to YCBCR422 - support for conversion from YCBCR444 to YCBCR420 Signed-off-by: Mika Kahola --- drivers/gpu/drm/drm_dp_helper.c | 8 ++++++++ include/drm/drm_dp_helper.h | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index f5cf706..ccd0fcb 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -456,6 +456,14 @@ int drm_dp_bd(struct drm_dp_aux *aux, struct drm_dp_bd *bd) bd->dfp.dvi.bpc = info[2] & DP_DS_VGA_MAX_BPC_MASK; bd->dfp.dvi.dual_link = info[3] & DP_DS_DVI_DUAL_LINK; bd->dfp.dvi.hi_color_depth = info[3] & DP_DS_DVI_HI_COLOR_DEPTH; + } else if (bd->type & DP_DS_PORT_TYPE_HDMI) { + bd->dfp.hdmi.tmds_clk = info[1] * 2500; + bd->dfp.hdmi.bpc = info[2] & DP_DS_VGA_MAX_BPC_MASK; + bd->dfp.hdmi.frame_seq_to_frame_pack = info[3] & FRAME_SEQ_TO_FRAME_PACK; + bd->dfp.hdmi.ycbcr422_pass_through = info[3] & YCBCR422_PASS_THROUGH; + bd->dfp.hdmi.ycbcr420_pass_through = info[3] & YCBCR420_PASS_THROUGH; + bd->dfp.hdmi.conversion_from_ycbcr444_to_ycbcr422 = info[3] & YCBCR444_TO_YCBCR422; + bd->dfp.hdmi.conversion_from_ycbcr444_to_ycbcr420 = info[3] & YCBCR444_TO_YCBCR420; } } diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index da82459..3607250 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -223,6 +223,12 @@ /* offset 3 for DVI dual link and high color depth */ # define DP_DS_DVI_DUAL_LINK (1<<1) # define DP_DS_DVI_HI_COLOR_DEPTH (1<<2) +/* offset 3 for HDMI */ +# define FRAME_SEQ_TO_FRAME_PACK (1<<0) +# define YCBCR422_PASS_THROUGH (1<<1) +# define YCBCR420_PASS_THROUGH (1<<2) +# define YCBCR444_TO_YCBCR422 (1<<3) +# define YCBCR444_TO_YCBCR420 (1<<4) /* link configuration */ #define DP_LINK_BW_SET 0x100 @@ -821,6 +827,18 @@ struct drm_dp_dvi { bool dual_link; bool hi_color_depth; }; +/* + * DP to HDMI + */ +struct drm_dp_hdmi { + int tmds_clk; + uint8_t bpc; + bool frame_seq_to_frame_pack; + bool ycbcr422_pass_through; + bool ycbcr420_pass_through; + bool conversion_from_ycbcr444_to_ycbcr422; + bool conversion_from_ycbcr444_to_ycbcr420; +}; /* * Branch device @@ -832,6 +850,7 @@ struct drm_dp_bd { union { struct drm_dp_vga vga; struct drm_dp_dvi dvi; + struct drm_dp_hdmi hdmi; } dfp; };