From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?windows-1252?Q?Michel_D=E4nzer?= Subject: Re: [PATCH] drm/radeon: remove visible vram size limit on bo allocation Date: Fri, 18 Jul 2014 09:41:33 +0900 Message-ID: <53C86D3D.3080004@daenzer.net> References: <1405531594-25297-1-git-send-email-alexander.deucher@amd.com> <53C74AE7.30103@daenzer.net> <53C7DD77.3090401@vodafone.de> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail.gna.ch (darkcity.gna.ch [195.226.6.51]) by gabe.freedesktop.org (Postfix) with ESMTP id BBBDD6E6F5 for ; Thu, 17 Jul 2014 17:41:41 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Alex Deucher , =?windows-1252?Q?Christian_K=F6?= =?windows-1252?Q?nig?= Cc: Maling list - DRI developers List-Id: dri-devel@lists.freedesktop.org On 18.07.2014 01:29, Alex Deucher wrote: > @@ -55,10 +55,13 @@ int radeon_gem_object_create(struct radeon_device *rd= ev, int size, > alignment =3D PAGE_SIZE; > } > = > - /* maximun bo size is the minimun btw visible vram and gtt size */ > - max_size =3D min(rdev->mc.visible_vram_size, rdev->mc.gtt_size); > + /* Maximum bo size is the gtt size since we use the gtt to handle > + * vram to system pool migrations. We could probably remove this > + * check altogether with a little additional work. > + */ This comment needs updating: it's not the full GTT size anymore, and how could we remove this check? > @@ -331,6 +335,12 @@ int radeon_bo_unpin(struct radeon_bo *bo) > for (i =3D 0; i < bo->placement.num_placement; i++) > bo->placements[i] &=3D ~TTM_PL_FLAG_NO_EVICT; > r =3D ttm_bo_validate(&bo->tbo, &bo->placement, false, false); > + if (likely(r =3D=3D 0)) { > + if (bo->tbo.mem.mem_type =3D=3D TTM_PL_VRAM) > + bo->rdev->vram_pin_size -=3D radeon_bo_size(bo); > + else > + bo->rdev->gart_pin_size -=3D radeon_bo_size(bo); > + } > if (unlikely(r !=3D 0)) > dev_err(bo->rdev->dev, "%p validate failed for unpin\n", bo); Might be better to convert the failure case to use else, no big deal though. Other than that, the patches look good to me as well. -- = Earthling Michel D=E4nzer | http://www.amd.com Libre software enthusiast | Mesa and X developer