From patchwork Mon Dec 14 20:21:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 41127 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 99713B6EF5 for ; Tue, 15 Dec 2009 07:25:49 +1100 (EST) Received: from localhost ([127.0.0.1]:44349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKHUI-0006Ry-Af for incoming@patchwork.ozlabs.org; Mon, 14 Dec 2009 15:25:46 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NKHQm-0003HG-G1 for qemu-devel@nongnu.org; Mon, 14 Dec 2009 15:22:08 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NKHQh-0003DK-Qe for qemu-devel@nongnu.org; Mon, 14 Dec 2009 15:22:07 -0500 Received: from [199.232.76.173] (port=45612 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKHQh-0003DG-IY for qemu-devel@nongnu.org; Mon, 14 Dec 2009 15:22:03 -0500 Received: from e5.ny.us.ibm.com ([32.97.182.145]:48096) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NKHQh-0007V9-Bt for qemu-devel@nongnu.org; Mon, 14 Dec 2009 15:22:03 -0500 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by e5.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id nBEKAJBG023398 for ; Mon, 14 Dec 2009 15:10:19 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nBEKLodN142736 for ; Mon, 14 Dec 2009 15:21:50 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nBEKLnCZ008441 for ; Mon, 14 Dec 2009 18:21:50 -0200 Received: from localhost.localdomain (sig-9-65-58-10.mts.ibm.com [9.65.58.10]) by d01av02.pok.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id nBEKLiwL008070; Mon, 14 Dec 2009 18:21:45 -0200 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Mon, 14 Dec 2009 14:21:41 -0600 Message-Id: <1260822101-29530-1-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.6.2.5 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Anthony Liguori , Yaniv Kaul Subject: [Qemu-devel] [PATCH] vnc: hextile: do not generate ForegroundSpecified and SubrectsColoured tiles X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This violates the RFB specification (section 6.6.4). It happens to work with most clients but it's still wrong. Reported-by: Yaniv Kaul Signed-off-by: Anthony Liguori --- vnchextile.h | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/vnchextile.h b/vnchextile.h index c96ede3..432ed89 100644 --- a/vnchextile.h +++ b/vnchextile.h @@ -73,7 +73,7 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs, *last_bg = bg; } - if (!*has_fg || *last_fg != fg) { + if (n_colors < 3 && (!*has_fg || *last_fg != fg)) { flags |= 0x04; *has_fg = 1; *last_fg = fg; @@ -165,8 +165,6 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs, irow += ds_get_linesize(vs->ds) / sizeof(pixel_t); } - /* A SubrectsColoured subtile invalidates the foreground color */ - *has_fg = 0; if (n_data > (w * h * sizeof(pixel_t))) { n_colors = 4; flags = 0x01;