* [PATCH 1/7] drm/i915: Fix the offset issue for the stolen GEM objects
@ 2014-01-13 10:54 akash.goel
2014-01-28 0:30 ` Jesse Barnes
0 siblings, 1 reply; 7+ messages in thread
From: akash.goel @ 2014-01-13 10:54 UTC (permalink / raw)
To: intel-gfx; +Cc: Akash Goel
From: Akash Goel <akash.goel@intel.com>
The 'offset' field of the 'scatterlist' structure was wrongly
programmed with the offset value from the base of stolen area,
whereas this field indicates the offset from where the interested
data starts within the first PAGE pointed to by 'scattterlist'
structure. As a result when a new GEM object allocated from stolen
area is mapped to GTT, it could lead to an overwrite of GTT entries
as the page count calculation will go wrong, refer the function
'sg_page_count'.
v2: Modified the commit message. (Chris)
Signed-off-by: Akash Goel <akash.goel@intel.com>
---
drivers/gpu/drm/i915/i915_gem_stolen.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index fed87ec..1a24e84 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -250,7 +250,7 @@ i915_pages_create_for_stolen(struct drm_device *dev,
}
sg = st->sgl;
- sg->offset = offset;
+ sg->offset = 0;
sg->length = size;
sg_dma_address(sg) = (dma_addr_t)dev_priv->mm.stolen_base + offset;
--
1.8.5.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/7] drm/i915: Fix the offset issue for the stolen GEM objects
2014-01-13 10:54 [PATCH 1/7] drm/i915: Fix the offset issue for the stolen GEM objects akash.goel
@ 2014-01-28 0:30 ` Jesse Barnes
2014-01-28 8:04 ` Daniel Vetter
0 siblings, 1 reply; 7+ messages in thread
From: Jesse Barnes @ 2014-01-28 0:30 UTC (permalink / raw)
To: akash.goel; +Cc: intel-gfx
On Mon, 13 Jan 2014 16:24:45 +0530
akash.goel@intel.com wrote:
> From: Akash Goel <akash.goel@intel.com>
>
> The 'offset' field of the 'scatterlist' structure was wrongly
> programmed with the offset value from the base of stolen area,
> whereas this field indicates the offset from where the interested
> data starts within the first PAGE pointed to by 'scattterlist'
> structure. As a result when a new GEM object allocated from stolen
> area is mapped to GTT, it could lead to an overwrite of GTT entries
> as the page count calculation will go wrong, refer the function
> 'sg_page_count'.
>
> v2: Modified the commit message. (Chris)
>
> Signed-off-by: Akash Goel <akash.goel@intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem_stolen.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
> index fed87ec..1a24e84 100644
> --- a/drivers/gpu/drm/i915/i915_gem_stolen.c
> +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
> @@ -250,7 +250,7 @@ i915_pages_create_for_stolen(struct drm_device *dev,
> }
>
> sg = st->sgl;
> - sg->offset = offset;
> + sg->offset = 0;
> sg->length = size;
>
> sg_dma_address(sg) = (dma_addr_t)dev_priv->mm.stolen_base + offset;
Let's get this upstream and cc stable.
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
--
Jesse Barnes, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/7] drm/i915: Fix the offset issue for the stolen GEM objects
2014-01-28 0:30 ` Jesse Barnes
@ 2014-01-28 8:04 ` Daniel Vetter
0 siblings, 0 replies; 7+ messages in thread
From: Daniel Vetter @ 2014-01-28 8:04 UTC (permalink / raw)
To: Jesse Barnes; +Cc: akash.goel, intel-gfx
On Mon, Jan 27, 2014 at 04:30:41PM -0800, Jesse Barnes wrote:
> On Mon, 13 Jan 2014 16:24:45 +0530
> akash.goel@intel.com wrote:
>
> > From: Akash Goel <akash.goel@intel.com>
> >
> > The 'offset' field of the 'scatterlist' structure was wrongly
> > programmed with the offset value from the base of stolen area,
> > whereas this field indicates the offset from where the interested
> > data starts within the first PAGE pointed to by 'scattterlist'
> > structure. As a result when a new GEM object allocated from stolen
> > area is mapped to GTT, it could lead to an overwrite of GTT entries
> > as the page count calculation will go wrong, refer the function
> > 'sg_page_count'.
> >
> > v2: Modified the commit message. (Chris)
> >
> > Signed-off-by: Akash Goel <akash.goel@intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_gem_stolen.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
> > index fed87ec..1a24e84 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_stolen.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
> > @@ -250,7 +250,7 @@ i915_pages_create_for_stolen(struct drm_device *dev,
> > }
> >
> > sg = st->sgl;
> > - sg->offset = offset;
> > + sg->offset = 0;
> > sg->length = size;
> >
> > sg_dma_address(sg) = (dma_addr_t)dev_priv->mm.stolen_base + offset;
>
> Let's get this upstream and cc stable.
>
> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Indeed this slipped through the cracks. Patch authors: Please poke me per
mail (cc mailing lists still) or on irc if a patch seems to linger for 1-2
weeks. Merged to -fixes, thanks.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/7] drm/i915: Fix the offset issue for the stolen GEM objects
@ 2014-01-09 5:30 akash.goel
2014-01-09 9:45 ` Chris Wilson
0 siblings, 1 reply; 7+ messages in thread
From: akash.goel @ 2014-01-09 5:30 UTC (permalink / raw)
To: intel-gfx; +Cc: Akash Goel
From: Akash Goel <akash.goel@intel.com>
The 'offset' field of the 'scatterlist' structure was wrongly
programmed with the offset value from the base of stolen area,
whereas this field indicates the offset from where the interested
data starts within the PAGE pointed to by the 'page-link' field.
As a result when a new GEM object allocated from the stolen
area is mapped to GTT, it could lead to an overwrite of GTT entries
as the page count calculation will go wrong, refer the function
'sg_page_count'.
Signed-off-by: Akash Goel <akash.goel@intel.com>
---
drivers/gpu/drm/i915/i915_gem_stolen.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index fed87ec..1a24e84 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -250,7 +250,7 @@ i915_pages_create_for_stolen(struct drm_device *dev,
}
sg = st->sgl;
- sg->offset = offset;
+ sg->offset = 0;
sg->length = size;
sg_dma_address(sg) = (dma_addr_t)dev_priv->mm.stolen_base + offset;
--
1.8.5.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/7] drm/i915: Fix the offset issue for the stolen GEM objects
2014-01-09 5:30 akash.goel
@ 2014-01-09 9:45 ` Chris Wilson
2014-01-09 9:58 ` Daniel Vetter
0 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2014-01-09 9:45 UTC (permalink / raw)
To: akash.goel; +Cc: intel-gfx
On Thu, Jan 09, 2014 at 11:00:17AM +0530, akash.goel@intel.com wrote:
> From: Akash Goel <akash.goel@intel.com>
>
> The 'offset' field of the 'scatterlist' structure was wrongly
> programmed with the offset value from the base of stolen area,
> whereas this field indicates the offset from where the interested
> data starts within the PAGE pointed to by the 'page-link' field.
> As a result when a new GEM object allocated from the stolen
> area is mapped to GTT, it could lead to an overwrite of GTT entries
> as the page count calculation will go wrong, refer the function
> 'sg_page_count'.
This statement is incorrect since my use of sg here predates
sg_page_iter.
The stolen sg has no page_link, the meaning of offset/length here are
relative to the base of the stolen area.
However, if you wish to rephrase the above...
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/7] drm/i915: Fix the offset issue for the stolen GEM objects
2014-01-09 9:45 ` Chris Wilson
@ 2014-01-09 9:58 ` Daniel Vetter
2014-01-09 11:08 ` Chris Wilson
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Vetter @ 2014-01-09 9:58 UTC (permalink / raw)
To: Chris Wilson, akash.goel, intel-gfx
On Thu, Jan 09, 2014 at 09:45:21AM +0000, Chris Wilson wrote:
> On Thu, Jan 09, 2014 at 11:00:17AM +0530, akash.goel@intel.com wrote:
> > From: Akash Goel <akash.goel@intel.com>
> >
> > The 'offset' field of the 'scatterlist' structure was wrongly
> > programmed with the offset value from the base of stolen area,
> > whereas this field indicates the offset from where the interested
> > data starts within the PAGE pointed to by the 'page-link' field.
> > As a result when a new GEM object allocated from the stolen
> > area is mapped to GTT, it could lead to an overwrite of GTT entries
> > as the page count calculation will go wrong, refer the function
> > 'sg_page_count'.
>
> This statement is incorrect since my use of sg here predates
> sg_page_iter.
>
> The stolen sg has no page_link, the meaning of offset/length here are
> relative to the base of the stolen area.
>
> However, if you wish to rephrase the above...
Actually we add offset both to sg->offset and adjust the dma_bus_addr
since this has been introduced in
commit 0104fdbb84d7adb0e377ed05bf75eba97b007544
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Nov 15 11:32:26 2012 +0000
drm/i915: Introduce i915_gem_object_create_stolen()
But only Imre's conversion to the sg_page_iter started to pay any
attention to sg->offset in
commit 6e995e231a90ce7c5ce2a9eae23c8e22f4388db1
Author: Imre Deak <imre.deak@intel.com>
Date: Mon Feb 18 19:28:04 2013 +0200
drm/i915: use for_each_sg_page for setting up the gtt ptes
So with a bit of commit message rewording and these references and cc:
stable this looks good.
Cheers, Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 1/7] drm/i915: Fix the offset issue for the stolen GEM objects
2014-01-09 9:58 ` Daniel Vetter
@ 2014-01-09 11:08 ` Chris Wilson
0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2014-01-09 11:08 UTC (permalink / raw)
To: Daniel Vetter; +Cc: akash.goel, intel-gfx
On Thu, Jan 09, 2014 at 10:58:35AM +0100, Daniel Vetter wrote:
> On Thu, Jan 09, 2014 at 09:45:21AM +0000, Chris Wilson wrote:
> > On Thu, Jan 09, 2014 at 11:00:17AM +0530, akash.goel@intel.com wrote:
> > > From: Akash Goel <akash.goel@intel.com>
> > >
> > > The 'offset' field of the 'scatterlist' structure was wrongly
> > > programmed with the offset value from the base of stolen area,
> > > whereas this field indicates the offset from where the interested
> > > data starts within the PAGE pointed to by the 'page-link' field.
> > > As a result when a new GEM object allocated from the stolen
> > > area is mapped to GTT, it could lead to an overwrite of GTT entries
> > > as the page count calculation will go wrong, refer the function
> > > 'sg_page_count'.
> >
> > This statement is incorrect since my use of sg here predates
> > sg_page_iter.
> >
> > The stolen sg has no page_link, the meaning of offset/length here are
> > relative to the base of the stolen area.
> >
> > However, if you wish to rephrase the above...
>
> Actually we add offset both to sg->offset and adjust the dma_bus_addr
> since this has been introduced in
>
> commit 0104fdbb84d7adb0e377ed05bf75eba97b007544
> Author: Chris Wilson <chris@chris-wilson.co.uk>
> Date: Thu Nov 15 11:32:26 2012 +0000
>
> drm/i915: Introduce i915_gem_object_create_stolen()
>
> But only Imre's conversion to the sg_page_iter started to pay any
> attention to sg->offset in
>
> commit 6e995e231a90ce7c5ce2a9eae23c8e22f4388db1
> Author: Imre Deak <imre.deak@intel.com>
> Date: Mon Feb 18 19:28:04 2013 +0200
>
> drm/i915: use for_each_sg_page for setting up the gtt ptes
>
> So with a bit of commit message rewording and these references and cc:
> stable this looks good.
And
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69104
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Maybe a reviewed-by when I see a good comment/changelog.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-01-28 8:04 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-13 10:54 [PATCH 1/7] drm/i915: Fix the offset issue for the stolen GEM objects akash.goel
2014-01-28 0:30 ` Jesse Barnes
2014-01-28 8:04 ` Daniel Vetter
-- strict thread matches above, loose matches on Subject: below --
2014-01-09 5:30 akash.goel
2014-01-09 9:45 ` Chris Wilson
2014-01-09 9:58 ` Daniel Vetter
2014-01-09 11:08 ` Chris Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox