From: Alan Cox Subject: Re: [PATCH 2/2] drm/omap: add GEM support for tiled/dmm buffers Date: Tue, 6 Dec 2011 11:30:06 +0000 Message-ID: <20111206113006.11ecde62@lxorguk.ukuu.org.uk> References: <1323134362-3146-1-git-send-email-rob.clark@linaro.org> <1323134362-3146-3-git-send-email-rob.clark@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from earthlight.etchedpixels.co.uk (earthlight.etchedpixels.co.uk [81.2.110.250]) by gabe.freedesktop.org (Postfix) with ESMTP id 39A1C9E734 for ; Tue, 6 Dec 2011 03:28:18 -0800 (PST) In-Reply-To: <1323134362-3146-3-git-send-email-rob.clark@linaro.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Rob Clark Cc: Greg KH , patches@linaro.org, dri-devel@lists.freedesktop.org, Rob Clark List-Id: dri-devel@lists.freedesktop.org On Mon, 5 Dec 2011 19:19:22 -0600 Rob Clark wrote: > + usergart = kzalloc(3 * sizeof(*usergart), GFP_KERNEL); > + > + /* reserve 4k aligned/wide regions for userspace mappings: */ > + for (i = 0; i < ARRAY_SIZE(fmts); i++) { > + uint16_t h = 1, w = PAGE_SIZE >> i; > + tiler_align(fmts[i], &w, &h); > + /* note: since each region is 1 4kb page wide, and minimum > + * number of rows, the height ends up being the same as the > + * # of pages in the region > + */ > + usergart[i].height = h; > + usergart[i].height_shift = ilog2(h); Seems to be missing anallocation failure check