Bug 32325

Summary: [radeon] DRM version check only looks at minor number.
Product: Mesa Reporter: Chris Rankin <rankincj>
Component: Drivers/DRI/R100Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: [PATCH] Enable HyperZ and microtiling for R100 if DRM >= v2.x
[PATCH] Don't even consider enabling HyperZ or microtiling unless DRM major version is 1.

Description Chris Rankin 2010-12-11 14:33:11 UTC
Created attachment 41020 [details] [review]
[PATCH] Enable HyperZ and microtiling for R100 if DRM >= v2.x

I have noticed that Mesa 7.9 prints the following message with a recent 2.6.3x kernel:

"DRM version 1.6 too old to support HyperZ, disabling."

The reason for this is that the DRM in the 2.6.36 kernel is v2.6:

[drm] Initialized radeon 2.6.0 20080528 for 0000:01:00.0 on minor 0

and Mesa only checks the minor version number. (Assuming that the major version number is always 1.)

I have attached a patch that will also enable both HyperZ and texture microtiling(?) on R100 if DRM >= v2.x.
Comment 1 Chris Rankin 2010-12-11 14:58:51 UTC
There is a similar absence of DRM major version number checking in the
radeonCreateScreen() function in radeon_screen.c. (This probably affect r600c as well, seeing as how the file is shared.)

And radeonInitContext() in radeon_common_context.c only loads the DRM minor version into the DRI fields:

        /* DRI fields */
        radeon->dri.context = driContextPriv;
        radeon->dri.screen = sPriv;
        radeon->dri.hwContext = driContextPriv->hHWContext;
        radeon->dri.hwLock = &sPriv->pSAREA->lock;
        radeon->dri.hwLockCount = 0;
        radeon->dri.fd = sPriv->fd;
        radeon->dri.drmMinor = sPriv->drm_version.minor;

Is this enough now?
Comment 2 Chris Rankin 2010-12-12 06:07:52 UTC
Created attachment 41038 [details] [review]
[PATCH] Don't even consider enabling HyperZ or microtiling unless DRM major version is 1.

If DRM v2.x can't support this yet then the current DRM version check in Mesa is no longer adequate.
Comment 3 GitLab Migration User 2019-09-18 18:40:10 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/277.

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.