From patchwork Sat Apr 30 01:28:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Navare, Manasi" X-Patchwork-Id: 8986141 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5DFC99F46D for ; Sat, 30 Apr 2016 01:18:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8909F201E4 for ; Sat, 30 Apr 2016 01:18:41 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 84CB6201CE for ; Sat, 30 Apr 2016 01:18:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9F4756F008; Sat, 30 Apr 2016 01:18:34 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 1AB166F00A for ; Sat, 30 Apr 2016 01:18:30 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 29 Apr 2016 18:18:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,553,1455004800"; d="scan'208";a="943219767" Received: from manasi-otcmedia.jf.intel.com ([10.7.199.175]) by orsmga001.jf.intel.com with ESMTP; 29 Apr 2016 18:18:28 -0700 From: Manasi Navare To: intel-gfx@lists.freedesktop.org Date: Fri, 29 Apr 2016 18:28:14 -0700 Message-Id: <1461979695-27113-5-git-send-email-manasi.d.navare@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461979695-27113-1-git-send-email-manasi.d.navare@intel.com> References: <1461979695-27113-1-git-send-email-manasi.d.navare@intel.com> Subject: [Intel-gfx] [PATCH 4/5] Add support for forcing 6 bpc on DP pipes. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.2 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 From: Jim Bride For DP compliance we need to be able to control the output color type for the pipe associated with the DP port. To do this we rely on the intel_dp_test_force_bpc debugfs file and the associated value stored in struct intel_dp. If the debugfs file has a non-zero value and we're on a display port connector, then we use the value from debugfs to calculate the bpp for the pipe. For cases where we are not on DP or there has not been an overridden value then we behave as normal. Signed-off-by: Jim Bride Signed-off-by: Manasi Navare --- drivers/gpu/drm/i915/intel_display.c | 32 ++++++++++++++++++++++++++++++-- drivers/gpu/drm/i915/intel_drv.h | 1 + 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 5ffccf6..1618d36 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -12102,11 +12102,39 @@ compute_baseline_pipe_bpp(struct intel_crtc *crtc, /* Clamp display bpp to EDID value */ for_each_connector_in_state(state, connector, connector_state, i) { + int type = 0; + + if (connector_state->best_encoder) { + struct intel_encoder *ienc; + + ienc = to_intel_encoder(connector_state->best_encoder); + type = ienc->type; + } + if (connector_state->crtc != &crtc->base) continue; - connected_sink_compute_bpp(to_intel_connector(connector), - pipe_config); + /* For DP compliance we need to ensure that we can override + * the computed bpp for the pipe. + */ + if (type == INTEL_OUTPUT_DISPLAYPORT) { + struct intel_dp *intel_dp = + enc_to_intel_dp(connector_state->best_encoder); + + if (intel_dp && + (intel_dp->compliance_force_bpc != 0)) { + pipe_config->pipe_bpp = + intel_dp->compliance_force_bpc*3; + DRM_DEBUG_KMS("JMB Setting pipe_bpp to %d\n", + pipe_config->pipe_bpp); + } else { + connected_sink_compute_bpp(to_intel_connector(connector), + pipe_config); + } + } else { + connected_sink_compute_bpp(to_intel_connector(connector), + pipe_config); + } } return bpp; diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index e23eed7..10eaff8 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -865,6 +865,7 @@ struct intel_dp { unsigned long compliance_test_type; unsigned long compliance_test_data; bool compliance_test_active; + unsigned long compliance_force_bpc; /* 0 for default or bpc to use */ }; struct intel_digital_port {