Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2235743ybk; Mon, 11 May 2020 15:46:53 -0700 (PDT) X-Google-Smtp-Source: APiQypI6dJQ4k5AmcRqQu+/yPoX57Kelr0o0nLZa+5UTZTYC/zg2064pjsWWowAdvKbfktZ9xfFr X-Received: by 2002:a17:906:687:: with SMTP id u7mr14638347ejb.149.1589237213533; Mon, 11 May 2020 15:46:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589237213; cv=none; d=google.com; s=arc-20160816; b=rbF80qXfCwc5BGlBuB/Pw0np+K2UyRUpVgfBimeN0I9C6QYrFv5SC2G64bQy/0yjG/ eP7Zb3/D7EzSIeJOHb+Ig8rBnYjebT+WmQbbUIzBv4Tis3jvmDCSbQrY40fFUNiinicf 45VK2KLy2deSCSocJ6ojmZiF9nxNBfFE49WxhB12CEitipc8YVWV5cGH0UfAnSivo3xz g3tN1UuZcEdkWw3i6qnQnPFahL0w0S9bt6/md1Pv5QH5o28fVPc96P7qkIHErC4hC1an YDeSVa9XzPmiUSrOACGN+yAXp5f+jcJlmQD+Rv9qE44VcaziqIdT2FA5Ex2FYn/1rKj2 pBiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2CFJqLqwxwm/YiCehI/vMQMvMy9CLDJuBp2YttHeyzg=; b=GqEj1TWQINad3zr7VSZ2f9LOo0lLCjRBkWTF2JTriBzyZRX3ZPFjaVtDg07pjXkbcG wmfI+sIdJh0E58mlf/G0q3S/YmZ5EbN/UxAMVvwZJocF3kjZ6rP/fPELUlZF5SPtkQUS 6LJe78mWEvilk7HJ74exXE4bNwQ87bWpRnEv/0adER+F/xKzI1dJg69Lq2dt0dvr09Go vtAS++A2ddRiSJz7YRR+FNHHYBRtOhnfsnluLXSH2JYnp/CE8IJmj0jzMUIuvC1JjIAe VjScUpzzYN/Jf9ZMwfODSvvDgd8OmPr9TdHbDEvzA8UxPyzk/J1wXg7+wGci06fyRJxI +eow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JyoH2lK3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u25si4027081ejr.1.2020.05.11.15.46.30; Mon, 11 May 2020 15:46:53 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JyoH2lK3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727867AbgEKWmt (ORCPT + 99 others); Mon, 11 May 2020 18:42:49 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:32471 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725836AbgEKWms (ORCPT ); Mon, 11 May 2020 18:42:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589236967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2CFJqLqwxwm/YiCehI/vMQMvMy9CLDJuBp2YttHeyzg=; b=JyoH2lK3CaoICBCTqttX9t8KqvyT5pOV19EUAWbZZhve5Xm8LQSxt8v6IwhtUv0qCaG9U3 UkQ3ZMw36Vl2xSyxENVdbysrQq/zgG/qjwcP/mtQJiyYaZI5Kzpuc0YP+zO2BMZ5hXXxK8 InAe0q8v60rXX3TtwJbH/EVR5YlpPDo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-378-6w2qJPSPORGvVI8ZmcNusw-1; Mon, 11 May 2020 18:42:41 -0400 X-MC-Unique: 6w2qJPSPORGvVI8ZmcNusw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2AF4E8005AD; Mon, 11 May 2020 22:42:40 +0000 (UTC) Received: from Whitewolf.redhat.com (ovpn-117-238.rdu2.redhat.com [10.10.117.238]) by smtp.corp.redhat.com (Postfix) with ESMTP id F273977F2E; Mon, 11 May 2020 22:42:38 +0000 (UTC) From: Lyude Paul To: nouveau@lists.freedesktop.org Cc: Ben Skeggs , David Airlie , Daniel Vetter , Alex Deucher , Sean Paul , Pankaj Bharadiya , Takashi Iwai , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/5] drm/nouveau/kms/nv50-: Move 8BPC limit for MST into nv50_mstc_get_modes() Date: Mon, 11 May 2020 18:41:26 -0400 Message-Id: <20200511224148.598468-5-lyude@redhat.com> In-Reply-To: <20200511224148.598468-1-lyude@redhat.com> References: <20200511224148.598468-1-lyude@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This just limits the BPC for MST connectors to a maximum of 8 from nv50_mstc_get_modes(), instead of doing so during nv50_msto_atomic_check(). This doesn't introduce any functional changes yet (other then userspace now lying about the max bpc, but we can't support that yet anyway so meh). But, we'll need this in a moment so that we can share mode validation between SST and MST which will fix some real world issues. Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index f67dffe8c005..c49a6c47c66f 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -904,15 +904,9 @@ nv50_msto_atomic_check(struct drm_encoder *encoder, if (!state->duplicated) { const int clock = crtc_state->adjusted_mode.clock; - /* - * XXX: Since we don't use HDR in userspace quite yet, limit - * the bpc to 8 to save bandwidth on the topology. In the - * future, we'll want to properly fix this by dynamically - * selecting the highest possible bpc that would fit in the - * topology - */ - asyh->or.bpc = min(connector->display_info.bpc, 8U); - asyh->dp.pbn = drm_dp_calc_pbn_mode(clock, asyh->or.bpc * 3, false); + asyh->or.bpc = connector->display_info.bpc; + asyh->dp.pbn = drm_dp_calc_pbn_mode(clock, asyh->or.bpc * 3, + false); } slots = drm_dp_atomic_find_vcpi_slots(state, &mstm->mgr, mstc->port, @@ -1072,8 +1066,17 @@ nv50_mstc_get_modes(struct drm_connector *connector) if (mstc->edid) ret = drm_add_edid_modes(&mstc->connector, mstc->edid); - if (!mstc->connector.display_info.bpc) - mstc->connector.display_info.bpc = 8; + /* + * XXX: Since we don't use HDR in userspace quite yet, limit the bpc + * to 8 to save bandwidth on the topology. In the future, we'll want + * to properly fix this by dynamically selecting the highest possible + * bpc that would fit in the topology + */ + if (connector->display_info.bpc) + connector->display_info.bpc = + clamp(connector->display_info.bpc, 6U, 8U); + else + connector->display_info.bpc = 8; if (mstc->native) drm_mode_destroy(mstc->connector.dev, mstc->native); -- 2.26.2