From: "Michel Dänzer" <michel@daenzer.net>
To: Dave Airlie <airlied@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/radeon/bo: add some fallback placements for VRAM only objects. (v2)
Date: Tue, 27 Apr 2010 12:11:46 +0200 [thread overview]
Message-ID: <1272363106.3878.131.camel@thor.local> (raw)
In-Reply-To: <1272335671-8588-1-git-send-email-airlied@gmail.com>
[ Moving to the new list ]
On Die, 2010-04-27 at 12:34 +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied@redhat.com>
>
> On constrained r100 systems compiz would fail to start due to a lack
> of memory, we can just fallback place the objects rather than completely
> failing it works a lot better.
>
> v2:
> fixes issue identified by Michel when pinning could happen in a busy placement domain.
[...]
> diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
> index 6a8617b..ab3bc7b 100644
> --- a/drivers/gpu/drm/radeon/radeon_object.c
> +++ b/drivers/gpu/drm/radeon/radeon_object.c
> @@ -64,17 +64,21 @@ bool radeon_ttm_bo_is_radeon_bo(struct ttm_buffer_object *bo)
> return false;
> }
>
> -void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
> +void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain, bool pinned)
> {
> - u32 c = 0;
> + u32 c = 0, b = 0;
>
> rbo->placement.fpfn = 0;
> rbo->placement.lpfn = 0;
> rbo->placement.placement = rbo->placements;
> - rbo->placement.busy_placement = rbo->placements;
> + rbo->placement.busy_placement = rbo->busy_placements;
> if (domain & RADEON_GEM_DOMAIN_VRAM)
> rbo->placements[c++] = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED |
> TTM_PL_FLAG_VRAM;
> + /* add busy placement to TTM if VRAM is only option */
> + if (domain == RADEON_GEM_DOMAIN_VRAM && pinned == false) {
> + rbo->busy_placements[b++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT;
> + }
> if (domain & RADEON_GEM_DOMAIN_GTT)
> rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT;
> if (domain & RADEON_GEM_DOMAIN_CPU)
> @@ -82,7 +86,7 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
> if (!c)
> rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
> rbo->placement.num_placement = c;
> - rbo->placement.num_busy_placement = c;
> + rbo->placement.num_busy_placement = b;
> }
>
> int radeon_bo_create(struct radeon_device *rdev, struct drm_gem_object *gobj,
BTW, this means there won't be any busy placements if (domain !=
RADEON_GEM_DOMAIN_VRAM || pinned). Not sure if that's a problem.
--
Earthling Michel Dänzer | http://www.vmware.com
Libre software enthusiast | Debian, X and DRI developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2010-04-27 10:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-27 2:34 [PATCH] drm/radeon/bo: add some fallback placements for VRAM only objects. (v2) Dave Airlie
2010-04-27 8:31 ` Michel Dänzer
2010-04-28 12:11 ` Michel Dänzer
2010-04-27 10:11 ` Michel Dänzer [this message]
2010-04-27 10:14 ` Dave Airlie
2010-04-27 10:25 ` Michel Dänzer
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=1272363106.3878.131.camel@thor.local \
--to=michel@daenzer.net \
--cc=airlied@gmail.com \
--cc=dri-devel@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.