Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794924486; b=qAanw8NcIpQnjY9K8FKcoOaZjZnYIVpJdSV2IOTvX8j3JDSR36ffxc/LQyDEoaCVx53c oZbsmIQmdyrHvfLssQ5wBnfiyp7FKugznDpCncxVI2jM/ANcaRPij4YgClrX/X7ZAZaQL cSeZ67IiLThntADlqcB/W3mHH7lSjt/AsrY0tnQi8fZSJzJFeD7PbX+JeVz0jRZXrsrpw AOeS2ljbWOH6YkKiNdoRM1/O3zXyrPmGjBNSWR9+zagEre8Wd+ZZcd27aewOMyoC+1gMf NmIIed/UupYplMRgZxBNr00Gs8ZvlIK341aL6TkChO9EAucLN1YXiHPtBa1E+pFaRhA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794924486; h=DMARC-Filter:Received:DKIM-Signature:DKIM-Signature:DKIM-Signature: DKIM-Signature:Received:Received:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Spam-Flag:X-Spam-Level:X-Spamd-Result: X-Spam-Score; bh=zRYxNVc6VpxQnsLl7TcWwh6p+D/yRymb9n4mW81rXsc=; b=mx+ZdoQthLzP16EyYJmDyH/AK0/9CTEAVblbqqHLI1V57ffeEueWaZqyLAlPLVBhcTpU 92TYTFQUQNaTOqUpt3GFeWog+YDixD4/wwC15Suotmbkc4CYsMC0LT1riEKM4U3f51JMT itiIfvo+G1ytBKl0Ufo2kWuEQMp9b2QiIc92MKrGNkeWPIVIIva+H5dHvspnU9XoMeYpW KfZTHexSEwIb8BOrMhVlVGSGGl+BkVk0L5+qswy9s4esHV501DY9IoIRH8MVcMmXFesDp ZHd5/ppc+ytLiOf6xeVqRd3jkTW+0DfX3bU/C41NjbJWb1QIzt+yS5bWfuyNNL8DrFA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=kTZQcZaR; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=uWThAy+D; dkim=pass header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=kTZQcZaR; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=uWThAy+D; arc=none smtp.remote-ip=195.135.223.130 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 555D6606A31C for ; Tue, 17 Nov 2026 14:08:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 555D6606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=kTZQcZaR; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=uWThAy+D; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=kTZQcZaR; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=uWThAy+D Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 506D222270; Tue, 17 Nov 2026 14:07:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1794924476; h=from:from:reply-to: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=zRYxNVc6VpxQnsLl7TcWwh6p+D/yRymb9n4mW81rXsc=; b=kTZQcZaRcU9W9hkta0lWgdlJcnwyIbzp+ksgfl0JAF645AffTBWv9uF9Tvjp4Jc6/+B35k IkCyDeuwKHkB+xmSOq4oboq5NOQ/82h2uq9oMsLRgfO2xgkOWoUVbPKY+STVRnCQ71Xvbv lmW1+zh0CiqRtgCZ+Lk6zG10CgBKnoY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1794924476; h=from:from:reply-to: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=zRYxNVc6VpxQnsLl7TcWwh6p+D/yRymb9n4mW81rXsc=; b=uWThAy+DSNnak+hgQ2/QXy2ulD/kXzfWN3kdImKKS27S7JBbul8q4ZicUNAUmJctYHifg0 ++mcodD7N/kHwGDw== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1794924476; h=from:from:reply-to: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=zRYxNVc6VpxQnsLl7TcWwh6p+D/yRymb9n4mW81rXsc=; b=kTZQcZaRcU9W9hkta0lWgdlJcnwyIbzp+ksgfl0JAF645AffTBWv9uF9Tvjp4Jc6/+B35k IkCyDeuwKHkB+xmSOq4oboq5NOQ/82h2uq9oMsLRgfO2xgkOWoUVbPKY+STVRnCQ71Xvbv lmW1+zh0CiqRtgCZ+Lk6zG10CgBKnoY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1794924476; h=from:from:reply-to: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=zRYxNVc6VpxQnsLl7TcWwh6p+D/yRymb9n4mW81rXsc=; b=uWThAy+DSNnak+hgQ2/QXy2ulD/kXzfWN3kdImKKS27S7JBbul8q4ZicUNAUmJctYHifg0 ++mcodD7N/kHwGDw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id DA2CB134B8; Tue, 17 Nov 2026 14:07:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id lIVaDrtf/GpTJgAAD6G6ig:T2 (envelope-from ); Tue, 17 Nov 2026 14:07:55 +0000 From: Thomas Zimmermann To: alexander.deucher@amd.com, christian.koenig@amd.com, airlied@gmail.com, simona@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, sashiko-reviews@lists.linux.dev, Thomas Zimmermann Subject: [PATCH v3 1/2] drm/radeon: Inline drm_crtc_init() Date: Tue, 17 Nov 2026 15:04:29 +0100 Message-ID: <20261117140750.541769-2-tzimmermann@suse.de> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261117140750.541769-1-tzimmermann@suse.de> References: <20261117140750.541769-1-tzimmermann@suse.de> X-Mailing-List: sashiko-reviews@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Flag: NO X-Spam-Level: X-Spamd-Result: default: False [-11.80 / 50.00]; SUSE_INTERNAL_BYPASS(-9.00)[]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_TO(0.00)[amd.com,gmail.com,ffwll.ch,linux.intel.com,kernel.org]; ARC_NA(0.00)[]; RCPT_COUNT_SEVEN(0.00)[10]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[suse.de:email,imap1.dmz-prg2.suse.org:helo]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com] X-Spam-Score: -11.80 Inline drm_crtc_init() into radeon CRTC initialization. The helper is only used by radeon to implement legacy mode setting. As in drm_crtc_init(), create a primary plane for the CRTC. Use the same formats as with drm_crtc_init(). Format modifiers are still marked as unsupported and handled internally by the plane. For the CRTC, call drm_crtc_init_with_planes() for initialization. Clean up on errors. Radeon does not support DRM panic helpers. Therefore do not initialize the primary plane's panic-helper callbacks. v3: - keep plane->format_default for now v2: - add missing formats for primary plane Signed-off-by: Thomas Zimmermann Acked-by: Maxime Ripard --- drivers/gpu/drm/radeon/radeon_display.c | 53 +++++++++++++++++++++---- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index aac6733ddd82..2bc66b9ad121 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -47,6 +48,17 @@ #include "radeon.h" #include "radeon_kms.h" +static const u32 radeon_primary_plane_formats[] = { + DRM_FORMAT_XRGB8888, + DRM_FORMAT_ARGB8888, +}; + +static const struct drm_plane_funcs radeon_primary_plane_funcs = { + .update_plane = drm_plane_helper_update_primary, + .disable_plane = drm_plane_helper_disable_primary, + .destroy = drm_plane_helper_destroy, +}; + static void avivo_crtc_load_lut(struct drm_crtc *crtc) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); @@ -680,20 +692,37 @@ static const struct drm_crtc_funcs radeon_crtc_funcs = { static void radeon_crtc_init(struct drm_device *dev, int index) { struct radeon_device *rdev = dev->dev_private; + struct drm_plane *primary; struct radeon_crtc *radeon_crtc; + int ret; - radeon_crtc = kzalloc_obj(*radeon_crtc); - if (radeon_crtc == NULL) + primary = __drm_universal_plane_alloc(dev, sizeof(*primary), 0, 0, + &radeon_primary_plane_funcs, + radeon_primary_plane_formats, + ARRAY_SIZE(radeon_primary_plane_formats), + NULL, DRM_PLANE_TYPE_PRIMARY, NULL); + if (IS_ERR(primary)) return; + /* + * TODO: Announce the correct formats and remove the format_default + * field from struct drm_plane. + */ + primary->format_default = true; + + radeon_crtc = kzalloc_obj(*radeon_crtc); + if (!radeon_crtc) + goto err_drm_plane_cleanup; + radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc", WQ_HIGHPRI | WQ_PERCPU, 0); - if (!radeon_crtc->flip_queue) { - kfree(radeon_crtc); - return; - } + if (!radeon_crtc->flip_queue) + goto err_kfree; - drm_crtc_init(dev, &radeon_crtc->base, &radeon_crtc_funcs); + ret = drm_crtc_init_with_planes(dev, &radeon_crtc->base, primary, NULL, + &radeon_crtc_funcs, NULL); + if (ret) + goto err_destroy_workqueue; drm_mode_crtc_set_gamma_size(&radeon_crtc->base, 256); radeon_crtc->crtc_id = index; @@ -713,6 +742,16 @@ static void radeon_crtc_init(struct drm_device *dev, int index) radeon_atombios_init_crtc(dev, radeon_crtc); else radeon_legacy_init_crtc(dev, radeon_crtc); + + return; + +err_destroy_workqueue: + destroy_workqueue(radeon_crtc->flip_queue); +err_kfree: + kfree(radeon_crtc); +err_drm_plane_cleanup: + drm_plane_cleanup(primary); + kfree(primary); } static const char *encoder_names[38] = { -- 2.56.0