From nobody Fri Nov 14 15:21:04 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1762440771; cv=none; d=zohomail.com; s=zohoarc; b=d1tYBP/t1LlPf+R/WMe3l4fGUWmEXcOb5Dp+o8YZiQHxLK1Q8RhUWpLLMz8Hy42+Njv7XuqajwCDCPB02FrtwFK8h2MxPMXLXSN2PX5mjRWovQJ/6rkJLwjBqjhT280Pwj2gne/R34CisgDE7JptiE3ZmCg/jFb0oUXrAFtiReU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762440771; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IKfGG8WVNqNZfFZk1k6i3v3Lr9Uq/tsY8S+cA/a7uyA=; b=A8+yIFGiCKcu78zmn3jq9c9xHAoekVWCMg0oqqVRO6YwKAgsRvOCaUojIH75xUi23EEit/oD+oJ1U7+F9DndAULtMzJ/2aVJ4+N7HlNwqjcWr7E7vLWeJ7BNjBxSfQ+X61Tl+b2Z1ojGbIub+KuIAGLnB/XvJDvi3M/Tw7LHuag= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1762440771812870.0128821588157; Thu, 6 Nov 2025 06:52:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vH1LX-0006HZ-0u; Thu, 06 Nov 2025 09:52:19 -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 1vH1LU-0006GS-TH for qemu-devel@nongnu.org; Thu, 06 Nov 2025 09:52:17 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vH1LS-0006c8-Rp for qemu-devel@nongnu.org; Thu, 06 Nov 2025 09:52:16 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4711b95226dso12549785e9.0 for ; Thu, 06 Nov 2025 06:52:14 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429eb47721bsm5694891f8f.25.2025.11.06.06.52.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Nov 2025 06:52:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1762440733; x=1763045533; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IKfGG8WVNqNZfFZk1k6i3v3Lr9Uq/tsY8S+cA/a7uyA=; b=Uh1YqubzaMGNnQia3ygb9l5iIfyd4WvD04uxKkKotup147RAznumuiXpfZLOrYuNN0 CbOgvkkk/ArSAiA3WTXCAodZAtvedD2bB+vfKW6Tad9tJuoMOKrTZ1Q2l0WF9Q0XQRZz 3I0zCTkVsNbz5fa9ujD3BgQ3GpswDedgEwlRxys9FBRqvtLKS0v4/eLXxYt50ktRswzj hzD4Qg0ZeKqoIRZq6oB844nD9Si+zp5QmRr12GBmJ03zDW1WDUvLhofpVnZCPQGmR4SH b9E/Vbcnwn7elvSdvTvHUtE2xWj+yP5chlyfoOIdG4xyKdYhGyIaEPTb5hKo04Z7pzFT CkMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762440733; x=1763045533; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IKfGG8WVNqNZfFZk1k6i3v3Lr9Uq/tsY8S+cA/a7uyA=; b=QM4oWEokMuIpHoiP/k0cBqvo+9jV+lgyQReauCDOOgAJrl1R04SE2YVpPPEGRxgTUZ rQq1Z86kDoK/anocDiOD5w3LMJO2pYP/CjxbwMpklUhe0PpwKLVxaU0ddnxEwizb3MOz djSdjqgfdCH6e0gU34l4S7cbfM6ibvVSsV7eFsX17fxZaEYg/8C7qdubG80mpBTgj9O9 AZBKYCk0NqcAsr6hZO/t5m2cYY+80XL1sXa8LgWAbKXfPZEmXi3RbM9PFiOq/kLgj9sU 9dlKIh4JzVuEFQhEO88EEKq8wMwbFNlsHBNdsg40HVVB0xjGf8KOs0QRyoWmniuvcz8K MBdg== X-Forwarded-Encrypted: i=1; AJvYcCUV2dWWHuoWVVk8Qlh3D99+LL6KY7g9YPrTJc3FnbliF6a/sIUO33Qq2mQ/TGOkIUaS5j2cp2KWklAS@nongnu.org X-Gm-Message-State: AOJu0YyAtn1u4c7HaqyB40Jt/be/hQ02Upbtw6rYQXLQscjz9G2tiEFZ tIJ8oN0Gq0Jq4IkImLC4j2+0+yy+9cAFA+vmSF501NQ3nurnwcCl2PfZOqzscm0KJIo= X-Gm-Gg: ASbGncsugsUPqSZLS+qyljcS0SzPcqAQyE1etEAODjIV39uzEh13GIU968qZ0XEpruK CakswZGhGpfKBDHuZewukEWPomKtx4UCky1UWC05qFS3E6qnJbEAxCk62G6/OU3t3BP4zg7x7VJ YeRQWmZWulbuShJhmYEd5r7+dvsKf5W20sAc/2Yrq6pokiBDygotoEUiz32qo0sv+AzV9otgoDN FgeY+Cb7DaaWOjJWtyh+3bL76B77a5peCDYZigo2wFWoI3lGO4ru47znX/9oGW7lU4mIHg2DUi5 ExoSO03B5QQ1Yr8MDh9zpRPvPerG7dQlY+iTHVGGnW40nP6TrB2OHwGdIhZAylwg66EheIaNhfL tvcLQ/iu/fa8mdkFEpjHpXmDo4PIPzyn1k/nILZjf/uNySHFK/Ar7NDxjl1GsEBmTB73yusa+9N W5uSUhXA== X-Google-Smtp-Source: AGHT+IHrUnXNTboMwEy6K8qkByy9T1L6SjfDoI8enMrKRBk+COkRTdXL0Trghf+prklqWM/Nb29Asw== X-Received: by 2002:a05:600c:4e41:b0:46f:b42e:e392 with SMTP id 5b1f17b1804b1-4775ce51fc6mr64683235e9.39.1762440733112; Thu, 06 Nov 2025 06:52:13 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Alistair Francis , "Edgar E. Iglesias" Subject: [PATCH 1/2] hw/display/xlnx_dp.c: Don't abort on AUX FIFO overrun/underrun Date: Thu, 6 Nov 2025 14:52:08 +0000 Message-ID: <20251106145209.1083998-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251106145209.1083998-1-peter.maydell@linaro.org> References: <20251106145209.1083998-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.google.com 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, RCVD_IN_DNSWL_NONE=-0.0001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1762440772541158500 Content-Type: text/plain; charset="utf-8" The documentation of the Xilinx DisplayPort subsystem at https://www.xilinx.com/support/documents/ip_documentation/v_dp_txss1/v3_1/p= g299-v-dp-txss1.pdf doesn't say what happens if a guest tries to issue an AUX write command with a length greater than the amount of data in the AUX write FIFO, or tries to write more data to the write FIFO than it can hold, or issues multiple commands that put data into the AUX read FIFO without reading it such that it overflows. Currently QEMU will abort() in these guest-error situations, either in xlnx_dp.c itself or in the fifo8 code. Make these cases all be logged as guest errors instead. We choose to ignore the new data on overflow, and return 0 on underflow. This is in line with how we handled the "read from empty RX FIFO" case in commit a09ef5040477. Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1418 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1419 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1424 Signed-off-by: Peter Maydell Reviewed-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/display/xlnx_dp.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c index 96cbb1b3a7d..c2bf692e7b1 100644 --- a/hw/display/xlnx_dp.c +++ b/hw/display/xlnx_dp.c @@ -435,7 +435,18 @@ static void xlnx_dp_aux_clear_rx_fifo(XlnxDPState *s) =20 static void xlnx_dp_aux_push_rx_fifo(XlnxDPState *s, uint8_t *buf, size_t = len) { + size_t avail =3D fifo8_num_free(&s->rx_fifo); DPRINTF("Push %u data in rx_fifo\n", (unsigned)len); + if (len > avail) { + /* + * Data sheet doesn't specify behaviour here: we choose to ignore + * the excess data. + */ + qemu_log_mask(LOG_GUEST_ERROR, + "%s: ignoring %zu bytes pushed to full RX_FIFO\n", + __func__, len - avail); + len =3D avail; + } fifo8_push_all(&s->rx_fifo, buf, len); } =20 @@ -466,7 +477,18 @@ static void xlnx_dp_aux_clear_tx_fifo(XlnxDPState *s) =20 static void xlnx_dp_aux_push_tx_fifo(XlnxDPState *s, uint8_t *buf, size_t = len) { + size_t avail =3D fifo8_num_free(&s->tx_fifo); DPRINTF("Push %u data in tx_fifo\n", (unsigned)len); + if (len > avail) { + /* + * Data sheet doesn't specify behaviour here: we choose to ignore + * the excess data. + */ + qemu_log_mask(LOG_GUEST_ERROR, + "%s: ignoring %zu bytes pushed to full TX_FIFO\n", + __func__, len - avail); + len =3D avail; + } fifo8_push_all(&s->tx_fifo, buf, len); } =20 @@ -475,8 +497,10 @@ static uint8_t xlnx_dp_aux_pop_tx_fifo(XlnxDPState *s) uint8_t ret; =20 if (fifo8_is_empty(&s->tx_fifo)) { - error_report("%s: TX_FIFO underflow", __func__); - abort(); + /* Data sheet doesn't specify behaviour here: we choose to return = 0 */ + qemu_log_mask(LOG_GUEST_ERROR, "%s: attempt to read empty TX_FIFO\= n", + __func__); + return 0; } ret =3D fifo8_pop(&s->tx_fifo); DPRINTF("pop 0x%2.2X from tx_fifo.\n", ret); --=20 2.43.0 From nobody Fri Nov 14 15:21:04 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1762440793; cv=none; d=zohomail.com; s=zohoarc; b=Bue4pvobMU4z45sMvmK7zKt5q/TXhsLTjhI6nj72iMWg0xjt8BIKq4CBOmbFIlT1TaHxiNZhiuZkrA0Irp6z9Pp4qjJA0OXrfK6Ma3FydwnNXXRbTOwskq18I9o2gy3oV1Y0LMGr5d0PGvy093z3Go+OoYfK/4bMeBBhsKM4l5g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762440793; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=d8LEQa3iHwl6VkcSjXzC6iUo2ZyZOmvujJ07KAZdpWU=; b=E3nI2/B0OLsBSFilz/lIPyR/QCwtjUlXF5zGjzqhFVcGknVuKIdNtV0CzSiMOp9zA1XcfjuWpYuaPfK/sD6iqyXNIAixD6ldWGpQ3+e9QdXmj0RzIhMx+LX3QYgQAIMcr7a1tcLKVNF87rAUeekNByIHj1XGW5AQL3nvkcQT+k0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1762440793669773.987127117842; Thu, 6 Nov 2025 06:53:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vH1LY-0006IU-6D; Thu, 06 Nov 2025 09:52:20 -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 1vH1LW-0006H4-B4 for qemu-devel@nongnu.org; Thu, 06 Nov 2025 09:52:18 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vH1LU-0006cR-9i for qemu-devel@nongnu.org; Thu, 06 Nov 2025 09:52:18 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-471191ac79dso11972665e9.3 for ; Thu, 06 Nov 2025 06:52:15 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429eb47721bsm5694891f8f.25.2025.11.06.06.52.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Nov 2025 06:52:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1762440734; x=1763045534; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=d8LEQa3iHwl6VkcSjXzC6iUo2ZyZOmvujJ07KAZdpWU=; b=Cm2Png//krYoLlDG6HWXUKxNCFfa8BMyaz7FodNVUAep35JpArI7bZQ6lnSwVnzBo9 bj5jo5apd+7OML2ax4SeHbvv97G4BP4wHZaqr/SCsv4FmBTTZw5gLJ1hurxFUaa1czkS BwOJaHqQ0iu2jv+wrK4JWnns2Y56H5/B8dlooaVcGOhvHuFwRO38VoX++eUyDVYCbXGR XztmeA95fS2uxPcF27qrskhIuIHFMf/GpYnUDPiL4MtA97JOWzo3Mn624arpvM2PUldk QCl3MBazgOxaFLLdEcbD63DFcVh182uuxIypw4aVLseM4jLr1rOngvv5qC3TkeWqbA/S hotw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762440734; x=1763045534; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d8LEQa3iHwl6VkcSjXzC6iUo2ZyZOmvujJ07KAZdpWU=; b=DQfY19JTQRwJuJYR+u0R2FP3WYrr1uvt0VEyYpWE5PSBDODFQjPeTFabgjWN+vd6xN x4b5rzeB2AyX4DKMPE2X1DBBYjnOjnB8PT75Y9u1sNnf3rnYW8ClGStoOU48KRnBQvSw 0ONpFpGjqZIIP6YbC4Aqs4QABhhd0V4CzXhrtv+8f7tUF8mR/Mf9MMHLzzlvBZk/Pxj1 C923SxYCHEECa7mpSEKQe4pHuLiNPyEKOahoxEs1AMByJd8sNysR64Z9hS3D7tq4Rigo 5jRIW961YG3rYuifadaxgv+G+NBeJl1riJbaZVG7FMsfBdt+PnS6aZBdFD3sY3/R3CQb h/2w== X-Forwarded-Encrypted: i=1; AJvYcCUjU5UpWpDwA9JhYc8wuQLURe05aPcREXSw2UkznrsQlwJ4w8/BytqnZR2Ah6Ok2ZRpcaeLeg9L1kGj@nongnu.org X-Gm-Message-State: AOJu0YwtXprft+52TKrrkf26Qe0nKbZAfgAmtJr2GcQIclaWsMUbHP9V 9iKmyz7APQB+mtFzFH7n4uUHo8OJJEXQhQU0HwQkZS3uLNQPIVCUn/gAv6hqIlNM4bkJ77I6TBr Wo0E/ X-Gm-Gg: ASbGncuwjCArO7VEiFiyTNM7Td7Uu/UIpYzRcR0fEPecqar6/GU8PTuLlwa/2rOp1De w9yolN+JOT3W1GX44mUuQglhfygW51TS0HLVXISuj5nl5P3AwI5eaV4ByZidCpkh5KQJEEJBQWW K54SfLKcOgDvYHsxnk9b/GDmZawQHqcg9yMtYaRxr1j+6KjOdoBoGncStcv5LwFFcMdijs7Bdd6 +4v1Jf5i2KsP3BhssAXzYVcIphpuSC3mAoJIhGpIxfnM5I2QGVYdlrEeD2qsehKuQ61yiy1SyqE i0SQ236wHtRbtkPa7hfhhulSgBjjbGylq4SM5oWN4idZ8SDU3IIqo0O0qRDgZtOovysmLSC+nqb gWDXC0FFNcE/ktYGt8gChIHUa1cO6xwDzvTggVeoAdZtYto/cR8RDLzJVmfUSzmEhqMcraC9qUn xGKDrdMA== X-Google-Smtp-Source: AGHT+IEjDOISWhs+InErwAH2OMzaU3heIKhAFrinZg+2uRf6LjUO7D0k2834+/JShZRQRTb1rRoAHg== X-Received: by 2002:a05:600c:450e:b0:46e:394b:49b7 with SMTP id 5b1f17b1804b1-4775ce26f5cmr62456945e9.37.1762440734500; Thu, 06 Nov 2025 06:52:14 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Alistair Francis , "Edgar E. Iglesias" Subject: [PATCH 2/2] hw/display/xlnx_dp: Don't abort for unsupported graphics formats Date: Thu, 6 Nov 2025 14:52:09 +0000 Message-ID: <20251106145209.1083998-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251106145209.1083998-1-peter.maydell@linaro.org> References: <20251106145209.1083998-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.google.com 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, RCVD_IN_DNSWL_NONE=-0.0001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1762440794773158500 Content-Type: text/plain; charset="utf-8" If the guest writes an invalid or unsupported value to the AV_BUF_FORMAT register, currently we abort(). Instead, log this as either a guest error or an unimplemented error and continue. The existing code treats DP_NL_VID_CB_Y0_CR_Y1 as x8b8g8r8 via a "case 0" that does not use the enum constant name for some reason; we leave that alone beyond adding a comment about the weird code. Documentation of this register seems to be at: https://docs.amd.com/r/en-US/ug1087-zynq-ultrascale-registers/AV_BUF_FORMAT= -DISPLAY_PORT-Register Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1415 Signed-off-by: Peter Maydell Reviewed-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/display/xlnx_dp.c | 53 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c index c2bf692e7b1..d8119a56292 100644 --- a/hw/display/xlnx_dp.c +++ b/hw/display/xlnx_dp.c @@ -665,14 +665,28 @@ static void xlnx_dp_change_graphic_fmt(XlnxDPState *s) case DP_GRAPHIC_BGR888: s->g_plane.format =3D PIXMAN_b8g8r8; break; + case DP_GRAPHIC_RGBA5551: + case DP_GRAPHIC_RGBA4444: + case DP_GRAPHIC_8BPP: + case DP_GRAPHIC_4BPP: + case DP_GRAPHIC_2BPP: + case DP_GRAPHIC_1BPP: + qemu_log_mask(LOG_UNIMP, "%s: unimplemented graphic format %u", + __func__, + s->avbufm_registers[AV_BUF_FORMAT] & DP_GRAPHIC_MASK= ); + s->g_plane.format =3D PIXMAN_r8g8b8a8; + break; default: - error_report("%s: unsupported graphic format %u", __func__, - s->avbufm_registers[AV_BUF_FORMAT] & DP_GRAPHIC_MASK); + qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid graphic format %u", + __func__, + s->avbufm_registers[AV_BUF_FORMAT] & DP_GRAPHIC_MASK= ); + s->g_plane.format =3D PIXMAN_r8g8b8a8; abort(); } =20 switch (s->avbufm_registers[AV_BUF_FORMAT] & DP_NL_VID_FMT_MASK) { case 0: + /* This is DP_NL_VID_CB_Y0_CR_Y1 ??? */ s->v_plane.format =3D PIXMAN_x8b8g8r8; break; case DP_NL_VID_Y0_CB_Y1_CR: @@ -681,10 +695,39 @@ static void xlnx_dp_change_graphic_fmt(XlnxDPState *s) case DP_NL_VID_RGBA8880: s->v_plane.format =3D PIXMAN_x8b8g8r8; break; + case DP_NL_VID_CR_Y0_CB_Y1: + case DP_NL_VID_Y0_CR_Y1_CB: + case DP_NL_VID_YV16: + case DP_NL_VID_YV24: + case DP_NL_VID_YV16CL: + case DP_NL_VID_MONO: + case DP_NL_VID_YV16CL2: + case DP_NL_VID_YUV444: + case DP_NL_VID_RGB888: + case DP_NL_VID_RGB888_10BPC: + case DP_NL_VID_YUV444_10BPC: + case DP_NL_VID_YV16CL2_10BPC: + case DP_NL_VID_YV16CL_10BPC: + case DP_NL_VID_YV16_10BPC: + case DP_NL_VID_YV24_10BPC: + case DP_NL_VID_Y_ONLY_10BPC: + case DP_NL_VID_YV16_420: + case DP_NL_VID_YV16CL_420: + case DP_NL_VID_YV16CL2_420: + case DP_NL_VID_YV16_420_10BPC: + case DP_NL_VID_YV16CL_420_10BPC: + case DP_NL_VID_YV16CL2_420_10BPC: + qemu_log_mask(LOG_UNIMP, "%s: unimplemented video format %u", + __func__, + s->avbufm_registers[AV_BUF_FORMAT] & DP_NL_VID_FMT_M= ASK); + s->v_plane.format =3D PIXMAN_x8b8g8r8; + break; default: - error_report("%s: unsupported video format %u", __func__, - s->avbufm_registers[AV_BUF_FORMAT] & DP_NL_VID_FMT_MA= SK); - abort(); + qemu_log_mask(LOG_UNIMP, "%s: invalid video format %u", + __func__, + s->avbufm_registers[AV_BUF_FORMAT] & DP_NL_VID_FMT_M= ASK); + s->v_plane.format =3D PIXMAN_x8b8g8r8; + break; } =20 xlnx_dp_recreate_surface(s); --=20 2.43.0