* [PATCH] i915: Fix obj size vs. alignment for drm_pci_alloc()
@ 2017-09-07 14:32 ville.syrjala
2017-09-07 14:43 ` Chris Wilson
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: ville.syrjala @ 2017-09-07 14:32 UTC (permalink / raw)
To: intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
drm_pci_alloc() refuses to cooperate if the passed alignment exceeds the
object size. So round up the obj size to the next power of two as well
to make this actually work.
Obviously things work just fine as long as the size was a power of two
to begin with. However kms_cursor_crc doesn't always use power of two
sizes so we hit a failure when we try to allocate the phys memory.
Testcase: igt/kms_cursor_crc
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/i915_gem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 4dffebae5601..822719fa1b52 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -179,7 +179,7 @@ i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj)
* the alignment of the buddy allocation will naturally match.
*/
phys = drm_pci_alloc(obj->base.dev,
- obj->base.size,
+ roundup_pow_of_two(obj->base.size),
roundup_pow_of_two(obj->base.size));
if (!phys)
return ERR_PTR(-ENOMEM);
--
2.13.5
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] i915: Fix obj size vs. alignment for drm_pci_alloc()
2017-09-07 14:32 [PATCH] i915: Fix obj size vs. alignment for drm_pci_alloc() ville.syrjala
@ 2017-09-07 14:43 ` Chris Wilson
2017-09-07 14:53 ` Ville Syrjälä
2017-09-07 15:05 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-09-07 17:44 ` ✓ Fi.CI.IGT: " Patchwork
2 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2017-09-07 14:43 UTC (permalink / raw)
To: ville.syrjala, intel-gfx
Quoting ville.syrjala@linux.intel.com (2017-09-07 15:32:03)
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> drm_pci_alloc() refuses to cooperate if the passed alignment exceeds the
> object size. So round up the obj size to the next power of two as well
> to make this actually work.
'Tis true.
> to begin with. However kms_cursor_crc doesn't always use power of two
> sizes so we hit a failure when we try to allocate the phys memory.
>
> Testcase: igt/kms_cursor_crc
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Shouldn't we remove the restriction from drm_pci.c? Seem like it is
second guessing the actual dma allocator. We should just kill it
entirely...
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] i915: Fix obj size vs. alignment for drm_pci_alloc()
2017-09-07 14:43 ` Chris Wilson
@ 2017-09-07 14:53 ` Ville Syrjälä
2017-09-07 18:58 ` Ville Syrjälä
0 siblings, 1 reply; 6+ messages in thread
From: Ville Syrjälä @ 2017-09-07 14:53 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
On Thu, Sep 07, 2017 at 03:43:26PM +0100, Chris Wilson wrote:
> Quoting ville.syrjala@linux.intel.com (2017-09-07 15:32:03)
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > drm_pci_alloc() refuses to cooperate if the passed alignment exceeds the
> > object size. So round up the obj size to the next power of two as well
> > to make this actually work.
>
> 'Tis true.
>
> > to begin with. However kms_cursor_crc doesn't always use power of two
> > sizes so we hit a failure when we try to allocate the phys memory.
> >
> > Testcase: igt/kms_cursor_crc
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
>
> Shouldn't we remove the restriction from drm_pci.c? Seem like it is
> second guessing the actual dma allocator. We should just kill it
> entirely...
Perhaps. I was feeling lazy today though so left it at this.
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* ✓ Fi.CI.BAT: success for i915: Fix obj size vs. alignment for drm_pci_alloc()
2017-09-07 14:32 [PATCH] i915: Fix obj size vs. alignment for drm_pci_alloc() ville.syrjala
2017-09-07 14:43 ` Chris Wilson
@ 2017-09-07 15:05 ` Patchwork
2017-09-07 17:44 ` ✓ Fi.CI.IGT: " Patchwork
2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2017-09-07 15:05 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: intel-gfx
== Series Details ==
Series: i915: Fix obj size vs. alignment for drm_pci_alloc()
URL : https://patchwork.freedesktop.org/series/29954/
State : success
== Summary ==
Series 29954v1 i915: Fix obj size vs. alignment for drm_pci_alloc()
https://patchwork.freedesktop.org/api/1.0/series/29954/revisions/1/mbox/
Test kms_cursor_legacy:
Subgroup basic-busy-flip-before-cursor-atomic:
fail -> PASS (fi-snb-2600) fdo#100215 +1
Test pm_rpm:
Subgroup basic-pci-d3-state:
skip -> PASS (fi-cfl-s) fdo#102294
fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215
fdo#102294 https://bugs.freedesktop.org/show_bug.cgi?id=102294
fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:458s
fi-blb-e6850 total:289 pass:224 dwarn:1 dfail:0 fail:0 skip:64 time:366s
fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:563s
fi-bwr-2160 total:289 pass:184 dwarn:0 dfail:0 fail:0 skip:105 time:254s
fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:529s
fi-byt-j1900 total:289 pass:254 dwarn:1 dfail:0 fail:0 skip:34 time:514s
fi-byt-n2820 total:289 pass:250 dwarn:1 dfail:0 fail:0 skip:38 time:514s
fi-cfl-s total:289 pass:250 dwarn:3 dfail:1 fail:0 skip:35 time:462s
fi-elk-e7500 total:289 pass:230 dwarn:0 dfail:0 fail:0 skip:59 time:433s
fi-glk-2a total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:613s
fi-hsw-4770 total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:447s
fi-hsw-4770r total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:426s
fi-ilk-650 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:423s
fi-ivb-3520m total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:504s
fi-ivb-3770 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:476s
fi-kbl-7500u total:289 pass:264 dwarn:1 dfail:0 fail:0 skip:24 time:511s
fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:599s
fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:598s
fi-pnv-d510 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:525s
fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:470s
fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:537s
fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:510s
fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:441s
fi-skl-x1585l total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:484s
fi-snb-2520m total:289 pass:251 dwarn:0 dfail:0 fail:0 skip:38 time:559s
fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:1 skip:39 time:403s
fi-bdw-gvtdvm failed to connect after reboot
00f9b49384df3d7874273e1368c770cc651464df drm-tip: 2017y-09m-07d-09h-58m-50s UTC integration manifest
725a0a8bc745 i915: Fix obj size vs. alignment for drm_pci_alloc()
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5609/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* ✓ Fi.CI.IGT: success for i915: Fix obj size vs. alignment for drm_pci_alloc()
2017-09-07 14:32 [PATCH] i915: Fix obj size vs. alignment for drm_pci_alloc() ville.syrjala
2017-09-07 14:43 ` Chris Wilson
2017-09-07 15:05 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-09-07 17:44 ` Patchwork
2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2017-09-07 17:44 UTC (permalink / raw)
To: ville.syrjala; +Cc: intel-gfx
== Series Details ==
Series: i915: Fix obj size vs. alignment for drm_pci_alloc()
URL : https://patchwork.freedesktop.org/series/29954/
State : success
== Summary ==
Test kms_atomic_transition:
Subgroup plane-use-after-nonblocking-unbind:
incomplete -> FAIL (shard-hsw) fdo#101847
fdo#101847 https://bugs.freedesktop.org/show_bug.cgi?id=101847
shard-hsw total:2265 pass:1235 dwarn:0 dfail:0 fail:14 skip:1016 time:9588s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5609/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] i915: Fix obj size vs. alignment for drm_pci_alloc()
2017-09-07 14:53 ` Ville Syrjälä
@ 2017-09-07 18:58 ` Ville Syrjälä
0 siblings, 0 replies; 6+ messages in thread
From: Ville Syrjälä @ 2017-09-07 18:58 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
On Thu, Sep 07, 2017 at 05:53:30PM +0300, Ville Syrjälä wrote:
> On Thu, Sep 07, 2017 at 03:43:26PM +0100, Chris Wilson wrote:
> > Quoting ville.syrjala@linux.intel.com (2017-09-07 15:32:03)
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > >
> > > drm_pci_alloc() refuses to cooperate if the passed alignment exceeds the
> > > object size. So round up the obj size to the next power of two as well
> > > to make this actually work.
> >
> > 'Tis true.
> >
> > > to begin with. However kms_cursor_crc doesn't always use power of two
> > > sizes so we hit a failure when we try to allocate the phys memory.
> > >
> > > Testcase: igt/kms_cursor_crc
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> >
> > Shouldn't we remove the restriction from drm_pci.c? Seem like it is
> > second guessing the actual dma allocator. We should just kill it
> > entirely...
>
> Perhaps. I was feeling lazy today though so left it at this.
And now pushed to dinq. Thanks for the review.
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-09-07 18:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-07 14:32 [PATCH] i915: Fix obj size vs. alignment for drm_pci_alloc() ville.syrjala
2017-09-07 14:43 ` Chris Wilson
2017-09-07 14:53 ` Ville Syrjälä
2017-09-07 18:58 ` Ville Syrjälä
2017-09-07 15:05 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-09-07 17:44 ` ✓ Fi.CI.IGT: " Patchwork
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.