On Tue, 2005-06-28 at 15:17 -0400, Jon Smirl wrote:
> I don't think the radeon driver works at all with this patch,
> 
> [drm] Initialized drm 1.0.0 20040925
> [drm:drm_init]
> [drm:drm_get_dev]
> [drm:drm_addmap] offset = 0xfe9e0000, size = 0x00010000, type = 1
> [drm:drm_addmap] offset = 0xf4000000, size = 0x04000000, type = 0
> 
> Maps are added in radeon_preinit
> 
> [drm:radeon_preinit] AGP card detected
> [drm:drm_ctxbitmap_next] drm_ctxbitmap_next bit : 0
> [drm:drm_ctxbitmap_init] drm_ctxbitmap_init : 0
> [drm:drm_get_head]
> [drm:drm_get_head] new minor assigned 0
> [drm] Initialized radeon 1.16.0 20050311 on minor 0: ATI Technologies
> Inc Radeon RV250 If [Radeon 9000]
> [drm] Used old pci detect: framebuffer loaded
> [drm:drm_stub_open]
> 
> open inside drmOpen() call
> 
> [drm:drm_open_helper] pid = 12797, minor = 0
> [drm:radeon_driver_open_helper]
> [drm:drm_setup]
> [drm:drm_ioctl] pid=12797, cmd=0xc0246400, nr=0x00, dev 0xe200, auth=0
> [drm:drm_ioctl] pid=12797, cmd=0xc0246400, nr=0x00, dev 0xe200, auth=0
> [drm:drm_release] open_count = 1
> [drm:drm_release] pid = 12797, device = 0xe200, open_count = 1
> [drm:drm_fasync] fd = -1, device = 0xe200
> [drm:drm_takedown]
> 
> maps get destroyed
> 
> [drm:radeon_do_cleanup_cp]
> [drm:drm_takedown] driver pretakedown completed
> [drm:drm_rmmap_locked] mtrr_del=2
> [drm:drm_takedown] takedown completed
> [drm:drm_stub_open]
> [drm:drm_open_helper] pid = 12797, minor = 0
> [drm:radeon_driver_open_helper]
> [drm:drm_setup]
> [drm:drm_ioctl] pid=12797, cmd=0xc0246400, nr=0x00, dev 0xe200, auth=0
> [drm:drm_ioctl] pid=12797, cmd=0xc0246400, nr=0x00, dev 0xe200, auth=0
> [drm:drm_ioctl] pid=12797, cmd=0xc0086401, nr=0x01, dev 0xe200, auth=0
> [drm:drm_ioctl] pid=12797, cmd=0xc0086401, nr=0x01, dev 0xe200, auth=0
> [drm:drm_ioctl] pid=12797, cmd=0xc0186404, nr=0x04, dev 0xe200, auth=0
> 
> My driver looks for maps, there are none, it exits.

Do you have any local diffs?  I'm unclear how you got from takedown
(nobody has the device open any more) to issuing ioctls without preinit
having happened.

Ahh, we needed this setup to happen in "presetup" not "preinit."  Radeon
still works normally because the X Server just recreates the maps.  Your
driver worked previously because framebuffer and register mappings
conveniently weren't torn down during takedown.

I'll fix this, but I'd like to rename these hooks so mortals can guess
what they mean.  How about:

preinit         ->      preload         (module load)
postinit        ->      postload        (module load)
postcleanup     ->      postunload      (module unload)
open_helper     ->      open            (user opening the device)
prerelease      ->      preclose        (user closing the device)
free_filp_priv  ->      postclose       (user closing the device)
presetup        ->      firstopen       (first open of the device)
postsetup       ->      goes away
pretakedown     ->      lastclose       (last user closing the device)
release         ->      goes away

For the "goes away":
"postsetup" isn't used by anybody.
"release" is only used by i830 and i810, to call reclaim_buffers, which
gets called again by the DRM core immediately afterwards.

Anyone have better suggestions for the naming of these hooks?

An alternative to making map init happen in "firstopen" would be to make
it happen in "preload" and have a flag in the map to say "don't kill me
on lastclose, kill me on unload."  I haven't heard a convincing argument
for this in the non-consistent-PCI case, but I'm concerned that in the
consistent PCI case we don't want to be keeping a large,
non-user-configurable chunk of contiguous bus-accessible space around.

-- 
Eric Anholt                                     [EMAIL PROTECTED]
http://people.freebsd.org/~anholt/              [EMAIL PROTECTED]


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to