From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerome Glisse Subject: Re: Freescale Linux BSP review Date: Mon, 13 Dec 2010 21:06:47 -0500 Message-ID: References: <201012131618.04298.arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-bw0-f42.google.com (mail-bw0-f42.google.com [209.85.214.42]) by gabe.freedesktop.org (Postfix) with ESMTP id 399599E744 for ; Mon, 13 Dec 2010 18:06:49 -0800 (PST) Received: by bwz13 with SMTP id 13so224105bwz.15 for ; Mon, 13 Dec 2010 18:06:47 -0800 (PST) In-Reply-To: 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: Jammy Zhou Cc: Dave Martin , linaro-dev@lists.linaro.org, Arnd Bergmann , Linus Walleij , dri-devel@lists.freedesktop.org, Marcin Juszkiewicz List-Id: dri-devel@lists.freedesktop.org On Mon, Dec 13, 2010 at 9:04 PM, Jammy Zhou wrote: > > > On Tue, Dec 14, 2010 at 12:11 AM, Jerome Glisse wrot= e: >> >> On Mon, Dec 13, 2010 at 10:18 AM, Arnd Bergmann wrote: >> > On Monday 13 December 2010, Jammy Zhou wrote: >> >> On Mon, Dec 13, 2010 at 4:45 AM, Linus Walleij >> >> wrote: >> >> >> >> > On 11 December 2010 22:41, Arnd Bergmann wrote: >> >> > >> >> > * amd-gpu -- a single but huge driver for the GPU. As is normally t= he >> >> >> =A0 =A0 =A0 =A0 =A0 =A0 case with GPU drivers, we can expect long = discussions >> >> >> =A0 =A0 =A0 =A0 =A0 =A0 before it will get considered for mainline >> >> >> =A04 patches >> >> >> =A098 files changed, 278321 insertions(+), 0 deletions(-) >> >> >> >> >> > >> >> > Just out of curiosity, following the discussion between Dave Airlie >> >> > and Codeaurora this summer re GPU driver shims. >> >> > >> >> > Is the AMD GPU exposing all functionality in its kernel driver or >> >> > is there some userspace blob somewhere with lots of e.g. GL >> >> > goodies? >> >> > >> >> All the functionality for the kernel driver of AMD GPU Z430/Z160 (now >> >> belongs to Qualcom) is exposed. But we need accompanied userspace >> >> library to >> >> call these functionality (buffer management, command submission, ...). >> > >> > Who owns these components? If it's closed source, the only options we >> > have are lobbying for complete release of the specs for a >> > reimplementation >> > or reverse-engineering the drivers, which may at least get easier with >> > a user space driver than it would be with a kernel driver. >> > >> > Until there is a solution with an open source user space part, I would >> > suggest that the driver better be dropped from the Freescale BSP and >> > we should at least not waste time reviewing it. >> > >> > =A0 =A0 =A0 =A0Arnd >> >> From a quick look it also seems that the API exposed to userspace >> would allow easy abuse of the GPU to access any system ram. There is a >> reason we do expensive command checking in the other amd gpu driver >> (drivers/gpu/drm/radeon/*cs.c files) > > No, the memory used by the GPU is reserved at boot time, so I think there= is > no such a problem. > >> >> Cheers, >> Jerome > > This isn't about what's reserved, this is about GPU capacity, if the GPU is isolated through an IOMMU and the GPU can't reprogram it then fine. But if not, then it's easy to abuse packet to reprogram the GPU GART (either by reprogramming GART register or by overwritting GART table) to point to any system ram. Cheers, Jerome