From: Ben Widawsky Subject: No more read/write ioctls Date: Wed, 6 Apr 2011 14:38:27 -0700 Message-ID: <20110406213826.GA32472@snipes.kumite> References: <1301621965-23185-1-git-send-email-ben@bwidawsk.net> <1301702089-25644-1-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id 466B79E80F for ; Wed, 6 Apr 2011 14:40:27 -0700 (PDT) Received: from snipes.kumite (unknown [67.208.96.87]) by cloud01.chad-versace.us (Postfix) with ESMTPSA id 3075C1D406B for ; Wed, 6 Apr 2011 21:41:15 +0000 (UTC) Content-Disposition: inline In-Reply-To: <1301702089-25644-1-git-send-email-ben@bwidawsk.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, Apr 01, 2011 at 04:54:47PM -0700, Ben Widawsky wrote: > So if this isn't okay by everyone, let's get down to the minimum number > of changes required to get this accepted so I can move on to the tools, > and then get back to the debug stuff. > Some discussion on IRC has led to a new proposal (well 2 new proposals, but the first one wasn't viable). The interface will instead of using ioctls use debugfs. The debugfs file will control force wake. There will be a refcount mechanism for number of users of the registers in the relevant power-well, and upon opening a specific file in debugfs (we could have one per power-well if needed), the refcount will get incremented, and decremented at close. In other words, for userspace to read/write registers: fd = open(/sys/kernel/debug/dri...) normal read write mechanism close(fd) There are two side effects which everyone on IRC seems fine with: * root-only read access (the ioctl read was promiscuous) * access is only available when debugfs is mounted As a result, you should ignore both the gpu-tools patches, as well as these kernel patches. Thanks. Ben