Bug 17054 - mesa/drm: compilation broken for i915 module with 2.6.26 kernel
Summary: mesa/drm: compilation broken for i915 module with 2.6.26 kernel
Status: RESOLVED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/other (show other bugs)
Version: XOrg git
Hardware: All Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-10 00:28 UTC by Magnus Kessler
Modified: 2009-10-14 09:30 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
(very probably broken) patch to make drm-gem compile against last linux-git (1.13 KB, patch)
2008-08-12 07:58 UTC, Frederik Nosi
no flags Details | Splinter Review
trivial fixes to drm-gem to make it compile on latest git kernel (1.69 KB, patch)
2008-08-12 07:59 UTC, Frederik Nosi
no flags Details | Splinter Review

Description Magnus Kessler 2008-08-10 00:28:51 UTC
When compiling the current git HEAD of mesa/drm I get the following 
compilation error with gcc 4.3.1 (64-bit) on linux 2.6.26:

drm/linux-core/i915_gem_tiling.c: In 
function ‘i915_gem_detect_bit_6_swizzle’:
drm/linux-core/i915_gem_tiling.c:118: error: implicit declaration of 
function ‘pci_read_base’

According to Shuang He (intel, http://lists.freedesktop.org/archives/xorg/2008-August/037917.html) some patches contained in Eric Anholts kernel tree (git://people.freedesktop.org/~anholt/linux-2.6 drm-gem-merge) are needed.
Comment 1 Shuang He 2008-08-11 01:38:39 UTC
Pls try latest drm bits, as Dave Airlie has some fix for this.
Comment 2 Frederik Nosi 2008-08-12 07:58:17 UTC
Created attachment 18237 [details] [review]
(very probably broken) patch to make drm-gem compile against last linux-git

I have the same problem too. I noticed that i can use David's kernel git repository and the compile can go fine (checking the sources so it seems) but i'm trying to keep up with Linus's repo having to use some other patches too. and on the .27 onward version i see that the pci functions used in dri have changed some parameters.
Tried to adapt the code half blindly as i know nearly zero on the hardware side, made it even compile but it seems not to work in practice. I get this logs when loading drm.ko and i915.ko from drm/linux-support:

Aug 10 04:08:20 kotys [drm] Initialized drm 1.1.0 20060810
Aug 10 04:08:30 kotys i915 0000:00:02.0: setting latency timer to 64
Aug 10 04:08:30 kotys [drm:i915_gem_detect_bit_6_swizzle] *ERROR* pci_read_base failed: -2
Aug 10 04:08:30 kotys [drm] Initialized i915 1.13.0 20080730 on minor 0

And sure it's on the function i'm trying to adapt. Anyway except this log that makes me think that something isn't working i get direct rendering and things are working exactly as without the patch.

I'm attaching my (probably broken) patch against linux-git in case somebody can help make this work.

I had to made some trivial changes on drm side too for making it compile so I'm adding those too.
Comment 3 Frederik Nosi 2008-08-12 07:59:00 UTC
Created attachment 18238 [details] [review]
trivial fixes to drm-gem to make it compile on latest git kernel
Comment 4 Frederik Nosi 2008-08-12 08:05:52 UTC
(In reply to comment #3)
> Created an attachment (id=18238) [details]
> trivial fixes to drm-gem to make it compile on latest git kernel
> 

I generated the reverse patch for this one so apply it with --reverse in case. Sorry for the trouble.
Comment 5 Chris Salch 2008-09-02 22:23:39 UTC
It might be worthwhile to take a look at this:

http://archive.netbsd.se/view_attachment.php?id=7966394.107463
Comment 6 Magnus Kessler 2009-10-14 01:55:39 UTC
Can this bug be closed? 2.6.26 is not a long-term maintained kernel, and current kernels have moved away from having an external drm kernel module tree.
Comment 7 Chris Salch 2009-10-14 06:23:11 UTC
I'm running 2.6.31 on any system that counts now, no objections here.  Although, I wasn't the one who opened the bug.
Comment 8 Eric Anholt 2009-10-14 09:30:36 UTC
the i915 kernel module in the external tree is long dead.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.