From: Dave Gordon <david.s.gordon@intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 5/6] drm/i915: Support for pread/pwrite from/to non shmem backed objects
Date: Tue, 15 Dec 2015 16:22:51 +0000 [thread overview]
Message-ID: <56703E5B.8090900@intel.com> (raw)
In-Reply-To: <20151211181541.GQ20822@phenom.ffwll.local>
On 11/12/15 18:15, Daniel Vetter wrote:
> On Wed, Dec 09, 2015 at 07:39:56PM +0000, Dave Gordon wrote:
>> On 09/12/15 16:15, Tvrtko Ursulin wrote:
>>>
>>> Hi,
>>>
>>> On 09/12/15 12:46, ankitprasad.r.sharma@intel.com wrote:
>>>> From: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
>>>>
>>>> This patch adds support for extending the pread/pwrite functionality
>>>> for objects not backed by shmem. The access will be made through
>>>> gtt interface. This will cover objects backed by stolen memory as well
>>>> as other non-shmem backed objects.
>>>>
>>>> v2: Drop locks around slow_user_access, prefault the pages before
>>>> access (Chris)
>>>>
>>>> v3: Rebased to the latest drm-intel-nightly (Ankit)
>>>>
>>>> v4: Moved page base & offset calculations outside the copy loop,
>>>> corrected data types for size and offset variables, corrected if-else
>>>> braces format (Tvrtko/kerneldocs)
>>>>
>>>> v5: Enabled pread/pwrite for all non-shmem backed objects including
>>>> without tiling restrictions (Ankit)
>>>>
>>>> v6: Using pwrite_fast for non-shmem backed objects as well (Chris)
>>>>
>>>> v7: Updated commit message, Renamed i915_gem_gtt_read to
>>>> i915_gem_gtt_copy,
>>>> added pwrite slow path for non-shmem backed objects (Chris/Tvrtko)
>>>>
>>>> v8: Updated v7 commit message, mutex unlock around pwrite slow path for
>>>> non-shmem backed objects (Tvrtko)
>>>>
>>>> Testcase: igt/gem_stolen
>>>>
>>>> Signed-off-by: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
>>>> ---
>>>> drivers/gpu/drm/i915/i915_gem.c | 151
>>>> +++++++++++++++++++++++++++++++++-------
>>>> 1 file changed, 127 insertions(+), 24 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/i915/i915_gem.c
[snip!]
>>>> static int
>>>> i915_gem_shmem_pread(struct drm_device *dev,
>>>> struct drm_i915_gem_object *obj,
>>>> @@ -737,17 +830,14 @@ i915_gem_pread_ioctl(struct drm_device *dev,
>>>> void *data,
>>>> goto out;
>>>> }
>>>>
>>>> - /* prime objects have no backing filp to GEM pread/pwrite
>>>> - * pages from.
>>>> - */
>>>> - if (!obj->base.filp) {
>>>> - ret = -EINVAL;
>>>> - goto out;
>>>> - }
>>>> -
>>>> trace_i915_gem_object_pread(obj, args->offset, args->size);
>>>>
>>>> - ret = i915_gem_shmem_pread(dev, obj, args, file);
>>>> + /* pread for non shmem backed objects */
>>>> + if (!obj->base.filp && obj->tiling_mode == I915_TILING_NONE)
>>>> + ret = i915_gem_gtt_copy(dev, obj, args->size,
>>>> + args->offset, args->data_ptr);
>>>> + else
>>>> + ret = i915_gem_shmem_pread(dev, obj, args, file);
>>>
>>> Hm, it will end up calling i915_gem_shmem_pread for non-shmem backed
>>> objects if tiling is set. Sounds wrong to me unless I am missing something?
>>
>> Which GEM objects have obj->base.filp set? Is it ONLY regular gtt-type
>
> obj->base.filp is for shmem backed stuff. gtt is irrelevant for backing
> storage, well except if you can't read the shmem stuff directly with the
> cpu the only way is to go through a gtt device mapping.
> -Daniel
So obj->base.filp is set for both phys and shmem (default) object types;
I called the latter a "gtt" type just because the get/put_pages()
functions have "gtt" in their names). But I note that the naming of GEM
object vfuncs (and vfunc tables) isn't consistent :( Maybe they should
be named "i915_gem_object_{get,put}_pages_shmem()", and the table would
then be i915_gem_object_shmem_ops :)
.Dave.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-12-15 16:22 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-09 12:46 [PATCH v10 0/6] Support for creating/using Stolen memory backed objects ankitprasad.r.sharma
2015-12-09 12:46 ` [PATCH 1/6] drm/i915: Clearing buffer objects via CPU/GTT ankitprasad.r.sharma
2015-12-09 13:26 ` Dave Gordon
2015-12-10 10:02 ` Ankitprasad Sharma
2015-12-09 13:30 ` Tvrtko Ursulin
2015-12-09 13:57 ` Tvrtko Ursulin
2015-12-10 10:23 ` Ankitprasad Sharma
2015-12-09 13:57 ` Chris Wilson
2015-12-10 10:27 ` Ankitprasad Sharma
2015-12-09 12:46 ` [PATCH 2/6] drm/i915: Support for creating Stolen memory backed objects ankitprasad.r.sharma
2015-12-09 14:06 ` Tvrtko Ursulin
2015-12-11 11:22 ` Ankitprasad Sharma
2015-12-11 12:19 ` Tvrtko Ursulin
2015-12-11 12:49 ` Dave Gordon
2015-12-11 18:13 ` Daniel Vetter
2015-12-09 12:46 ` [PATCH 3/6] drm/i915: Propagating correct error codes to the userspace ankitprasad.r.sharma
2015-12-09 15:10 ` Tvrtko Ursulin
2015-12-09 12:46 ` [PATCH 4/6] drm/i915: Add support for stealing purgable stolen pages ankitprasad.r.sharma
2015-12-09 15:40 ` Tvrtko Ursulin
2015-12-09 12:46 ` [PATCH 5/6] drm/i915: Support for pread/pwrite from/to non shmem backed objects ankitprasad.r.sharma
2015-12-09 16:15 ` Tvrtko Ursulin
2015-12-09 19:39 ` Dave Gordon
2015-12-10 11:12 ` Ankitprasad Sharma
2015-12-10 18:18 ` Dave Gordon
2015-12-11 5:22 ` Ankitprasad Sharma
2015-12-11 18:15 ` Daniel Vetter
2015-12-15 16:22 ` Dave Gordon [this message]
2015-12-10 10:54 ` Ankitprasad Sharma
2015-12-10 11:00 ` Ankitprasad Sharma
2015-12-09 12:46 ` [PATCH 6/6] drm/i915: Migrate stolen objects before hibernation ankitprasad.r.sharma
2015-12-09 17:25 ` Tvrtko Ursulin
2015-12-09 19:24 ` Ville Syrjälä
2015-12-10 13:17 ` Ankitprasad Sharma
2015-12-09 19:35 ` Dave Gordon
2015-12-10 9:43 ` Tvrtko Ursulin
2015-12-10 13:17 ` Ankitprasad Sharma
2015-12-10 14:15 ` Tvrtko Ursulin
2015-12-10 18:00 ` Dave Gordon
2015-12-11 5:19 ` Ankitprasad Sharma
2015-12-11 5:16 ` Ankitprasad Sharma
2015-12-11 12:33 ` Tvrtko Ursulin
-- strict thread matches above, loose matches on Subject: below --
2015-11-11 10:36 [PATCH v9 0/6] Support for creating/using Stolen memory backed objects ankitprasad.r.sharma
2015-11-11 10:36 ` [PATCH 5/6] drm/i915: Support for pread/pwrite from/to non shmem " ankitprasad.r.sharma
2015-11-13 17:23 ` Tvrtko Ursulin
2015-11-20 9:30 ` Ankitprasad Sharma
2015-10-08 6:24 [PATCH v8 0/6] Support for creating/using Stolen memory " ankitprasad.r.sharma
2015-10-08 6:24 ` [PATCH 5/6] drm/i915: Support for pread/pwrite from/to non shmem " ankitprasad.r.sharma
2015-10-08 13:56 ` Tvrtko Ursulin
2015-10-28 11:18 ` Ankitprasad Sharma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56703E5B.8090900@intel.com \
--to=david.s.gordon@intel.com \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.