From nobody Mon Feb 9 06:51:04 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1564451842; cv=none; d=zoho.com; s=zohoarc; b=AwOip7IW0soexf6RhEv9fCIclUkU1d0BNJnEgWXnCID+O0F+ga1bjmtom0QhM90Wrj15O62JNH6exA+VQ4mfV3dYyLcwbUWokiQ+nMy5smz6K5cr+obz8FbmZLIuRO+mGSfWtFtnEt2W4t7QGfEbFmW9vFJ3h1ReAJkiqv4Nf2w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564451842; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=0UI5AtfVZFh4cix6aH7rPbXbP6MtOGZtcw8hyt4P+mk=; b=Lpovrjt5aZIAsIdjkZACQTnro4uOpQifd3IOupbQb4qzfnryCjMaf9yIBHsZBdUGMVVRbcgSNmaZ4kdb+lxBaG7fOMNONhBFLkJz9XA1etAUOVup0Fs4p8CkbpYIH1UELG15r/JpgbxB8nAYOUHODDcvpn6BT8j7CDdUDQ5pIfo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1564451842845185.94072993745579; Mon, 29 Jul 2019 18:57:22 -0700 (PDT) Received: from localhost ([::1]:57462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsHNz-00086R-AJ for importer@patchew.org; Mon, 29 Jul 2019 21:57:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42890) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsHNN-0007cJ-Qg for qemu-devel@nongnu.org; Mon, 29 Jul 2019 21:56:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsHNM-0000jB-QW for qemu-devel@nongnu.org; Mon, 29 Jul 2019 21:56:29 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:22716) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hsHNM-0000h4-GY for qemu-devel@nongnu.org; Mon, 29 Jul 2019 21:56:28 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id EE6F87456E3; Tue, 30 Jul 2019 03:56:15 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 59D897456E0; Tue, 30 Jul 2019 03:56:15 +0200 (CEST) Message-Id: <5778864958ee7bcaec1c77eed8e40c9e07ed6784.1564451616.git.balaton@eik.bme.hu> From: BALATON Zoltan Date: Tue, 30 Jul 2019 03:53:36 +0200 MIME-Version: 1.0 To: qemu-devel@nongnu.org Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:738:2001:2001::2001 Subject: [Qemu-devel] [PATCH] ati-vga: Add limited support for big endian frame buffer aperture X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Set frame buffer endianness according to requested endianness for frame buffer aperture 0. This fixes inverted colors with Xorg frame buffer driver. Setting endianness of aperture 1 and reg aperture are not implemented. Signed-off-by: BALATON Zoltan --- hw/display/ati.c | 9 ++++++++- hw/display/ati_int.h | 1 + hw/display/ati_regs.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/display/ati.c b/hw/display/ati.c index d1db07dd2f..84961d193f 100644 --- a/hw/display/ati.c +++ b/hw/display/ati.c @@ -90,7 +90,8 @@ static void ati_vga_switch_mode(ATIVGAState *s) DPRINTF("Switching to %dx%d %d %d @ %x\n", h, v, stride, bpp, = offs); vbe_ioport_write_index(&s->vga, 0, VBE_DISPI_INDEX_ENABLE); vbe_ioport_write_data(&s->vga, 0, VBE_DISPI_DISABLED); - s->vga.big_endian_fb =3D false; + s->vga.big_endian_fb =3D (s->regs.config_cntl & APER_0_ENDIAN ? + true : false); /* reset VBE regs then set up mode */ s->vga.vbe_regs[VBE_DISPI_INDEX_XRES] =3D h; s->vga.vbe_regs[VBE_DISPI_INDEX_YRES] =3D v; @@ -311,6 +312,9 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, = unsigned int size) case PALETTE_DATA: val =3D vga_ioport_read(&s->vga, VGA_PEL_D); break; + case CNFG_CNTL: + val =3D s->regs.config_cntl; + break; case CNFG_MEMSIZE: val =3D s->vga.vram_size; break; @@ -605,6 +609,9 @@ static void ati_mm_write(void *opaque, hwaddr addr, data >>=3D 8; vga_ioport_write(&s->vga, VGA_PEL_D, data & 0xff); break; + case CNFG_CNTL: + s->regs.config_cntl =3D data; + break; case CRTC_H_TOTAL_DISP: s->regs.crtc_h_total_disp =3D data & 0x07ff07ff; break; diff --git a/hw/display/ati_int.h b/hw/display/ati_int.h index 31a1927b3e..5b4d3be1e6 100644 --- a/hw/display/ati_int.h +++ b/hw/display/ati_int.h @@ -39,6 +39,7 @@ typedef struct ATIVGARegs { uint32_t gpio_vga_ddc; uint32_t gpio_dvi_ddc; uint32_t gpio_monid; + uint32_t config_cntl; uint32_t crtc_h_total_disp; uint32_t crtc_h_sync_strt_wid; uint32_t crtc_v_total_disp; diff --git a/hw/display/ati_regs.h b/hw/display/ati_regs.h index 81fb5302c0..11a54caa83 100644 --- a/hw/display/ati_regs.h +++ b/hw/display/ati_regs.h @@ -313,6 +313,7 @@ #define X_MPLL_REF_DIV_MASK 0x000000FF =20 /* Config control values (CONFIG_CNTL) */ +#define APER_0_ENDIAN 0x00000003 #define CFG_VGA_IO_DIS 0x00000400 =20 /* CRTC control values (CRTC_GEN_CNTL) */ --=20 2.13.7