* [PATCH] drm/i915: Treat ringbuffer vaddress type properly when vmapped
@ 2015-10-30 11:39 Mika Kuoppala
2015-10-30 11:42 ` Chris Wilson
0 siblings, 1 reply; 3+ messages in thread
From: Mika Kuoppala @ 2015-10-30 11:39 UTC (permalink / raw)
To: intel-gfx
commit def0c5f6b0cd ("drm/i915: Map the ringbuffer using WB on LLC machines")
enhanced ringbuffer access by vmapping the object instead of doing ioremap.
The address space annotations however have been and should
remain to be __iomem, in order to get warnings if we
dereference the virtual addresses directly instead of using
proper accessors.
To keep sparse happy, use explicit casts to __iomem and back
when we are wb capable.
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
drivers/gpu/drm/i915/intel_ringbuffer.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index c9b081f..97b5654 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -1997,14 +1997,14 @@ static int init_phys_status_page(struct intel_engine_cs *ring)
void intel_unpin_ringbuffer_obj(struct intel_ringbuffer *ringbuf)
{
if (HAS_LLC(ringbuf->obj->base.dev) && !ringbuf->obj->stolen)
- vunmap(ringbuf->virtual_start);
+ vunmap((void __force *)ringbuf->virtual_start);
else
iounmap(ringbuf->virtual_start);
ringbuf->virtual_start = NULL;
i915_gem_object_ggtt_unpin(ringbuf->obj);
}
-static u32 *vmap_obj(struct drm_i915_gem_object *obj)
+static void *vmap_obj(struct drm_i915_gem_object *obj)
{
struct sg_page_iter sg_iter;
struct page **pages;
@@ -2043,7 +2043,7 @@ int intel_pin_and_map_ringbuffer_obj(struct drm_device *dev,
return ret;
}
- ringbuf->virtual_start = vmap_obj(obj);
+ ringbuf->virtual_start = (void __iomem *)vmap_obj(obj);
if (ringbuf->virtual_start == NULL) {
i915_gem_object_ggtt_unpin(obj);
return -ENOMEM;
--
2.5.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915: Treat ringbuffer vaddress type properly when vmapped
2015-10-30 11:39 [PATCH] drm/i915: Treat ringbuffer vaddress type properly when vmapped Mika Kuoppala
@ 2015-10-30 11:42 ` Chris Wilson
2015-10-30 12:28 ` Mika Kuoppala
0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2015-10-30 11:42 UTC (permalink / raw)
To: Mika Kuoppala; +Cc: intel-gfx
On Fri, Oct 30, 2015 at 01:39:24PM +0200, Mika Kuoppala wrote:
> commit def0c5f6b0cd ("drm/i915: Map the ringbuffer using WB on LLC machines")
> enhanced ringbuffer access by vmapping the object instead of doing ioremap.
>
> The address space annotations however have been and should
> remain to be __iomem, in order to get warnings if we
> dereference the virtual addresses directly instead of using
> proper accessors.
>
> To keep sparse happy, use explicit casts to __iomem and back
> when we are wb capable.
Or you could review the patch on list to remove the incorrect iomem.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915: Treat ringbuffer vaddress type properly when vmapped
2015-10-30 11:42 ` Chris Wilson
@ 2015-10-30 12:28 ` Mika Kuoppala
0 siblings, 0 replies; 3+ messages in thread
From: Mika Kuoppala @ 2015-10-30 12:28 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
Chris Wilson <chris@chris-wilson.co.uk> writes:
> On Fri, Oct 30, 2015 at 01:39:24PM +0200, Mika Kuoppala wrote:
>> commit def0c5f6b0cd ("drm/i915: Map the ringbuffer using WB on LLC machines")
>> enhanced ringbuffer access by vmapping the object instead of doing ioremap.
>>
>> The address space annotations however have been and should
>> remain to be __iomem, in order to get warnings if we
>> dereference the virtual addresses directly instead of using
>> proper accessors.
>>
>> To keep sparse happy, use explicit casts to __iomem and back
>> when we are wb capable.
>
> Or you could review the patch on list to remove the incorrect iomem.
Yes, ignore this patch.
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-30 12:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-30 11:39 [PATCH] drm/i915: Treat ringbuffer vaddress type properly when vmapped Mika Kuoppala
2015-10-30 11:42 ` Chris Wilson
2015-10-30 12:28 ` Mika Kuoppala
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox