From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32FF8343D6F for ; Fri, 5 Dec 2025 19:46:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764964021; cv=none; b=Zt/RqA1HNFIkoNJyQF3QjkJmq5wYukxSqaJljb9/mtahZ5RhrWnHvRvKyOYGVlYq1hlRLzWvLmLX9+Qe4fZoTOOToffIfoE02zBvFwZXRFyOYvCF/qaIOU8swuqwGEb2XBliwZv+be4itxWSM8n3/m6tNmk9MUubeb37UuutB4E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764964021; c=relaxed/simple; bh=xuNlZ52+Hs0YJk5ilMqrUrpYwKF5v6av6Y5iUKrA3ZE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=QaOlSWQibnOCbHrFt/bTDKA1YUCJd6iVlDrEXLXhKdRiG//9SNTjfNStyRl2FVE67VPIbShxuNYLFtDSs+bWB6p76/1usTk7xioHCNlD7NKYg6XtDimSEf0HiaE3pP20bteNWEe9T7n7FbGdTUzb20a4B2U1Q65VfJ+Nd7+2rYs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=SwntkSTP; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=MaFjQ6Pn; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=p3hAlw0f; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=v6YWN0p1; arc=none smtp.client-ip=195.135.223.131 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.b="SwntkSTP"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="MaFjQ6Pn"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="p3hAlw0f"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="v6YWN0p1" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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-out2.suse.de (Postfix) with ESMTPS id C8A4E5BCDA; Fri, 5 Dec 2025 19:46:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1764964017; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=paUTZsVujkIPsecJxIHfEfj9M/hje+wuMBCA2UeMtAo=; b=SwntkSTPhk7jnqCfe1fsII2j48FshRdQfsnim7RFm5EFsg6lxWNCM8IdyisTaW8jDOgSJ2 Isogu17H9kLclqHmTgFrUXFKiAZM8QXeVnTMu0rCS2XA7sEsfnagKbUuagzrYe43+ZbIdf gwPV8UxdAYYqI3UqGr3CnzX+sZURVuw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1764964017; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=paUTZsVujkIPsecJxIHfEfj9M/hje+wuMBCA2UeMtAo=; b=MaFjQ6PnlTnmQzBYawWpiBWsmmBdUrLcfEGXv0c3FVAJUEuh5YdMCs6Wwm6sz6cD5+VCiG LywC4C1tMbIH+PCQ== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=p3hAlw0f; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=v6YWN0p1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1764964015; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=paUTZsVujkIPsecJxIHfEfj9M/hje+wuMBCA2UeMtAo=; b=p3hAlw0fePlg5ZpJdXPJjutTnIqNl8710wQnlgyaYr2lDGlKWTbRhiigIqZwjAboHesvGb 4mELD6PqOawNb59PUAVnySKI1/suU/jFOZpCp2hAWPvw5GC3ocGut4yFxeBpHAP8uQiHSz sR7zT/K3rb9D344N9zYIo017K9Qc72Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1764964015; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=paUTZsVujkIPsecJxIHfEfj9M/hje+wuMBCA2UeMtAo=; b=v6YWN0p1ASJTqHiQe/Ug6E3x9FzhnjXW1Qeo0aYo6gwN/O5Q85rrzCQXPntDiZY4ndKgCC 4aiVg2YBnLYVtUCg== 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 988623EA63; Fri, 5 Dec 2025 19:46: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 56qCI682M2mIJgAAD6G6ig (envelope-from ); Fri, 05 Dec 2025 19:46:55 +0000 Message-ID: <9191ea89-81ce-4200-a356-39fa4a155062@suse.de> Date: Fri, 5 Dec 2025 20:46:55 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm/ast: Fix big-endian support To: Timothy Pearson , =?UTF-8?Q?Ren=C3=A9_Rebe?= Cc: dri-devel , linux-kernel , Dave Airlie References: <20251202.170626.2134482663677806825.rene@exactco.de> <20251205.161459.1654100040521559754.rene@exactco.de> <758090394.145092.1764959517083.JavaMail.zimbra@raptorengineeringinc.com> Content-Language: en-US From: Thomas Zimmermann Autocrypt: addr=tzimmermann@suse.de; keydata= xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB 9GluwvIhSezPgnEmimZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEB AAHNJ1Rob21hcyBaaW1tZXJtYW5uIDx0emltbWVybWFubkBzdXNlLmRlPsLAjgQTAQgAOAIb AwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBHI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OSo4V9M0jzYI4nZqTmPxYyXbm30Kvmz0rYVRaitYJ 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c= In-Reply-To: <758090394.145092.1764959517083.JavaMail.zimbra@raptorengineeringinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:url,bootlin.com:url,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:email,suse.de:dkim,suse.de:mid,lists.freedesktop.org:email,raptorengineering.com:email,gitlab.freedesktop.org:url]; TO_DN_ALL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; URIBL_BLOCKED(0.00)[suse.de:email,suse.de:dkim,suse.de:mid,suse.com:url,raptorengineering.com:email,lists.freedesktop.org:email]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spam-Level: X-Rspamd-Queue-Id: C8A4E5BCDA X-Spam-Flag: NO X-Spam-Score: -4.51 Hi Am 05.12.25 um 19:31 schrieb Timothy Pearson: > > ----- Original Message ----- >> From: "René Rebe" >> To: tzimmermann@suse.de >> Cc: "dri-devel" , "linux-kernel" , "Dave Airlie" >> , "Timothy Pearson" >> Sent: Friday, December 5, 2025 9:14:59 AM >> Subject: Re: [PATCH] drm/ast: Fix big-endian support >> Hello Thomas, >> >> On Wed, 3 Dec 2025 10:40:17 +0100, Thomas Zimmermann >> wrote: >> >>> [2] >>> https://gitlab.freedesktop.org/drm/misc/kernel/-/blob/drm-misc-next-2025-12-01-1/drivers/gpu/drm/ast/ast_mode.c?ref_type=tags#L559 >>> [3] >>> https://gitlab.freedesktop.org/drm/misc/kernel/-/blob/drm-misc-next-2025-12-01-1/drivers/gpu/drm/ast/ast_cursor.c?ref_type=tags#L209 >>> >>>> + case DRM_FORMAT_RGB565: >>>> + ast_set_index_reg_mask(ast, AST_IO_VGACRI, AST_IO_VGACRA2, 0x3f, >>>> 0x40); >>>> + break; >>>> + case DRM_FORMAT_XRGB8888 >> While working on it I discovered that the Big-Endian byte-swapping >> bits do apparently not just-work on a newer AST2400 in our Power 8 >> while my initial patch did work as tested with an AST2200 in the Sun >> T4-1 :-/ In the upcoming v6.19-rc1, ast will support per-chip quirks. So we can control this by chip version, if necessary >> >> Maybe that is what Timothy meant with "This is due to a ppc64 hardware >> quirk, which when combined with a hardware design fault in the AST2500 >> VGA controller results in a need to use software-based red-blue >> channel swapping." [1] >> >> Is there a way to simply specify the frame-buffer as BGRX8888? In a >> quick test the drm layer complaint about "not supported" and "no >> compatible format found"? > I've been all around that loop. You can't do that -- the fb code has no idea how to drive such a framebuffer, and elsewhere in the kernel it's made clear that the GPU driver *must* provide a RGBX8888 linear framebuffer if the Linux fb code is going to be able to display a console. > > Does the Sun T4 CPU perform automatic byte swapping on PCI[e] data transactions? That might be the difference; POWER performs the byte swapping, and since the ASpeed device is broken in BE mode we can't swap back by setting the BE register bit in the AST GPU hardware. > > Fun fact -- it'll sorta work on the framebuffer side, but we lose the entire control BAR in the process. ASpeed seems OK with this, they just say something along the lines of "oh, BE is not supported despite our documentation" :facepalm: On the 2400-and-onwards models, ast could set drm_device.mode_config.quirk_addfb_prefer_host_byte_order. If set, the format lookup will select a different format on BE machines. [1] For example requesting XRGB8888 returns BGRX8888 instead. If ast later sees such a format in the atomic_update code, it could transparently swap bytes when writing out pixels to the video memory.  IIRC this works transparently to DRM clients and fbcon.  I think this would be the preferred way of fixing the issue. [1] https://elixir.bootlin.com/linux/v6.18/source/drivers/gpu/drm/drm_fourcc.c#L123 For the pre-2400 chips, I suggest to fix this problem with the hardware byte swapping if possible. That seems like the correct approach. Best regards Thomas -- -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)