Re: [PATCH] Export shmem_file_setup and shmem_getpage for DRM-GEM

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Keith Packard
Date: Monday, August 4, 2008 - 4:45 am

On Mon, 2008-08-04 at 20:43 +1000, Nick Piggin wrote:


We considered using anonymous pages, but as the user-mapping is not a
feature, it seemed like it wasn't the right model. Plus, many of these
objects need to be shared across multiple processes, so anonymous pages
would be a pain there.


Ok, that's useful information which isn't clear from the docs.


That does look a lot more like what I want, as it returns an unlocked
page. And, makes my code look cleaner to boot:

        inode =3D obj->filp->f_path.dentry->d_inode;
        mapping =3D inode->i_mapping;
        for (i =3D 0; i < page_count; i++) {
                page =3D read_mapping_page(mapping, i, NULL);
                if (IS_ERR(page)) {
                        ret =3D PTR_ERR(page);
                        DRM_ERROR("read_mapping_page failed: %d\n", ret);
                        i915_gem_object_free_page_list(obj);
                        return ret;
                }
                obj_priv->page_list[i] =3D page;
        }

Does this look like it conforms to the vfs api? It appears to work when
using shmem at least.


Yup, I'm liking the general file mechanism, I used shmem only because
that seemed like the obvious file system you'd want underneath these
objects.

--=20
keith.packard@intel.com
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] PCI: Add pci_read_base() API, Eric Anholt, (Thu Jul 31, 11:58 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for ..., Christoph Hellwig, (Fri Aug 1, 1:50 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for ..., Keith Packard, (Mon Aug 4, 4:45 am)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for ..., Stephane Marchesin, (Wed Aug 6, 9:20 am)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for ..., Arjan van de Ven, (Wed Aug 6, 10:24 am)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for ..., Stephane Marchesin, (Wed Aug 6, 10:32 am)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for ..., Stephane Marchesin, (Wed Aug 6, 11:09 am)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for ..., Stephane Marchesin, (Wed Aug 6, 7:16 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for ..., Christoph Hellwig, (Sun Aug 10, 6:23 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for ..., Christoph Hellwig, (Sun Aug 10, 6:30 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for ..., Christoph Hellwig, (Sun Aug 10, 6:34 pm)
Re: [PATCH] Export shmem_file_setup for DRM-GEM, Keith Packard, (Sun Aug 10, 8:03 pm)