From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [RFC][PATCH] gpu:drm:i915:intel_detect_pch: back to check devfn instead of check class type Date: Mon, 7 Jul 2014 16:49:17 +0200 Message-ID: <20140707144917.GZ5821@phenom.ffwll.local> References: <1403171631-3452-1-git-send-email-tiejun.chen@intel.com> <53A42DAA.80406@redhat.com> <53A692F9.3060200@intel.com> <53AA70C0.2000806@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-we0-f175.google.com (mail-we0-f175.google.com [74.125.82.175]) by gabe.freedesktop.org (Postfix) with ESMTP id 61AE26E2CE for ; Mon, 7 Jul 2014 07:49:11 -0700 (PDT) Received: by mail-we0-f175.google.com with SMTP id k48so4483941wev.6 for ; Mon, 07 Jul 2014 07:49:10 -0700 (PDT) Content-Disposition: inline In-Reply-To: <53AA70C0.2000806@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Paolo Bonzini Cc: xen-devel@lists.xensource.com, daniel.vetter@ffwll.ch, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, qemu-devel@nongnu.org, dri-devel@lists.freedesktop.org, "Chen, Tiejun" List-Id: dri-devel@lists.freedesktop.org On Wed, Jun 25, 2014 at 08:48:32AM +0200, Paolo Bonzini wrote: > It is only slightly better, but the right solution is to fix the driver. > There is absolutely zero reason why a graphics driver should know about the > vendor/device ids of the PCH. There is a very valid reason to know about the PCH since it _is_ part of the gpu. You don't notice this all that much in the driver since the hardware provides magic mmio regions in the main vga device register bar which remap to the relevant PCH register ranges. And an awful lot of other stuff like the MCH. So from an abstract pov you could only pass the intel igt to a guest if you'd forward the gfx device, the mch/host bridge and the pch. Thanks to these magic mmio windows we don't need those, except that someone forgot to forward the pch pci id. So the correct fix to forward intel gpus to guests is indeed to somehow fake the pch pci ids since the driver really needs them. Gross design, but that's how the hardware works. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch