From nobody Sun Feb 8 22:57:14 2026 Received: from exactco.de (exactco.de [176.9.10.151]) (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 D504627700D for ; Tue, 2 Dec 2025 15:42:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=176.9.10.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764690151; cv=none; b=rRUzF2RV+2CM7evmGtVXOdH+XwhbzYbBBPbCIyaFu3udx7KRezeo7pmwwk/479IdsS5+QE41r5LRfiyeyBuLwz4BOj5wzoapPsGy0loU7a4rnWaknGfl3436ChNVuXqXiZBxyBxKJGPWaDgDX8BMF2mhaoJwSoaTU22AqiCgGB4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764690151; c=relaxed/simple; bh=+h7uBJElTTdMTq9DViIobtaZjUDnFjfdWxsxIAXhx5c=; h=Date:Message-Id:Cc:To:Subject:From:Mime-Version:Content-Type; b=gZr+EcgKrzPq6EExZ5xABKCAZpJfa8ZDVUE5RK2pKeX8/9HMna9ih89rXEhjCrYpqYL5mlVo7dghg95nSPtqZj9Mfq/RmtRtIrzVX7x8ICbgPkVaL4RC1ezTbqBcjok05vRdIQTk7H3u/KnR/7bzd+Dl/r96lp+x9sLKXFwmYdg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=exactco.de; spf=pass smtp.mailfrom=exactco.de; dkim=pass (2048-bit key) header.d=exactco.de header.i=@exactco.de header.b=fBmt28m+; arc=none smtp.client-ip=176.9.10.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=exactco.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=exactco.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=exactco.de header.i=@exactco.de header.b="fBmt28m+" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=exactco.de; s=x; h=Content-Transfer-Encoding:Content-Type:Mime-Version:From:Subject:To:Cc :Message-Id:Date:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=r4yy5wD39o8e15O2aqcJR8022NKgKo8GxG0hqIMNDs0=; b=f Bmt28m+yrtY3uwB5IIUp6MZiY4EWZNCLdNczaJ0otXE9fvQUAuu5JScQxemSgz6v5vyb+lsiPW5Cn JOniydczidthVMMYnH5+fC8xN1/rNgpElUSUdaK7RX1u5l95B3FYlW0G7xwL/r8eDK6eqZVdFaPWr 0fjs507SV5UenYw/w16Elg3VHHddtAllxSEcmhZXmJoemGsCS+H62V0M/b0XJT2bV5Y2JZocGxLWI ivODYCUcuJQpDSkpYPzb46KKJPFbHthnGnT50dPQzcrOT1vi/WkGvQEI9t9JucG2qEqvrtjNgvV7H UmA9NS1M/ciNVRNjk9+Z4Kr4OjQfP3GxQ==; Date: Tue, 02 Dec 2025 16:42:28 +0100 (CET) Message-Id: <20251202.164228.1439289308743755090.rene@exactco.de> Cc: Dave Airlie , Thomas Zimmermann To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/mgag200: fix big-endian support From: =?iso-8859-1?Q?Ren=E9?= Rebe X-Mailer: Mew version 6.10 on Emacs 30.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Unlike the original deleted Matrox mga driver, the new mgag200 driver has the frame-buffer RGBX swapped on big-endian RISC systems. Fix by enabling byte swapping "PowerPC" OPMODE for any __BIG_ENDIAN config. Fixes: 414c45310625 ("mgag200: initial g200se driver (v2)") Signed-off-by: Ren=C3=A9 Rebe --- Tested on IBM 43p Model 150 (7043-150) running T2/Linux. --- drivers/gpu/drm/mgag200/mgag200_mode.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag2= 00/mgag200_mode.c index 951d715dea30..9073063f6473 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -655,6 +655,20 @@ void mgag200_crtc_helper_atomic_enable(struct drm_crtc= *crtc, struct drm_atomic_ else mgag200_crtc_fill_gamma(mdev, format); =20 +#ifdef __BIG_ENDIAN + /* Big-endian byte-swapping */ + switch (format->format) { + case DRM_FORMAT_RGB565: + WREG32(MGAREG_OPMODE, 1 << 16); + break; + case DRM_FORMAT_XRGB8888: + WREG32(MGAREG_OPMODE, 2 << 16); + break; + default: + break; + } +#endif + mgag200_enable_display(mdev); } =20 --=20 2.46.0 --=20 Ren=C3=A9 Rebe, ExactCODE GmbH, Berlin, Germany https://exactco.de =E2=80=A2 https://t2linux.com =E2=80=A2 https://patreon.= com/renerebe