From: Damien Lespiau Subject: Playing with the idea of pulling kernel code into i-g-t Date: Wed, 5 Jun 2013 11:59:37 +0100 Message-ID: <1370429978-4288-1-git-send-email-damien.lespiau@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 8A0EEE64D9 for ; Wed, 5 Jun 2013 03:59:47 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org I played a bit with this as that's something thas has been floating around for a bit and could be used for: - unit testing kernel functions (eg. PLL computations) - reuse off some code (intel_reg.h, sideband, device_info struct, ...) - Ville wanted to fuzzy test the EDID code (and has a branch somewhere IIRC) - ... To make it maintainable we could have a script that, when pointed to a kernel, pulls in the needed pieces. A simple form of this is scripts/sync-from-kernel in the following patch. $ ./scripts/sync-from-kernel ../linux-2.6/ Using v3.9-rc1-15371-g393f670 Importing intel_sideband.c You then need a shim layer that replicates what we use from the kernel. A lot can probably be faked without too much trouble. A good use case for that would be to be able to have one master copy of i915_reg.h (the kernel's) and sync it into i-g-t. In any case, the following patch pulls in intel_sideband.c and replaces what we currenlty have. It's aboslutely not tested and might just end up being a pointless exercise... -- Damien