From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: drm/fb_helper: prevent some troubles waiting to happen Date: Wed, 26 Oct 2011 09:41:24 +0200 Message-ID: <20111026074124.GA2889@phenom.ffwll.local> References: <1319594239-2506-1-git-send-email-ihadzic@research.bell-labs.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wy0-f177.google.com (mail-wy0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id B96FF9EAF5 for ; Wed, 26 Oct 2011 00:40:38 -0700 (PDT) Received: by wyg8 with SMTP id 8so1623010wyg.36 for ; Wed, 26 Oct 2011 00:40:37 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1319594239-2506-1-git-send-email-ihadzic@research.bell-labs.com> 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: Ilija Hadzic Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Tue, Oct 25, 2011 at 09:57:17PM -0400, Ilija Hadzic wrote: > The following two patches address potential problems that I > called "troubles waiting to happen" in this note > http://lists.freedesktop.org/archives/dri-devel/2011-October/015412.html > > I didn't hear anyone take on my question, so I figured I would just send > the patches. I tested the patches on a variety of AMD cards that I have. > I don't have other GPUs handy. I've quickly checked current callsites of drm_fb_helper_init and I think you can just kill the two arguments crtc_count and max_conn_count. All drivers pass in the actual crtc count for the first and some midly bogus constant for the latter. i915 and radeon also use that constant to attach some struct drm_connector * pointers to the end of their crtc, which looks rather unused. You might want to kill that, too. -Daniel -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48