Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1284710pxj; Fri, 4 Jun 2021 10:20:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydse/hllEBUCwXBQ9ki8M9Eo5Hs054eY5VWPWtQ8aIcM08oq6K+Qu24B+TsfpG4AOmr/qT X-Received: by 2002:a17:906:6bd8:: with SMTP id t24mr5285987ejs.501.1622827224832; Fri, 04 Jun 2021 10:20:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622827224; cv=none; d=google.com; s=arc-20160816; b=zhTPiT4Se9mOaQkIfiRkHGukkE0WjmdjmcYGbTAebmTqPQX9Pw+HFTF4QBqB43KNqv IbfrVWkFbwr31f5IW4y2Xu99o7CJPFhRxYUvZqb5PJlNSF2KsKEe/YpAtaQk2J8m7npq PJh/t+Z5FbhycZt9uPbfeI2QV9FE1P4us0orVJQhI5MZyDNrcIqVm8L4ve6n2uhLhOEO IAtZ4JfYqocFDOcIuimBgm0T29ddG7ck7hiusLEJiUvNcfffaSswIbs7yEwP0PNDwapt K3OcvAhKCXC3iOYqTd1woOK3j215f4CqSdQGMdiFLrw/9Fx5/LxdH6NgUJ8i/9JCzFBx JHzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=c8ojIFOis3ZNxjzkkarF5Inkb1+rS27IQ4UmL3h+UBM=; b=SG3xT1lRaD+F1oIyplR2E6jfMLdOymeiNoXGHrJB1h5ExtwUcwbOq2OBXZBlXHNOdi 8347VWNZno8C2szUO1mr9zSfnWiSLDfvmOjmYDYWdalr5GvHyWmwJN0FThr94HbY5H8e yWBcJntsk6//Rm9BzBPmwj9qOxlxQfzrf5OeN7YGLbjgH0dOUSIb0Q79DwHpRVcNRVu9 bXrowP44kiS+BO1qJE24Kl8bW7t0iEvHoxXGse/tGeDWG0uqeQqqs5JGAnJrscRF5SHM VzcnUUnnJs2R9uff4aGBlarJXcu+UfqQ6bWJJi/exWjeXihEuoUPo9FF/RwQlqlt6tBo rirA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d5si4934465ejo.627.2021.06.04.10.20.00; Fri, 04 Jun 2021 10:20:24 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229675AbhFDRT1 (ORCPT + 99 others); Fri, 4 Jun 2021 13:19:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230132AbhFDRTZ (ORCPT ); Fri, 4 Jun 2021 13:19:25 -0400 Received: from srv6.fidu.org (srv6.fidu.org [IPv6:2a01:4f8:231:de0::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02B19C061766 for ; Fri, 4 Jun 2021 10:17:38 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by srv6.fidu.org (Postfix) with ESMTP id 8D2CCC800C5; Fri, 4 Jun 2021 19:17:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at srv6.fidu.org Received: from srv6.fidu.org ([127.0.0.1]) by localhost (srv6.fidu.org [127.0.0.1]) (amavisd-new, port 10026) with LMTP id NqAaINQezYQO; Fri, 4 Jun 2021 19:17:36 +0200 (CEST) Received: from wsembach-tuxedo.fritz.box (p200300E37f2e2a0038b625C68b541A92.dip0.t-ipconnect.de [IPv6:2003:e3:7f2e:2a00:38b6:25c6:8b54:1a92]) (Authenticated sender: wse@tuxedocomputers.com) by srv6.fidu.org (Postfix) with ESMTPA id 2DDD3C800C7; Fri, 4 Jun 2021 19:17:36 +0200 (CEST) From: Werner Sembach To: 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 Cc: Werner Sembach Subject: [PATCH 3/4] drm/amd/display: Add handling for new "active bpc" property Date: Fri, 4 Jun 2021 19:17:22 +0200 Message-Id: <20210604171723.10276-4-wse@tuxedocomputers.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604171723.10276-1-wse@tuxedocomputers.com> References: <20210604171723.10276-1-wse@tuxedocomputers.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commits implements the "active bpc" drm property for the AMD GPU driver. Signed-off-by: Werner Sembach --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 18 +++++++++++++++++- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 4 +++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 6e82889271d5..52a057c585b1 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -7519,8 +7519,10 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, adev->mode_info.underscan_vborder_property, 0); - if (!aconnector->mst_port) + if (!aconnector->mst_port) { drm_connector_attach_max_bpc_property(&aconnector->base, 8, 16); + drm_connector_attach_active_bpc_property(&aconnector->base, 8, 16); + } /* This defaults to the max in the range, but we want 8bpc for non-edp. */ aconnector->base.state->max_bpc = (connector_type == DRM_MODE_CONNECTOR_eDP) ? 16 : 8; @@ -8890,6 +8892,20 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) mutex_unlock(&dm->dc_lock); } + /* Extract information from crtc to communicate it to userspace as connector properties */ + for_each_new_connector_in_state(state, connector, new_con_state, i) { + struct drm_crtc *crtc = new_con_state->crtc; + if (crtc) { + new_crtc_state = drm_atomic_get_new_crtc_state(state, crtc); + dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); + if (dm_new_crtc_state->stream) + new_con_state->active_bpc = convert_dc_color_depth_into_bpc( + dm_new_crtc_state->stream->timing.display_color_depth); + } + else + new_con_state->active_bpc = 0; + } + /* Count number of newly disabled CRTCs for dropping PM refs later. */ for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index 9b221db526dc..2a8dc6b2c6c7 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -397,8 +397,10 @@ dm_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr, } connector->max_bpc_property = master->base.max_bpc_property; - if (connector->max_bpc_property) + if (connector->max_bpc_property) { drm_connector_attach_max_bpc_property(connector, 8, 16); + drm_connector_attach_active_bpc_property(&aconnector->base, 8, 16); + } connector->vrr_capable_property = master->base.vrr_capable_property; if (connector->vrr_capable_property) -- 2.25.1