From patchwork Mon Nov 6 08:15:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 13446412 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 F25B3C4332F for ; Mon, 6 Nov 2023 08:17:15 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzumJ-0000Xw-AD; Mon, 06 Nov 2023 03:16:11 -0500 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 1qzuly-0000MW-RJ for qemu-devel@nongnu.org; Mon, 06 Nov 2023 03:15:53 -0500 Received: from mout.kundenserver.de ([217.72.192.73]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qzulv-0007xm-AH for qemu-devel@nongnu.org; Mon, 06 Nov 2023 03:15:49 -0500 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MWAWq-1qtvZE38d0-00Xelf; Mon, 06 Nov 2023 09:15:42 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Laurent Vivier , Mark Cave-Ayland Subject: [PULL 1/4] macfb: don't clear interrupts when writing to DAFB_RESET Date: Mon, 6 Nov 2023 09:15:38 +0100 Message-ID: <20231106081541.53688-2-laurent@vivier.eu> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106081541.53688-1-laurent@vivier.eu> References: <20231106081541.53688-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:jY6bVBOk79ivImRWbnv1qqFrw9o57WeR0I6nI3o6v9VJ0iZOQ3I 3DqiQDOiJIp0tJv+QPkVqjFikH1EtT1ZusuxCtZZUatRi6xQdEP+fAm9SdUqHZIbs3SoUPE FsOu9x8YYixzqu3+2oyvsD6UoqqjiyU+B10ajZXCJUs5+JidUpY0wXdzIZ03bT6J0KO4Cnd X/4eQl3dQYZwIpz6quH8A== UI-OutboundReport: notjunk:1;M01:P0:AXEzPozdl/U=;BkwhbyKCgpQvJtIk9cj2mzixyfa 3cJCBlkmSwM8vDk/Tx/Pc2NqHCpyuvGob063eBxuJQb69m69IqDtw1CbPBxlXU/BvmpldV6zw 6GaU1ov4ydxqueOdD4stvD1P930JO9382xMrfGg4t43Rr2bS1SW8HsggeuXGZjfKo5Mn2ay8L 6X8RcCJsWFnxMqwusES0xn3Q2KUGSXXpCcjSly/Cx1JDfKV1JoM6H5+2Fv/NfGwpM/zn5jlZs Oes1Nl/XB4vlxNTO+BYTNevb6PfFGYunhHfgy3sfro1vcpN+NXghhfIGRDRvSix2cbAgGE98L rM8XgZXKum9ErF1x/+AMC+OYgCgmxSB0CiI7xqHpfeRAeQSFG7ABk+Utqvxj33sEqaWpjv3o8 8GNBlrEVRl+0hmTg6iT5l+zVPXdbInPtRNHWUo6FZI8BBx6HkzDklR+Mr7Hu6gUZQfopfV1rG WtiXVVnyXcIhw2dkOZeMVf7afumS5bl5iQ4iwvYcjy4a9VA80NjKOVkvSXvHebT6VKUyakdcr hYbSQQUh9Ed9K8zuy0t+0a2uTDVMvbZ3ugh3GmqOjIoaj6elL+QS1csT0z3eHg6UH8wAVuX4N AjdUGOAtSGvgsvExTxMv/tGHTnhvVUF73nE0VxOGeRr66Fnv3yVDVL20zI+4Qc7rjhRBo86KM TwzeLZGwFhxGYjC5KPx3IH8PzQLQrIWp9F1g/LkyGXI3SM4mLxy2JriLR5A0VuV/yUrxYLyBa QikEdWI7zjp+f/Kuv2iepFyZBKsG6+dkM/dCaRSHKsASL0zaLU/dTATb7HXCix4bCLW/BIdmj 3RtAoNiogjzOw4+McH7U6AqNHRbJ7W2d44LlJXuEtyWjw+nyEDPxqffW3/ZFyTwBP+LrqX2I6 A9rdoLkT28ZyrSA== Received-SPF: none client-ip=217.72.192.73; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 From: Mark Cave-Ayland 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 Message-ID: <20231026085650.917663-2-mark.cave-ayland@ilande.co.uk> Signed-off-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 2f8e01656640..28db2e9f246a 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 Mon Nov 6 08:15:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 13446413 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 3CF4AC4332F for ; Mon, 6 Nov 2023 08:17:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzumI-0000Xt-N6; Mon, 06 Nov 2023 03:16:10 -0500 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 1qzulv-0000LW-DI for qemu-devel@nongnu.org; Mon, 06 Nov 2023 03:15:50 -0500 Received: from mout.kundenserver.de ([212.227.17.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qzult-0007xn-Gs for qemu-devel@nongnu.org; Mon, 06 Nov 2023 03:15:46 -0500 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MiakT-1rfK8G0e3z-00ffh8; Mon, 06 Nov 2023 09:15:43 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Laurent Vivier , Mark Cave-Ayland Subject: [PULL 2/4] macfb: rename DAFB_RESET to DAFB_LUT_INDEX Date: Mon, 6 Nov 2023 09:15:39 +0100 Message-ID: <20231106081541.53688-3-laurent@vivier.eu> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106081541.53688-1-laurent@vivier.eu> References: <20231106081541.53688-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:PvE5QVomysngCKTOBnZbfOErQIWga0TcaxlTh14Xe/fS2Bb8/Fg 1PjDCmgf0r7Za2FevufypSJ6pthvNkyIQhN9+CRrgqBxAb8qf2gJCxoEBjpJz7mCekCS1R1 NjgrtOMpT/Hqr/CkiFR22vjIxTKRApe6MoCBXDSKGYCvod7i1qHAeYaag7RxRgBQ70nkLtW Lhszlx4JgkfQG3hLMl40g== UI-OutboundReport: notjunk:1;M01:P0:pxqB1KBBmbM=;VIbKYpUNca8rfujTBm8iz2SN3Nu yV8ebm3XqAI1/RLvKouvUzMdY6Hg7e0q8LDShRzIxbNBIfcuPwIcsUdN4yWXUkDt3wfYvujMT gxuS3q5zsm9pObWsqvQVC7x1060nNGui1N+09/pKq+BKNmnl0EI8rmlpYUnIv1aRPOhmgCcnr RVe9BwpynGfqAIeB2ungNAFp/lj6ehycOWP7WM3KVZjGbxS5kKfY88iHBBY7sP7oMFZfr73m7 ue4wp9v05EuMaPuoLlRL1K03+fLJ2EeAYQQ+JthdeQMIAEltfIkxvDrofIbPnX+ZgLD+8zKOh PS9LEuIcKA/1JUT7bKeJoeiyLr+6zjsYPatYSouXoS5LmQxgG4Wla95KFTah5nXbfPnAkeMYZ d2fh2Z/h6S4ynZW/lJKRibgU147riiis7pE4cjcZfDV9yYQ56mTDHR/eWZcX5nM9aqdaqPPTB rTeALX17sJWia3EacbPDuppST3WcV9asqmwhw6YY69QcKch+gIkw2J7PM4I/K4aP9CX5mf5qH I+dZON2dfK2lrMLKTFh1VkbMNTtXVv/SmN14+y2xthbwZMEeTBr4RllfVYWOBo7TgZqqUIRGf fols0V7EQCl6mPLrqANWH55aXxsFx8Xs7Pvzk4vLggzoSdHp4KgWoNRQZz5nkkbdeRvuLG5+E 65ej7YunhStwweCPdRYfGweaBnADVcHM3mPOY5P378H0ezeuCSZnjpGxX1FsPCkOZrfRczkh0 wX/oAO+2FnKvPSl1DbcSA3T7zwOo6KpBFemCSLpDV0KoXQi/JWYSVWSd/EdsvmESkNF547Zaj tqVuXZys9ftTw7279rXQ3qhb2hX3+efWA7NB6b+M0Zdy3pgVx/SwTmSe/OFllHTjtTgXCv24Z 0rQfXL4GTLCFL4w== Received-SPF: none client-ip=212.227.17.10; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 From: Mark Cave-Ayland 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 Message-ID: <20231026085650.917663-3-mark.cave-ayland@ilande.co.uk> Signed-off-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 28db2e9f246a..eb4ce6b824c4 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 Mon Nov 6 08:15:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 13446415 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 C651DC4332F for ; Mon, 6 Nov 2023 08:17:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzumJ-0000Xu-3w; Mon, 06 Nov 2023 03:16:11 -0500 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 1qzulz-0000Md-Gx for qemu-devel@nongnu.org; Mon, 06 Nov 2023 03:15:53 -0500 Received: from mout.kundenserver.de ([217.72.192.74]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qzulv-0007xs-9G for qemu-devel@nongnu.org; Mon, 06 Nov 2023 03:15:50 -0500 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MjjKf-1rgNNs2QLz-00lDc2; Mon, 06 Nov 2023 09:15:43 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Laurent Vivier , Mark Cave-Ayland Subject: [PULL 3/4] macfb: allow larger write accesses to the DAFB_LUT register Date: Mon, 6 Nov 2023 09:15:40 +0100 Message-ID: <20231106081541.53688-4-laurent@vivier.eu> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106081541.53688-1-laurent@vivier.eu> References: <20231106081541.53688-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:eVso82uQrgAqBr8bvnYuKHtD9ka4cSI5mGG6JBgYEChvffTVNlU I7o+foBAEDOgAVcOJrm2hv0LL5QL2MwwOOAjxlOVkuUclYMhPPtv3l8SY6y9axXlE/XedZI +bvIbyFHsoTI3ezCAEQrRES0a0qYNGRHHvyGsRYMNYqKPXDNNGxF6Dy222tSekpzEN1lzED w1M/J1kV+8FIWa5TnmNLw== UI-OutboundReport: notjunk:1;M01:P0:0RQAEbnJE/E=;6DCyifJDkCLRpnLTwnXqksdMc3E 2Gl0dF7sUAQyeGloC2fGXB3Z85YBP1B3FX39q5U4xJntjUr1T0e+p3RGPkiQdv7W8hNm3RcQF t/NHydDJPVIUfB2DrLJKBSY8FEghsv4X6mRuVEPlzUiSqcIrd5t+x/+miFf9qvpm+QII6B3K5 T6O+6VAlarDUlpNtZ76fgvAD8qXkleTUfhqQMreqLJm1HPIBnGzuxckGZe8KmkvyqGsUxW2XO n4C37UckNwN8jNWVHhy4UOL9lyT6foss2At6IvLo9K7R+X6cYnJh3dgF3/zZDoViT0Lpb0EnU hJAiQiHWfmWWAQs1roDg14ORIe4s+9l/mDoUr5lUG1ZWjA4YrztICd/D7bd4Cs8Y4jga5oshM gq7h6CFdqjenJo2Qj9nud5s7DUI5aBJK43AZBD7bZn9ydG5RnAmaSIqD6kpK5aq5SUSUKd463 +Z+Ho4B625y5h4tLKhx4jtjddP5EAWJaQDo3eGSlNNEIiltn2F+8L+u+1gPoqq6Xu3RZ0YhOM I1IdEgX9wJLlceE4421a4OuiM996yaqDQa6nUPhs0l6qK5XplCcbs3Ssn7IM6TLMhFHgsPuQg vOrv9ptfcPi3dVN4nPIrgad9J0tu6HOCDAUeaycgGucrlNZBpJwcM9pEZ9CLMjTyyBt/1t0RM H2sJ95TzGCy2do0WBgWyMjH8uy79DUgbq8K74CCkZlj8qhFwTQAk9r9iDPNpHcGawdiDKOq8h sg5IMnZFXDzBWQs6EWJ13sGUQLhT2JLHGZMkSbr2NWu5OBy/axIclN+z+9TFPWvGSA/cgSsO4 QVQn3S6KCayCqhOG05m3o6pposQWtwQaeRQdwcPAEalB7hnZ8qiS6K5EVkXur9cnJWcEcC0qs rGZFxYKR05GCMiA== Received-SPF: none client-ip=217.72.192.74; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 From: Mark Cave-Ayland 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 Message-ID: <20231026085650.917663-4-mark.cave-ayland@ilande.co.uk> Signed-off-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 eb4ce6b824c4..4a1c75d5720f 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 Mon Nov 6 08:15:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 13446414 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 6415EC4167D for ; Mon, 6 Nov 2023 08:17:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzumI-0000Xd-FW; Mon, 06 Nov 2023 03:16:10 -0500 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 1qzuly-0000MX-RX for qemu-devel@nongnu.org; Mon, 06 Nov 2023 03:15:53 -0500 Received: from mout.kundenserver.de ([217.72.192.74]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qzulv-0007xx-6B for qemu-devel@nongnu.org; Mon, 06 Nov 2023 03:15:49 -0500 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MuUrM-1rHzr000mY-00raJP; Mon, 06 Nov 2023 09:15:44 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Laurent Vivier , Mark Cave-Ayland Subject: [PULL 4/4] macfb: allow reads from the DAFB_LUT register Date: Mon, 6 Nov 2023 09:15:41 +0100 Message-ID: <20231106081541.53688-5-laurent@vivier.eu> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106081541.53688-1-laurent@vivier.eu> References: <20231106081541.53688-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:GZbloz/oVG5VCNbOpCfBpENQGffdE3zuFuylMp+HWT8mTawvFl+ eYtNN1rAiLzLTwM0N00fK/v+M/L53qAM3FrqRZGFkncdDRKLDBoaMzeA+qMGEWZHLd0yxML 7YQtAwK6KnyILyeHrm/xD5N/iEDbRHqDeI1sKPj+XwwE22Vq/9zD/HdEjfAiU9wxOLNUecy v9xeSTtTkqzB66LEklgnw== UI-OutboundReport: notjunk:1;M01:P0:LJo6d3fVYyI=;pR8y6h9zIhCtUJJlDy6DKBf7BwR IoIacKhqossRetHf0wgaYw47EBqem8Knt8E1J0wZACNn1HU4GQhcNijXUX2BoQs4s/YYxFpAy yvIUXeyFy7voXQgb3KETje3onaGG35XIbsNuT9xwJc2PobeGpPJXhl6TX1IsKzJ9eUdrVOl/f R+WjyhqFxxwgHcpYthJmvWcjcMJrJWxSVuGYS92u3Lh6xqShYGFVhq/0cNpV332BJFdmSlybZ pE3Yj6ArsqdSCz8LIncVM98jIurm+S1NmbNj+or5HHvDaPCnOlqiWOv1j5Ue1LGFsP01PzcHs 9p3e7Ru15SojBNVxqQuykAW4YXrlOn3UIpmetr+8YeJaKmxu0seEsczImn7uc4VqyXKEgQRsf ju7gQPPGZAKAmb/AAR0SQJAjrk4Mki1069d4EiU5xL5IebHtZOiasI2g2QypYyICvPpWDzgFC rye66Totsr7ap8H3uA7hYk7Ypuf0FQEZy20ouyEMpuduo0wnTMMvoEiYzeeK8TDFuuuidJTCo QYshCvuh8JlDWFqupPN/QzJ7qcEbhDek0yA+kJnwKMw4Ci79Emi8iG58Sj3VDoGrtD8elGtGa 0Tnt9HQmJdTCLBnwfwa9DeWoMvhUqCFhkt2ybsElAPwCHK+C/lP9xfU5J+IB9TOeEdumR8lYA dxGpWNCn8jsyBzw5d8ttFee5NutC0vXyxnuaGEnUxLtzU2i3JO4pwW7/KlZUDecNxCcgrns5W nXocUL/1eWIC+HAKulDH4j/0REUvtq9MVOWa72eISBGjFRFwls4miMduaGOjr1gDCh4Use91d niniuiiv4HBYDXmP8JWGa3/1h80EJZUSAIY2qUcySErU+dlz9cEZH632jikttiuNcpQ8JeghV UmiLrTAGLP1QMDQ== Received-SPF: none client-ip=217.72.192.74; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 From: Mark Cave-Ayland 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 Message-ID: <20231026085650.917663-5-mark.cave-ayland@ilande.co.uk> Signed-off-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 4a1c75d5720f..d61541ccb5d5 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];