From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B40338AC72; Wed, 22 Apr 2026 16:49:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776876599; cv=none; b=sfceP4kqpdu6EzCYm4Wu46ckU6rcasbfAxLytIh21zkOcrj17Sgtpdfh1CLGG4vzCy0BdgRXRklpJSh6O531V0YAbXz78u7Z1q8z3e/r6KZypw/gVTGYHH6YGzd8RF0aFJmr3HI3LrGqk0Nveq1R8isdwoaEEiTWIiOLDQws/OE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776876599; c=relaxed/simple; bh=nTfe/Au79B3cfP0zvUMQ3JhTvvVkQBcmsLcztjsxZi4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TpRwUWpSyDl+ih3kDvg/jiosjcWrjVS6XhMLAR+ZCzPf0rV+2C67mn8H+nGrGXplB3w3EwcJ67IE2KtoPZsB3FDmQb/GC0lZDDWNLX1S2deOdy/cTgxKD7f6ITIeVw7DPvdha5R0fQaCn38OnK/d1G2wGLE00CFgCPV2afFKN+Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=wB9a9hPc; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="wB9a9hPc" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 067741A33AB; Wed, 22 Apr 2026 16:49:55 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id CECA45FA8F; Wed, 22 Apr 2026 16:49:54 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id ED12310460BF3; Wed, 22 Apr 2026 18:49:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1776876593; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=bS5tvGPU8YoGSDlKi+8QteFnA/DpeG9M3mcprRbVAl8=; b=wB9a9hPcUQVmgZHYZeBxhYeFYSWWNcZEhxaU66LpQYQ2FZaw4EezXGjUdFsn5PZHTw7g5N pg/MkmO5i+dNp19nHSa/yp2CAYJCrzupe009b/H8Kz5JfVWYv83Y3PNXkYOeuxuivyRC+s TxqIaor24rMN2HWbanp1MHKffx1jtsli5sP64G/gaZku4ITscrXUU0y6F/1xdNbF4ou47R Sxd3AvbLaAIHRpC2Qgv7NsDbgjTdUBQQjcDCHuiJxGlozlL7P4G33AtU/tc5MrIpeplwj7 VDSw7IYd/EZ58AzykOEoPRlScT5SjM7WMHizmkJvfFm4EX/lgw341ZvGAo8hvw== From: Louis Chauvet Date: Wed, 22 Apr 2026 18:48:20 +0200 Subject: [PATCH v4 23/37] drm/vkms: Properly render plane using their zpos Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260422-vkms-all-config-v4-23-dbb52e9aadc3@bootlin.com> References: <20260422-vkms-all-config-v4-0-dbb52e9aadc3@bootlin.com> In-Reply-To: <20260422-vkms-all-config-v4-0-dbb52e9aadc3@bootlin.com> To: Haneen Mohammed , Simona Vetter , Melissa Wen , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , jose.exposito89@gmail.com, Jonathan Corbet , Shuah Khan , Miguel Ojeda , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt Cc: victoria@system76.com, sebastian.wick@redhat.com, victoria@system76.com, airlied@gmail.com, thomas.petazzoni@bootlin.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Louis Chauvet , llvm@lists.linux.dev, Luca Ceresoli X-Mailer: b4 0.16-dev X-Last-TLS-Session-Version: TLSv1.3 Currently planes are rendered in creation order. This is not an issue, but with the introduction of new zpos configuration, it is required to properly render planes. Reviewed-by: Luca Ceresoli Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_crtc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c index 35ddc553a5e6..faaa13f8b31e 100644 --- a/drivers/gpu/drm/vkms/vkms_crtc.c +++ b/drivers/gpu/drm/vkms/vkms_crtc.c @@ -142,14 +142,20 @@ static int vkms_crtc_atomic_check(struct drm_crtc *crtc, return -ENOMEM; vkms_state->num_active_planes = i; - i = 0; + ret = drm_atomic_normalize_zpos(crtc->dev, state); + if (ret) + return ret; + drm_for_each_plane_mask(plane, crtc->dev, crtc_state->plane_mask) { plane_state = drm_atomic_get_new_plane_state(crtc_state->state, plane); if (!plane_state->visible) continue; - vkms_state->active_planes[i++] = + // Order planes according to their normalized_zpos + // After drm_atomic_normalize_zpos, the possible values are 0..n_planes-1 + // so store them using this index + vkms_state->active_planes[plane_state->normalized_zpos] = to_vkms_plane_state(plane_state); } -- 2.54.0