From patchwork Thu Jan 31 22:01:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 217259 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E51D72C0091 for ; Fri, 1 Feb 2013 09:02:30 +1100 (EST) Received: from localhost ([::1]:33210 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U12DF-0002Dd-3l for incoming@patchwork.ozlabs.org; Thu, 31 Jan 2013 17:02:29 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U12D7-0002C2-Qv for qemu-devel@nongnu.org; Thu, 31 Jan 2013 17:02:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U12D6-0003KK-ID for qemu-devel@nongnu.org; Thu, 31 Jan 2013 17:02:21 -0500 Received: from mout.web.de ([212.227.15.4]:62186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U12D3-0003JU-9f; Thu, 31 Jan 2013 17:02:17 -0500 Received: from localhost.localdomain ([84.148.60.163]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0Llna8-1Ua5u248Z6-00Zpq8; Thu, 31 Jan 2013 23:01:43 +0100 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Thu, 31 Jan 2013 23:01:36 +0100 Message-Id: <1359669697-5881-2-git-send-email-andreas.faerber@web.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1359669697-5881-1-git-send-email-andreas.faerber@web.de> References: <1359669697-5881-1-git-send-email-andreas.faerber@web.de> MIME-Version: 1.0 X-Provags-ID: V02:K0:ZShpxyNC+3GsEO8GQ3IJAGs8B4p0q6Ht9rpa47YPzK4 A+7qvrXBp/4XpvqLcqiAnQyVEtyTO1WaTYXadQVpO/7ZBLCyZN ZzCVJsIumAxEX8LWhD2APJ1+y+AxuLzMfJuSJK9qCMnpdXh/mx EbPnB9wJcnCb4ffDT6cnbacb4lX7fpsmuu605plw29UrnR8m6K OQU2oceoPxaaA7Rvokx7A== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.15.4 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , Henry Harrington , "1.3.x" , Anthony Liguori Subject: [Qemu-devel] [PATCH 1/2] cocoa: Fix VBE function Set Display Start X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Henry Harrington Register a dpy_gfx_setdata callback so that the Cocoa code is notified whenever the screen start address changes. Commit 1d3323d has a similar fix for the VNC UI. Signed-off-by: Henry Harrington Cc: qemu-stable@nongnu.org (1.3.x) Signed-off-by: Andreas Färber --- ui/cocoa.m | 21 +++++++++++++++++++++ 1 Datei geändert, 21 Zeilen hinzugefügt(+) diff --git a/ui/cocoa.m b/ui/cocoa.m index 3bf1c6e..fbd7386 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -265,6 +265,7 @@ static int cocoa_keycode_to_qemu(int keycode) BOOL isTabletEnabled; } - (void) resizeContentToWidth:(int)w height:(int)h displayState:(DisplayState *)ds; +- (void) updateDataOffset:(DisplayState *)ds; - (void) grabMouse; - (void) ungrabMouse; - (void) toggleFullScreen:(id)sender; @@ -429,6 +430,20 @@ QemuCocoaView *cocoaView; [self setFrame:NSMakeRect(cx, cy, cw, ch)]; } +- (void) updateDataOffset:(DisplayState *)ds +{ + COCOA_DEBUG("QemuCocoaView: UpdateDataOffset\n"); + + // update screenBuffer + if (dataProviderRef) { + CGDataProviderRelease(dataProviderRef); + } + + size_t size = ds_get_width(ds) * 4 * ds_get_height(ds); + dataProviderRef = CGDataProviderCreateWithData(NULL, ds_get_data(ds), + size, NULL); +} + - (void) toggleFullScreen:(id)sender { COCOA_DEBUG("QemuCocoaView: toggleFullScreen\n"); @@ -1004,6 +1019,11 @@ static void cocoa_refresh(DisplayState *ds) vga_hw_update(); } +static void cocoa_setdata(DisplayState *ds) +{ + [cocoaView updateDataOffset:ds]; +} + static void cocoa_cleanup(void) { COCOA_DEBUG("qemu_cocoa: cocoa_cleanup\n"); @@ -1020,6 +1040,7 @@ void cocoa_display_init(DisplayState *ds, int full_screen) dcl->dpy_gfx_update = cocoa_update; dcl->dpy_gfx_resize = cocoa_resize; dcl->dpy_refresh = cocoa_refresh; + dcl->dpy_gfx_setdata = cocoa_setdata; register_displaychangelistener(ds, dcl);