Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S268533AbUI2Ont (ORCPT ); Wed, 29 Sep 2004 10:43:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S268527AbUI2Okf (ORCPT ); Wed, 29 Sep 2004 10:40:35 -0400 Received: from pengo.systems.pipex.net ([62.241.160.193]:64934 "EHLO pengo.systems.pipex.net") by vger.kernel.org with ESMTP id S268537AbUI2Ojn (ORCPT ); Wed, 29 Sep 2004 10:39:43 -0400 Message-ID: <415AC929.6070700@tungstengraphics.com> Date: Wed, 29 Sep 2004 15:39:37 +0100 From: Keith Whitwell User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a3) Gecko/20040817 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Discuss issues related to the xorg tree Cc: Christoph Hellwig , dri-devel , lkml Subject: Re: New DRM driver model - gets rid of DRM() macros! References: <9e4733910409280854651581e2@mail.gmail.com> <20040929133759.A11891@infradead.org> <415AB8B4.4090408@tungstengraphics.com> <20040929143129.A12651@infradead.org> <415ABA34.9080608@tungstengraphics.com> <415AC2B3.6070900@tungstengraphics.com> <20040929151601.A13135@infradead.org> <415AC640.3090407@tungstengraphics.com> In-Reply-To: <415AC640.3090407@tungstengraphics.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2285 Lines: 54 Keith Whitwell wrote: > Christoph Hellwig wrote: > >> On Wed, Sep 29, 2004 at 03:12:03PM +0100, Keith Whitwell wrote: >> >>> Thinking about it, it may not have been a problem of crashing, but >>> rather that the behaviour visible from a program attempting to read >>> (or poll) was different with noop versions of these functions to NULL >>> versions, and that was causing problems. This is 18 months ago, so >>> yes, I'm being vague. >>> >>> The X server does look at this file descriptor, which is where the >>> problem would have arisen, but only the gamma & maybe ffb drivers do >>> anything with it. >> >> >> >> Indeed, for read you're returning 0 now instead of the -EINVAL from >> common >> code when no ->read is present. I'd say the current drm behaviour is >> a bug, >> but if X drivers rely on it. > > > I'd agree, but it's a widely distributed bug. I guess we can fix it in > the X server, but even better would be to rip out the code as it's > fundamentally misguided, based on a wierd idea that the kernel would > somehow ask the X server to perform a context switch between two > userspace clients... The piece of the puzzle you're missing is that the read() function really did used to do something, and was relied upon. If you want to go right back to prehistory, the drm was originally designed as a "core + personality" system, where the core supported a number of different context switching mechanisms to cover a variety of hardware cases. The gamma driver exercised one path, but everything since then has been a lot more simplistic, assuming that the hardware state is lost if another context has been active. Hardware often has the capacity to hold multiple active contexts or to perform fast hardware context save & restore. None of the DRI drivers have attempted to take advantage of that - optimization continues to focus on the single-client scenario. A future X-on-GL world where regular applications are presumably doing direct rendering will change that assumption... Keith - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/