Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1294425pxj; Fri, 4 Jun 2021 10:34:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUdDX4O293oelWbITjCdaPRsGNM5eaURylNsEmX2hn33rlL6ZHJea6hQNZi8hraNlJ/fyt X-Received: by 2002:a50:eb8f:: with SMTP id y15mr5986797edr.285.1622828081910; Fri, 04 Jun 2021 10:34:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622828081; cv=none; d=google.com; s=arc-20160816; b=Y1ePvvfNSbdO+ylcULirzTu229RbQSbJMu8nfS0hduJe+n6R5JHYrwM2v2AqdSSB3Q vy5Jx3D2MURidYUSlLro6kDZmSZQRX3IENguRkwHudFZ2Sd5s8Wa1NjOzDj+H6qNhEyR sJ1F/yXeHn/gd2ltsHuTflgLsEz3ufGj3WZfqwUYOocgnIHx32P/QvdTR0QTAgdkqtIp fHzd9Rm80ymn7PyBM+tYJj6oEbkcg7dBpkOliAayLrqZyQLRXVuJ2p4y+OeJkwBMc+60 5o6olCXucjo1kFnZjYH1wz1Hdr7myf2/jSqgtItT+mUswI+N0/h9/egAEeqDsF7fHJvM 1NGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=41gg7qdOvsH6Om5veZwPiSGv/Ji8drc0TudLJE6qDcY=; b=cTujcLp7edjf6HOf18RUAKzwFK/xyyUlMCElfigFvgCmR1UkllxDlghPCg3d5jaFXo lsZ1yNy3bMz+HdJi8hysR6j6BSdyD8TageP9MaITJbQi6e8skEndhg9v3vWg/XdQ9EH4 ++q0tPIyBy4XXOdRSzTgSf/4Dr+RCebvmJif/hcnHpfs78ySaqHTASkkfbG/FKyoOFeZ jMvvP9pU+twiRl9PCNzHLgEbJHRssnURvhJ/f9sjKu1c4ioL4j/hcDs47N0U4j0ZRc8e jIF6nCsneWcrTV5VD5jAWg0fdtsr858sXWi22KoPunXgkoKqbMHoz9OU4Zh+UqDVybAB H5rA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a92si5869545edf.232.2021.06.04.10.34.19; Fri, 04 Jun 2021 10:34:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230353AbhFDRc7 (ORCPT + 99 others); Fri, 4 Jun 2021 13:32:59 -0400 Received: from mga04.intel.com ([192.55.52.120]:23716 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229878AbhFDRc6 (ORCPT ); Fri, 4 Jun 2021 13:32:58 -0400 IronPort-SDR: 4wgV+ITYdVda5LkbSNsCZPB7A6U7LIgRq3T94y+AQqphsZew3w/pn4DBf+sM09m8oLvLsM5+0l DvVI7y1q+GFg== X-IronPort-AV: E=McAfee;i="6200,9189,10005"; a="202476723" X-IronPort-AV: E=Sophos;i="5.83,248,1616482800"; d="scan'208";a="202476723" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2021 10:30:59 -0700 IronPort-SDR: E6f8vel3p5Bo3KoNnpIKKX3N7n331JqiLdiBnwP8qXAgkaOWsthLpEHPipQE1fQ/cLpudqh2py spnGTxfVCyjA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,248,1616482800"; d="scan'208";a="412432857" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.171]) by fmsmga007.fm.intel.com with SMTP; 04 Jun 2021 10:30:53 -0700 Received: by stinkbox (sSMTP sendmail emulation); Fri, 04 Jun 2021 20:30:52 +0300 Date: Fri, 4 Jun 2021 20:30:52 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Werner Sembach Cc: harry.wentland@amd.com, sunpeng.li@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, airlied@linux.ie, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org Subject: Re: [PATCH 4/4] drm/i915/display: Add handling for new "active bpc" property Message-ID: References: <20210604171723.10276-1-wse@tuxedocomputers.com> <20210604171723.10276-5-wse@tuxedocomputers.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210604171723.10276-5-wse@tuxedocomputers.com> X-Patchwork-Hint: comment Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 04, 2021 at 07:17:23PM +0200, Werner Sembach wrote: > This commits implements the "active bpc" drm property for the Intel GPU driver. > > Signed-off-by: Werner Sembach > --- > drivers/gpu/drm/i915/display/intel_display.c | 13 +++++++++++++ > drivers/gpu/drm/i915/display/intel_dp.c | 8 ++++++-- > drivers/gpu/drm/i915/display/intel_dp_mst.c | 4 +++- > drivers/gpu/drm/i915/display/intel_hdmi.c | 4 +++- > 4 files changed, 25 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c > index 64e9107d70f7..f7898d9d7438 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -10164,6 +10164,8 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state) > struct drm_i915_private *dev_priv = to_i915(dev); > struct intel_crtc_state *new_crtc_state, *old_crtc_state; > struct intel_crtc *crtc; > + struct drm_connector *connector; > + struct drm_connector_state *new_conn_state; > u64 put_domains[I915_MAX_PIPES] = {}; > intel_wakeref_t wakeref = 0; > int i; > @@ -10324,6 +10326,17 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state) > } > intel_runtime_pm_put(&dev_priv->runtime_pm, state->wakeref); > > + /* Extract information from crtc to communicate it to userspace as connector properties */ > + for_each_new_connector_in_state(&state->base, connector, new_conn_state, i) { > + struct drm_crtc *crtc = new_conn_state->crtc; > + if (crtc) { > + new_crtc_state = to_intel_crtc_state(drm_atomic_get_new_crtc_state(&state->base, crtc)); intel_atomic_get_new_crtc_state() > + new_conn_state->active_bpc = new_crtc_state->pipe_bpp / 3; > + } > + else > + new_conn_state->active_bpc = 0; > + } This also seems too late. I think the whole thing should be done somewhere around the normal swap_state() stuff. > + > /* > * Defer the cleanup of the old state to a separate worker to not > * impede the current task (userspace for blocking modesets) that > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c > index 642c60f3d9b1..67826ba976ed 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp.c > +++ b/drivers/gpu/drm/i915/display/intel_dp.c > @@ -4671,10 +4671,14 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect > intel_attach_force_audio_property(connector); > > intel_attach_broadcast_rgb_property(connector); > - if (HAS_GMCH(dev_priv)) > + if (HAS_GMCH(dev_priv)) { > drm_connector_attach_max_bpc_property(connector, 6, 10); > - else if (DISPLAY_VER(dev_priv) >= 5) > + drm_connector_attach_active_bpc_property(connector, 6, 10); > + } > + else if (DISPLAY_VER(dev_priv) >= 5) { > drm_connector_attach_max_bpc_property(connector, 6, 12); > + drm_connector_attach_active_bpc_property(connector, 6, 12); > + } > > /* Register HDMI colorspace for case of lspcon */ > if (intel_bios_is_lspcon_present(dev_priv, port)) { > diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c > index 2daa3f67791e..5a1869dc2210 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c > +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c > @@ -844,8 +844,10 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo > */ > connector->max_bpc_property = > intel_dp->attached_connector->base.max_bpc_property; > - if (connector->max_bpc_property) > + if (connector->max_bpc_property) { > drm_connector_attach_max_bpc_property(connector, 6, 12); > + drm_connector_attach_active_bpc_property(connector, 6, 12); > + } > > return connector; > > diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c > index d69f0a6dc26d..8af78b27b6ce 100644 > --- a/drivers/gpu/drm/i915/display/intel_hdmi.c > +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c > @@ -2463,8 +2463,10 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c > drm_object_attach_property(&connector->base, > connector->dev->mode_config.hdr_output_metadata_property, 0); > > - if (!HAS_GMCH(dev_priv)) > + if (!HAS_GMCH(dev_priv)) { > drm_connector_attach_max_bpc_property(connector, 8, 12); > + drm_connector_attach_active_bpc_property(connector, 8, 12); > + } > } > > /* > -- > 2.25.1 -- Ville Syrj?l? Intel