From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Viy0s-0004Lh-5N for qemu-devel@nongnu.org; Tue, 19 Nov 2013 21:59:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Viy0q-0001mS-Im for qemu-devel@nongnu.org; Tue, 19 Nov 2013 21:59:34 -0500 Received: from mail-lb0-x231.google.com ([2a00:1450:4010:c04::231]:60645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Viy0q-0001mN-A4 for qemu-devel@nongnu.org; Tue, 19 Nov 2013 21:59:32 -0500 Received: by mail-lb0-f177.google.com with SMTP id w7so3000533lbi.36 for ; Tue, 19 Nov 2013 18:59:31 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1384848690.16718.139.camel@nilsson.home.kraxel.org> References: <1384848690.16718.139.camel@nilsson.home.kraxel.org> Date: Wed, 20 Nov 2013 12:59:30 +1000 Message-ID: From: Dave Airlie Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Qemu-devel] console muti-head some more design input List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: "qemu-devel@nongnu.org" On Tue, Nov 19, 2013 at 6:11 PM, Gerd Hoffmann wrote: > Hi, > >> So I felt I had a choice here for sharing a single output surface >> amongst outputs: >> >> a) have multiple QemuConsole reference multiple DisplaySurface wihch >> reference a single pixman image, > > This one. > >> In either case we need to store, width/height of the console and x/y >> offset into the output surface somewhere, as the output dimensions >> will not correspond to surface dimensions or the surface dimensions >> won't correspond to the pixman image dimensions > > Not needed (well, internal to virtio-gpu probably). I think you are only considering output here, for input we definitely need some idea of screen layout, and this needs to be stored somewhere. e.g. SDL2 gets an input event in the right hand window it needs to translate that into an input event on the whole output surface. Have a look the virtio-gpu branch in my repo (don't look at the history, its ugly, just the final state), you'll see code in sdl2.c to do input translation from window coordinates to the overall screen space. So we need at least the x,y offset in the ui code, and I think we need to communicate that via the console. Otherwise I think I've done things the way you've said and it seems to be working for me on a dual-head setup. (oh and yes this all sw rendering only, to do 3D rendering we need to put a thread in to do the GL stuff, but it interacts with the console layer quite a bit, since SDL and the virtio-gpu need to be in the same thread, so things like resize can work). Dave.