From patchwork Wed Oct 18 22:29:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Sripada, Radhakrishna" X-Patchwork-Id: 10015385 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5B86660567 for ; Wed, 18 Oct 2017 22:27:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CF1228C46 for ; Wed, 18 Oct 2017 22:27:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B8EC28D23; Wed, 18 Oct 2017 22:27:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CBF0328CC0 for ; Wed, 18 Oct 2017 22:27:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 100866E94C; Wed, 18 Oct 2017 22:27:42 +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 ESMTPS id A06C56E0AB for ; Wed, 18 Oct 2017 22:27:40 +0000 (UTC) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Oct 2017 15:27:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,398,1503385200"; d="scan'208";a="324875403" Received: from invictus.jf.intel.com ([10.54.75.152]) by fmsmga004.fm.intel.com with ESMTP; 18 Oct 2017 15:27:30 -0700 From: "Sripada, Radhakrishna" To: intel-gfx@lists.freedesktop.org Date: Wed, 18 Oct 2017 15:29:49 -0700 Message-Id: <20171018222949.11140-2-radhakrishna.sripada@intel.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171018222949.11140-1-radhakrishna.sripada@intel.com> References: <20171018222949.11140-1-radhakrishna.sripada@intel.com> MIME-Version: 1.0 Cc: Paulo Zanoni Subject: [Intel-gfx] [RFC 2/2] drm/i915: Allow force_bpc property to limit pipe_bpp 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Use the newly added force_bpc connector property to limit pipe bpp. Cc: Ville Syrjälä Cc: Paulo Zanoni Cc: Manasi Navare Signed-off-by: Radhakrishna Sripada --- drivers/gpu/drm/i915/intel_display.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e691c07afd9a..ed8e3f06e605 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -10587,6 +10587,29 @@ connected_sink_compute_bpp(struct intel_connector *connector, } } +static void +connected_sink_force_bpp(struct intel_digital_connector_state *intel_conn_state, + struct intel_crtc_state *pipe_config) +{ + enum connector_force_bpc force_bpc = intel_conn_state->force_bpc; + + switch (force_bpc) { + case INTEL_FORCE_BPC_AUTO: + break; + case INTEL_FORCE_BPC_8: + pipe_config->pipe_bpp = 8*3; + break; + case INTEL_FORCE_BPC_10: + pipe_config->pipe_bpp = 10*3; + break; + case INTEL_FORCE_BPC_12: + pipe_config->pipe_bpp = 12*3; + break; + default: + break; + } +} + static int compute_baseline_pipe_bpp(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) @@ -10615,6 +10638,8 @@ compute_baseline_pipe_bpp(struct intel_crtc *crtc, if (connector_state->crtc != &crtc->base) continue; + connected_sink_force_bpp(to_intel_digital_connector_state(connector_state), + pipe_config); connected_sink_compute_bpp(to_intel_connector(connector), pipe_config); }