Re: DRM mappings cleanup

2005-06-28 Thread Jon Smirl
list = drm_alloc(sizeof(*list), DRM_MEM_MAPS); memset(list, 0, sizeof(*list)); same as drm_calloc() -- Jon Smirl [EMAIL PROTECTED] --- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simpl

Re: DRM mappings cleanup

2005-06-28 Thread Jon Smirl
This ... if (found_map->size != map->size) { DRM_DEBUG("Matching maps of type %d with " "mismatched sizes, (%ld vs %ld)\n", map->type, map->size, found_map->size);

Re: DRM mappings cleanup

2005-06-28 Thread Jon Smirl
These should be inlines in an h file. There people on lkml that will complain about unneeded symbol exports. unsigned long drm_get_resource_start(drm_device_t *dev, unsigned int resource) { return pci_resource_start(dev->pdev, resource); } EXPORT_SYMBOL(drm_get_resource_start); unsigned l

Re: DRM mappings cleanup

2005-06-28 Thread Jon Smirl
You can make AddMap simpler by using a stack based drm_map_t and then allocating the real one at the end. It lets you remove all of the drm_free(map, sizeof(*map), DRM_MEM_MAPS); This should be done at the very end after all of the error returns: if (drm_core_has_MTRR(dev)) {

Re: DRM mappings cleanup

2005-06-28 Thread Jon Smirl
On 6/28/05, Eric Anholt <[EMAIL PROTECTED]> wrote: > I've just committed the previous diff, with the move to presetup. I'm > now looking at 2 things: > - Cleaning up driver hooks as previously described, so I can propose a > patch for it. > - Getting BSD working again. I think this is going to re

Re: DRM mappings cleanup

2005-06-28 Thread Eric Anholt
On Tue, 2005-06-28 at 16:36 -0400, Jon Smirl wrote: > On 6/28/05, Eric Anholt <[EMAIL PROTECTED]> wrote: > > On Tue, 2005-06-28 at 16:22 -0400, Jon Smirl wrote: > > > This fixes so that my egl driver will get started. You probably need > > > to test it further. > > > > > > You are creating the maps

Re: DRM mappings cleanup

2005-06-28 Thread Jon Smirl
On 6/28/05, Eric Anholt <[EMAIL PROTECTED]> wrote: > On Tue, 2005-06-28 at 16:22 -0400, Jon Smirl wrote: > > This fixes so that my egl driver will get started. You probably need > > to test it further. > > > > You are creating the maps in radeon_preinit and it only gets called > > once at driver lo

Re: DRM mappings cleanup

2005-06-28 Thread Eric Anholt
On Tue, 2005-06-28 at 16:22 -0400, Jon Smirl wrote: > This fixes so that my egl driver will get started. You probably need > to test it further. > > You are creating the maps in radeon_preinit and it only gets called > once at driver load time. Map creation needs to be moved over to the > open_hel

Re: DRM mappings cleanup

2005-06-28 Thread Jon Smirl
This fixes so that my egl driver will get started. You probably need to test it further. You are creating the maps in radeon_preinit and it only gets called once at driver load time. Map creation needs to be moved over to the open_help function so they will get rebuilt each time. -- Jon Smirl [E

Re: DRM mappings cleanup

2005-06-28 Thread Eric Anholt
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 = 0xfe9e, size = 0x0001, type = 1 > [drm:drm_addmap] offset = 0xf4

Re: DRM mappings cleanup

2005-06-28 Thread Jon Smirl
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 = 0xfe9e, size = 0x0001, type = 1 [drm:drm_addmap] offset = 0xf400, size = 0x0400, type = 0 Maps are added in radeon_preinit

Re: DRM mappings cleanup

2005-06-28 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Eric Anholt wrote: > On Mon, 2005-06-27 at 12:13 -0700, Ian Romanick wrote: > >>Does this maintain the 256-byte alignment requirement for the WARP >>microcode? > > Addmap aligns to the same size as the allocation itself. I just assumed > that the wa

Re: DRM mappings cleanup

2005-06-27 Thread Benjamin Herrenschmidt
On Mon, 2005-06-27 at 20:38 -0400, Jon Smirl wrote: > I split it into initmap/addmap to allow reset to work. You can't bring > the radeon up until it is reset, the driver will error out. This > allowed a DRM based reset app to map the registers and run the reset > program without bringing up the fu

Re: DRM mappings cleanup

2005-06-27 Thread Eric Anholt
On Mon, 2005-06-27 at 21:01 -0400, Jon Smirl wrote: > I was also working towards a goal of having everything be permanent > maps and all be created at initialization time. Future users could > then run without needing AddMap. They would just call GetMap to > search for the map that they needed. O

Re: DRM mappings cleanup

2005-06-27 Thread Jon Smirl
I was also working towards a goal of having everything be permanent maps and all be created at initialization time. Future users could then run without needing AddMap. They would just call GetMap to search for the map that they needed. Old code would keep calling AddMap which would return the mat

Re: DRM mappings cleanup

2005-06-27 Thread Jon Smirl
I split it into initmap/addmap to allow reset to work. You can't bring the radeon up until it is reset, the driver will error out. This allowed a DRM based reset app to map the registers and run the reset program without bringing up the full driver. After reset is complete you could init the driver

Re: DRM mappings cleanup

2005-06-27 Thread Eric Anholt
On Mon, 2005-06-27 at 12:13 -0700, Ian Romanick wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Eric Anholt wrote: > > > The diff is about +190, -390 lines. Anyone want to review it first, > > since I have a tendency to under-test on linux? > > I've looked over the changes, and I'm

Re: DRM mappings cleanup

2005-06-27 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Eric Anholt wrote: > The diff is about +190, -390 lines. Anyone want to review it first, > since I have a tendency to under-test on linux? I've looked over the changes, and I'm generally happy with them. There are a few comments below. I'm pretty

DRM mappings cleanup

2005-06-26 Thread Eric Anholt
Attached is a patch to clean up setup and teardown of maps in Linux. I did it because in the process of making BSD compile again, I kept finding things that needed to be cleaned up and were making it harder to get BSD working again, and it was too much doing both OSes at once. I'd like to get it