From patchwork Sat Aug 25 01:02:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Sripada, Radhakrishna" X-Patchwork-Id: 10576005 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51C25112E for ; Sat, 25 Aug 2018 01:00:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40B7C2CAD0 for ; Sat, 25 Aug 2018 01:00:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34C892CAD7; Sat, 25 Aug 2018 01:00:26 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 E7C2D2CAD0 for ; Sat, 25 Aug 2018 01:00:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A177A6E794; Sat, 25 Aug 2018 01:00:23 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id E19406E78B for ; Sat, 25 Aug 2018 01:00:21 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Aug 2018 18:00:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,284,1531810800"; d="scan'208";a="79992933" Received: from invictus.jf.intel.com ([10.54.75.152]) by fmsmga002.fm.intel.com with ESMTP; 24 Aug 2018 18:00:21 -0700 From: Radhakrishna Sripada To: intel-gfx@lists.freedesktop.org Date: Fri, 24 Aug 2018 18:02:17 -0700 Message-Id: <20180825010217.7612-2-radhakrishna.sripada@intel.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20180825010217.7612-1-radhakrishna.sripada@intel.com> References: <20180825010217.7612-1-radhakrishna.sripada@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v3 2/2] drm/i915: Allow "max bpc" property to limit pipe_bpp X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedestop.org, Kishore Kadiyala , Rodrigo Vivi Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: "Sripada, Radhakrishna" Use the newly added "max bpc" connector property to limit pipe bpp. V3: Use drm_connector_state to access the "max bpc" property Cc: Ville Syrjälä Cc: Rodrigo Vivi Cc: Kishore Kadiyala Cc: Manasi Navare Cc: Stanislav Lisovskiy 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 30fdfd1a3037..8506cd1634fb 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -10784,6 +10784,28 @@ connected_sink_compute_bpp(struct intel_connector *connector, } } +static void +connected_sink_max_bpp(struct drm_connector_state *conn_state, + struct intel_crtc_state *pipe_config) +{ + switch (conn_state->max_bpc) { + case 8: + case 9: + pipe_config->pipe_bpp = 8*3; + break; + case 10: + case 11: + pipe_config->pipe_bpp = 10*3; + break; + case 12: + pipe_config->pipe_bpp = 12*3; + break; + default: + break; + } + DRM_DEBUG_KMS("Limiting display bpp to %d\n", pipe_config->pipe_bpp); +} + static int compute_baseline_pipe_bpp(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) @@ -10812,6 +10834,9 @@ compute_baseline_pipe_bpp(struct intel_crtc *crtc, if (connector_state->crtc != &crtc->base) continue; + if (connector_state->max_bpc) + connected_sink_max_bpp(connector_state, pipe_config); + connected_sink_compute_bpp(to_intel_connector(connector), pipe_config); }