From patchwork Thu Oct 26 08:56:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 13437386 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 07E77C25B6B for ; Thu, 26 Oct 2023 08:58:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvwB8-0005kV-NP; Thu, 26 Oct 2023 04:57:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvwB3-0005iP-8a for qemu-devel@nongnu.org; Thu, 26 Oct 2023 04:57:17 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvwAy-000610-Uc for qemu-devel@nongnu.org; Thu, 26 Oct 2023 04:57:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=m8yxVOFYY049SfOfPaVYJTXIZNb3z2k+XL0AxUUInpI=; b=ydYDnYif7T1jGCmuCffXianWpz pdJ05XHq2o2toagr+gLlGpCoPqo2Tc1OA1PZ8XybD6ZTg8/Se60zU+flVV5oZLXl+aaQJzgnO8eWe aGjvTn0NZlLUkAIVDB/nnwDhaPm1eyt03Out3gNhRj+RY6ydys/4YJlmJpUgTMNQf3/tLbDEJxclx ab3l7JgDCEJBhOPOuzWNZ01syjTr+ws2UL/F4Mq5Bpb0RfY2hAnSUY9lB8zNNFUnFok5g+UxGPRd5 BFQfIxNnNGIiVooVnxtDFzOW/Ta95a5R2voaUxR1wL5AvcIXS710W+TEDNCbVQ4WgIQxdOLaGMXxI S5tjMbYywOd06Ca7zOD4ssHlC5dr/Ay4Y29w2hs0zojmBek1SGBK2Gs4myNzk8SrQAnB9xPZrFv6R c2rvXnTwx+ZLWOb9dLaeG2g0I8pcFfxptKQRmizJADN87at2OzRG8BMRLD2DnSxxzRCm91tgzZDOv ADcobS1KtHtP5prAq/CYemp+6DOYqTkEe8e3ZbH3AqMaeMf2kzz+79dnf7Hz8Tw08A/oAzK6Stkls AkPDJC57nbvtd2KWbPJ1D0wPWuYcMhrc7jbOnxLJWykytJ2qM3r03mWDpfav/BIkQl51eN1LfwEoW j8/TlaGpWNToB3cZ51aWj4QYJfSz4cStmt39h72Wc=; Received: from host86-130-37-248.range86-130.btcentralplus.com ([86.130.37.248] helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qvwAe-0000md-NY; Thu, 26 Oct 2023 09:56:56 +0100 From: Mark Cave-Ayland To: laurent@vivier.eu, qemu-devel@nongnu.org Date: Thu, 26 Oct 2023 09:56:47 +0100 Message-Id: <20231026085650.917663-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231026085650.917663-1-mark.cave-ayland@ilande.co.uk> References: <20231026085650.917663-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 86.130.37.248 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 1/4] macfb: don't clear interrupts when writing to DAFB_RESET X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Traces from A/UX suggest that this register is only used to reset the framebuffer LUT (colour lookup table) and not any other device state. Signed-off-by: Mark Cave-Ayland Reviewed-by: Laurent Vivier --- hw/display/macfb.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/display/macfb.c b/hw/display/macfb.c index 2f8e016566..28db2e9f24 100644 --- a/hw/display/macfb.c +++ b/hw/display/macfb.c @@ -585,8 +585,6 @@ static void macfb_ctrl_write(void *opaque, break; case DAFB_RESET: s->palette_current = 0; - s->regs[DAFB_INTR_STAT >> 2] &= ~DAFB_INTR_VBL; - macfb_update_irq(s); break; case DAFB_LUT: s->color_palette[s->palette_current] = val; From patchwork Thu Oct 26 08:56:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 13437382 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 179C3C25B6F for ; Thu, 26 Oct 2023 08:58:22 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvwB6-0005jp-J2; Thu, 26 Oct 2023 04:57:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvwB3-0005iR-8f for qemu-devel@nongnu.org; Thu, 26 Oct 2023 04:57:17 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvwAy-00061D-Tv for qemu-devel@nongnu.org; Thu, 26 Oct 2023 04:57:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=SZgWH6ZZ6THa2UXGQszNhCElN4Fl20dWOSxRnkWzJ68=; b=0NsjpOOaHAYvLmxJFMbOO+VO0H ufvie4/24GGskug8o/hyZ1HOO5oZ1ZcTiXubo2AVRlivzEqzcsSSNxUUYuky2m9I+DgTVE5KH091w AdY1d3IXi5c3A7pLWuy2OMIgRGIKh+jN42M4zgUlOXIJbXxcKhlXAPPGXKtHlRrR8cMMuD8C0Gh6N LA5gJx+Jlsmy38xUrIgG+q1FOcNIsottVkafymQmYnV31hmo8Xq2GNj/PsNdgk3b/y/95T2YV/Dw3 Hfp5f7/7I2blQw5TNVR0h21kIQte3VejxrNoabZB3lluM3VCszhW4K3cWaJPU84ImlklsqR6HdrqS RNk4mFuyUg12tR7Cy588xMWmjxVuP/lrgtQ+/c6QJbLKaX+VPAGtcvIBdvC1JlJisiW+Aq7Lu7gja CG/meZA++Nk3xcg7OxyfxMORzCEBv9KvBni/DnymdXUqqz8nFw0zY7bhFt+hxRL/qCthJver2TV8B Cs1jKo0ZIfInX9kOA08uTE4viQR8NK+NtXUEpigD/hwYJa2pmAbEod35E34uA3Up0Jv2V96vzFx97 2YSUHCxJH4wYHRqpIkaXPLTsvcEfQgLN8uC08pVB2qmuNDBQVQ29hp+wg7ryYqjUE191lnG7DmsvR ACceiET/HykVhRTHH5RyUh7YIpI7d7PLKUq9j2NiE=; Received: from host86-130-37-248.range86-130.btcentralplus.com ([86.130.37.248] helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qvwAi-0000md-W7; Thu, 26 Oct 2023 09:57:01 +0100 From: Mark Cave-Ayland To: laurent@vivier.eu, qemu-devel@nongnu.org Date: Thu, 26 Oct 2023 09:56:48 +0100 Message-Id: <20231026085650.917663-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231026085650.917663-1-mark.cave-ayland@ilande.co.uk> References: <20231026085650.917663-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 86.130.37.248 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 2/4] macfb: rename DAFB_RESET to DAFB_LUT_INDEX X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org When A/UX uses the MacOS Device Manager Status (GetEntries) call to read the contents of the CLUT, it is easy to see that the requested index is written to the DAFB_RESET register. Update the palette_current index with the requested value, and rename it to DAFB_LUT_INDEX to reflect its true purpose. Signed-off-by: Mark Cave-Ayland Reviewed-by: Laurent Vivier --- hw/display/macfb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/display/macfb.c b/hw/display/macfb.c index 28db2e9f24..eb4ce6b824 100644 --- a/hw/display/macfb.c +++ b/hw/display/macfb.c @@ -36,7 +36,7 @@ #define DAFB_INTR_MASK 0x104 #define DAFB_INTR_STAT 0x108 #define DAFB_INTR_CLEAR 0x10c -#define DAFB_RESET 0x200 +#define DAFB_LUT_INDEX 0x200 #define DAFB_LUT 0x213 #define DAFB_INTR_VBL 0x4 @@ -583,8 +583,8 @@ static void macfb_ctrl_write(void *opaque, s->regs[DAFB_INTR_STAT >> 2] &= ~DAFB_INTR_VBL; macfb_update_irq(s); break; - case DAFB_RESET: - s->palette_current = 0; + case DAFB_LUT_INDEX: + s->palette_current = (val & 0xff) * 3; break; case DAFB_LUT: s->color_palette[s->palette_current] = val; From patchwork Thu Oct 26 08:56:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 13437383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E6878C25B6B for ; Thu, 26 Oct 2023 08:58:22 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvwB7-0005kR-GL; Thu, 26 Oct 2023 04:57:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvwB4-0005j3-Iy for qemu-devel@nongnu.org; Thu, 26 Oct 2023 04:57:18 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvwAy-00061H-Ui for qemu-devel@nongnu.org; Thu, 26 Oct 2023 04:57:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=QcgOLGJr8/48S2M46OzOv/0iJYPh4mcebYi3O1KWHpE=; b=FriN8Ng7TyNGtM76v5zRd5C0h5 j4zJnrbnB2fce6PWUDxI68fhEmEyv0Ugv0OG06m4NORl6rlspf1WbfioAZWdLVsuoyrt4Y3mEESI9 shOGDAaeicLeL2V25BYYoe5WwP/HVtJLflM5gJyyT9HI17dRKEiBdrAAO0nXt5JIDINXEBR5C0+u8 8W08OzIUnMT0Dx//Ue+pQ7qnQXbtpMexKNa8DGclhionXU0qgZ1DKYuIFpxtRDs/o6AbUcc9bvkvC jPor5HZs706WTYP8lRF+Bevie29qXw0UALs0/cK4Y5+M9owsemjnEo26YFmI6CFLZVA5PZGJkUMnx eWHJXAwKp2pyYeDCgpDRUMfhK4woOO8nSGy2Z00OwojnSLeV3lLSUOV4mfwuhtqJ/+qo7IefB7Uai icF5G5xSgb2EMQ8ePcGfEEoRKUmpoQ9EGy1HZdnwjt/4Y2cdaIn+YoEBzKzP2hltpJHGOMBqJD2NJ oD36x4SPTxYLKREvfoQGG9KiVYSmpCsGZc16EqTVDMhDCunISew2q1UzCZLQsvneKZdSF7tx6QL7m GZM6M6qeOTwuyxghiRGv+IFC3hl0frptKcTwK+oIA30i0IncgpQEHh4Zwod9yhL2T0xwO1kp2YSIN 6MKj6WsBmj0MgCjpukBCJNgzT6GmJfSU6tuS9vvrk=; Received: from host86-130-37-248.range86-130.btcentralplus.com ([86.130.37.248] helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qvwAn-0000md-9Y; Thu, 26 Oct 2023 09:57:01 +0100 From: Mark Cave-Ayland To: laurent@vivier.eu, qemu-devel@nongnu.org Date: Thu, 26 Oct 2023 09:56:49 +0100 Message-Id: <20231026085650.917663-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231026085650.917663-1-mark.cave-ayland@ilande.co.uk> References: <20231026085650.917663-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 86.130.37.248 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 3/4] macfb: allow larger write accesses to the DAFB_LUT register X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The original tests with MacOS showed that only the bottom 8 bits of the DAFB_LUT register were used when writing to the LUT, however A/UX performs some of its writes using 4 byte accesses. Expand the address range for the DAFB_LUT register so that different size accesses write the correct value to the color_palette array. Signed-off-by: Mark Cave-Ayland Reviewed-by: Laurent Vivier --- hw/display/macfb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/display/macfb.c b/hw/display/macfb.c index eb4ce6b824..4a1c75d572 100644 --- a/hw/display/macfb.c +++ b/hw/display/macfb.c @@ -37,7 +37,7 @@ #define DAFB_INTR_STAT 0x108 #define DAFB_INTR_CLEAR 0x10c #define DAFB_LUT_INDEX 0x200 -#define DAFB_LUT 0x213 +#define DAFB_LUT 0x210 #define DAFB_INTR_VBL 0x4 @@ -586,8 +586,8 @@ static void macfb_ctrl_write(void *opaque, case DAFB_LUT_INDEX: s->palette_current = (val & 0xff) * 3; break; - case DAFB_LUT: - s->color_palette[s->palette_current] = val; + case DAFB_LUT ... DAFB_LUT + 3: + s->color_palette[s->palette_current] = val & 0xff; s->palette_current = (s->palette_current + 1) % ARRAY_SIZE(s->color_palette); if (s->palette_current % 3) { From patchwork Thu Oct 26 08:56:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 13437385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 644CFC25B6F for ; Thu, 26 Oct 2023 08:58:30 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvwB5-0005jG-Cd; Thu, 26 Oct 2023 04:57:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvwB2-0005iG-LD for qemu-devel@nongnu.org; Thu, 26 Oct 2023 04:57:17 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvwAy-00061d-Ta for qemu-devel@nongnu.org; Thu, 26 Oct 2023 04:57:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=RKgvM8BfA8HJdcm/PeCzGne0iIyf0WNTzf87F/1YudI=; b=m+yqbRjTQoUXO+uVgAJLWCaApb kFpdyTyuQPiz4cQV4NO5V/uL1KWULJOgWO5txtAzRD8UvISmItHs40pTX1a1vUeMNQpdbH5ijEVaj r/9lBiyyQQ/EUoWIQu+XD15i4n71NlFuLnRsaTCxB+oVO6v7QImWcssW0jJKJrJcDG23Gg2/WUMZr wh7OohOWWL8gC6KpS8hYXbXBgZTdCQK7eLqd3PrL3rxdW/4/lIW7w5PU18s5eneWA9vQ41d7sj0lC XpaACswLEFbNf4FrW6Ig4o8WVsNwjn30BAi/Ex1GiAgtpFiJj1pI2CWec7NyDR2CM/LU4kY4OY7Sp RDFhF4dlAfC2I5CMVONea/oAZI65fWQ9wefsqglJOp9myANn/Z7mCBKWbkjUPWpnaC9b/Nh9Td4Ea HEyNLUVOseLWqq1oIxzfHRGUjfmYlFxPqo6o0qC+XrHuDP4xeB0KUQsS9rrvoGdQbxUGmP5qvc7OX xhJrBWIMIBmTzJMckINjHtnsdqvlYJcjWA/qiNwEK6SYjc2iFNUTSiT5tzkG06UERO8xwK1rYnHI7 p7mC2OWfVbDsNBJAHMw6W+qNnAc1Mb4sCtSz2uR/OOE4S759h+f+d1svtMqMNXI6a3CVCUG/YwddK IUq3ZWY092g39RA6/JrBUwP1oBdzu7K7EWjO7Rm4Y=; Received: from host86-130-37-248.range86-130.btcentralplus.com ([86.130.37.248] helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qvwAn-0000md-Mi; Thu, 26 Oct 2023 09:57:05 +0100 From: Mark Cave-Ayland To: laurent@vivier.eu, qemu-devel@nongnu.org Date: Thu, 26 Oct 2023 09:56:50 +0100 Message-Id: <20231026085650.917663-5-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231026085650.917663-1-mark.cave-ayland@ilande.co.uk> References: <20231026085650.917663-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 86.130.37.248 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 4/4] macfb: allow reads from the DAFB_LUT register X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This enables A/UX to correctly retrieve the LUT entries when used with applications that use the MacOS Device Manager Status (GetEntries) call. Signed-off-by: Mark Cave-Ayland Reviewed-by: Laurent Vivier --- hw/display/macfb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/display/macfb.c b/hw/display/macfb.c index 4a1c75d572..d61541ccb5 100644 --- a/hw/display/macfb.c +++ b/hw/display/macfb.c @@ -537,6 +537,11 @@ static uint64_t macfb_ctrl_read(void *opaque, case DAFB_MODE_SENSE: val = macfb_sense_read(s); break; + case DAFB_LUT ... DAFB_LUT + 3: + val = s->color_palette[s->palette_current]; + s->palette_current = (s->palette_current + 1) % + ARRAY_SIZE(s->color_palette); + break; default: if (addr < MACFB_CTRL_TOPADDR) { val = s->regs[addr >> 2];