Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp566102pxj; Thu, 10 Jun 2021 07:33:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMm6m+kfhfYcjZLG4R3Vpu7/1Fvme095BJQlyopCaf/pax1DOueP0xR0jnaVCWXY6F5h9P X-Received: by 2002:aa7:ce82:: with SMTP id y2mr5201034edv.264.1623335582511; Thu, 10 Jun 2021 07:33:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623335582; cv=none; d=google.com; s=arc-20160816; b=JKZxOnsnnQHLxDiQEcgjcGMI6rdPguIMja2F8cFaZq5YKf1I2w3wEJosCcsSvzKfEL 0BHtO+1SNwIF0CB/uaMs/aFHeDFQe+a7mM7h+LI+kWaYf91ZlaJfup5IVVoVB1WKyeV4 Tls03B1Qc0TJwFRaOoiH+Xf7nYpAz6pxR9tiTIYRtuO6U0LbaFWGydcCAbnIB+fc6Lsc 3wbG+mQWSJN3kd7S9jj940qg3XTZQYHH+SXk9w/aShCRbHwpDJAkvloztf5sRV5px4VF oqpjUQO381jfUvt0ggwurIvJ8Q84uCTFqtPGRtrP99D6x617jzHv0GKvvvXeLF3p88yn E4YQ== 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=lKGlx9mgqdkE+YO3D1y/tDBhNf0yjrO8MrGhJ9L2mWg=; b=bp7RL4vxyfreya2nj1cCMkYp3aGSn5cCdNxERE42J5e7pmijKdkLQlrTdy0+i2Bk4l qNgBafxNlwH/dHrwedMAKm9DX/JRv5+QV0HsqO3M2UXIJnVVSD0wg5yY3lWqBP+92w4s sBu0TnXWW5K2Hr5PfckCiaPU665FzRlH0b+bb2+wKFt/YqoP6ileozvnH7rVgPW107mq YdM+Jb/9xXxAK09cgOgrBonbIC1rf6BjgBUXOnNvcqeH+3Mz6i2cjmvGgFr3Gsj6dvqR 3Cw19zNkrjyepGkA3UvQTxJIRwP+lZSZkfhagDYcwzmgwS9M9dA8Le3auyvFy3tKBAa2 eRVA== 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 ck12si2212750edb.107.2021.06.10.07.32.38; Thu, 10 Jun 2021 07:33:02 -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 S231320AbhFJObz (ORCPT + 99 others); Thu, 10 Jun 2021 10:31:55 -0400 Received: from mga04.intel.com ([192.55.52.120]:11728 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230406AbhFJObz (ORCPT ); Thu, 10 Jun 2021 10:31:55 -0400 IronPort-SDR: dnnxobe61lALNh83QG0iBuvBELJMkdTxUSVTF5eGSG5KTGG4SKJ43vHekrfoVXX1YhzRaIopJ8 tK70qnkgdBLQ== X-IronPort-AV: E=McAfee;i="6200,9189,10011"; a="203461898" X-IronPort-AV: E=Sophos;i="5.83,263,1616482800"; d="scan'208";a="203461898" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2021 07:29:58 -0700 IronPort-SDR: CqbxeVTzHSnV4mW82zmiqTzAQw4SyA7B/76zpUXzQnUE6QC1QDpmbU9GAm7vCNgeujLfxXY/iE sK0JzxoJquPA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,263,1616482800"; d="scan'208";a="441234105" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.171]) by orsmga007.jf.intel.com with SMTP; 10 Jun 2021 07:29:53 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 10 Jun 2021 17:29:52 +0300 Date: Thu, 10 Jun 2021 17:29:52 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Werner Sembach Cc: amd-gfx@lists.freedesktop.org, tzimmermann@suse.de, sunpeng.li@amd.com, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, rodrigo.vivi@intel.com, alexander.deucher@amd.com, christian.koenig@amd.com 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> <96d10ed0-f8a2-1d0b-62dd-9d6173722506@tuxedocomputers.com> <210b4108-74a7-bf42-eab8-b98239ce3f1a@tuxedocomputers.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <210b4108-74a7-bf42-eab8-b98239ce3f1a@tuxedocomputers.com> X-Patchwork-Hint: comment Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 08, 2021 at 07:19:31PM +0200, Werner Sembach wrote: > > Am 07.06.21 um 22:33 schrieb Werner Sembach: > > Am 07.06.21 um 08:47 schrieb Werner Sembach: > >> > >> Am 04.06.21 um 19:30 schrieb Ville Syrj?l?: > >>> 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() > >> Thanks, will use that. > >>> > >>>> + 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. > >> Ok, will look into it. > > So I tried to put it in intel_atomic_commit() after > > drm_atomic_helper_swap_state() and before > > INIT_WORK(&state->base.commit_work, intel_atomic_commit_work) (which > > creates a worker for intel_atomic_commit_tail), but somewhere in > > between, the connector_state seems to change: The bpc written with the > > for_each_new_connector_in_state() loop, gets discarded. > > This was not the problem. Setting the drm property immutable made it > (also?) immutable from the driver context, which I didn't test separately. > > Removed the immutable again and moved the loop. Immutable props are special. See __drm_object_property_get_value(). -- Ville Syrj?l? Intel