<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
Hi Marek,<br>
<br>
<div class="moz-cite-prefix">Am 10.05.22 um 22:43 schrieb Marek
Olšák:<br>
</div>
<blockquote type="cite"
cite="mid:CAAxE2A7wOfoWWh5VUFmnhyhNeCQ086trJR2BgT+nAmsYZJTbVg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>A better flag name would be:</div>
<div>AMDGPU_GEM_CREATE_BEST_PLACEMENT_OR_DISCARD</div>
</div>
</blockquote>
<br>
A bit long for my taste and I think the best placement is just a
side effect.<br>
<br>
<blockquote type="cite"
cite="mid:CAAxE2A7wOfoWWh5VUFmnhyhNeCQ086trJR2BgT+nAmsYZJTbVg@mail.gmail.com">
<div dir="ltr">
<div><br>
</div>
<div>Marek<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, May 10, 2022 at 4:13
PM Marek Olšák <<a href="mailto:maraeo@gmail.com"
moz-do-not-send="true" class="moz-txt-link-freetext">maraeo@gmail.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>Does this really guarantee VRAM placement? The code
doesn't say anything about that.</div>
</div>
</blockquote>
</div>
</blockquote>
<br>
Yes, see the code here:<br>
<br>
<blockquote type="cite"
cite="mid:CAAxE2A7wOfoWWh5VUFmnhyhNeCQ086trJR2BgT+nAmsYZJTbVg@mail.gmail.com">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c<br>
index 8b7ee1142d9a..1944ef37a61e 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c<br>
@@ -567,6 +567,7 @@ int amdgpu_bo_create(struct
amdgpu_device *adev,<br>
bp->domain;<br>
bo->allowed_domains = bo->preferred_domains;<br>
if (bp->type != ttm_bo_type_kernel &&<br>
+ !(bp->flags &
AMDGPU_GEM_CREATE_DISCARDABLE) &&<br>
bo->allowed_domains ==
AMDGPU_GEM_DOMAIN_VRAM)<br>
bo->allowed_domains |=
AMDGPU_GEM_DOMAIN_GTT;<br>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
<br>
The only case where this could be circumvented is when you try to
allocate more than physically available on an APU.<br>
<br>
E.g. you only have something like 32 MiB VRAM and request 64 MiB,
then the GEM code will catch the error and fallback to GTT (IIRC).<br>
<br>
Regards,<br>
Christian.<br>
</body>
</html>