From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753127AbbCIHnD (ORCPT ); Mon, 9 Mar 2015 03:43:03 -0400 Received: from mail-wg0-f50.google.com ([74.125.82.50]:44058 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752503AbbCIHnA (ORCPT ); Mon, 9 Mar 2015 03:43:00 -0400 Date: Mon, 9 Mar 2015 08:44:38 +0100 From: Daniel Vetter To: Archit Taneja Cc: Rob Clark , linux-arm-msm , Linux Kernel Mailing List , "dri-devel@lists.freedesktop.org" , daniel@ffwll.ch Subject: Re: [PATCH] drm: msm: Fix build when legacy fbdev support isn't set Message-ID: <20150309074438.GK18775@phenom.ffwll.local> Mail-Followup-To: Archit Taneja , Rob Clark , linux-arm-msm , Linux Kernel Mailing List , "dri-devel@lists.freedesktop.org" References: <1424687361-17787-1-git-send-email-architt@codeaurora.org> <20150223140903.GY24485@phenom.ffwll.local> <20150223153940.GZ24485@phenom.ffwll.local> <54F82AA3.4040902@codeaurora.org> <20150305154453.GL18775@phenom.ffwll.local> <54FD3632.8080904@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54FD3632.8080904@codeaurora.org> X-Operating-System: Linux phenom 3.16-2-amd64 User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 09, 2015 at 11:27:06AM +0530, Archit Taneja wrote: > On 03/05/2015 09:14 PM, Daniel Vetter wrote: > >On Thu, Mar 05, 2015 at 07:10:44AM -0500, Rob Clark wrote: > >>On Thu, Mar 5, 2015 at 5:06 AM, Archit Taneja wrote: > >>> > >>>On 02/23/2015 09:09 PM, Daniel Vetter wrote: > >>>> > >>>>On Mon, Feb 23, 2015 at 10:03:21AM -0500, Rob Clark wrote: > >>>Rather than creating fb helper stub functions, maybe we could help each drm > >>>driver create two variants of functions needed by drm core(like > >>>output_poll_changed and dev_lastclose), one variant supporting legacy fbdev, > >>>and the other not? > >> > >>So one quick thought.. building without fbdev would ideally/eventually > >>be a distro level decision, not a driver level decision.. so I think > >>it is *eventually* not a problem for it being a global drm level > >>decision. The only problem is right now some drivers support no-fbdev > >>config, and some do not. Maybe it is worth fixing that? > > > >Yeah, if we get fbdev emulation Kconfig option then I think i915 and msm > >should remove their own options and just use that. There's really no need > >to have this per-driver, this is a question of what userspace expects and > >so per-distro, independant of the driver. > >-Daniel > > > > Okay. If I understand right. We need to do something like this: > > - Create a new Kconfig option that lets us emulate fbdev > > - For drivers that already have a config for fbdev emulation, replace it > with our new emulation config. > > - For drivers that assume fbdev emulation by default, select our new > emulation config in their respective Kconfigs. > > Does this sound okay? > > I suppose this could be the first step. Later we'd need to work on each > driver to work with and without the fbdev emulation Kconfig option. See Rob's idea quoted above: Imo you should just do the conditional code in the fbdev emulation helper in drm_fb_helper.c, not in drivers. There's some additional code in i915 (and maybe also msm) to compile out (mostly around taking/dropping console_lock) and we want to keep that. But that should also just be using the same new config option. So: - Add new config option DRM_FBDEV_EMULATION (default y for backwards compat). Use that to stub out helpers in drm_fb_helper.c. - Replace the msm/i915 specific options with the new, i.e. remove it from Kconfig and use DRM_FBDEV_EMULATION in the code instead of the msm/i915 specific one. fbdev-less support for all other drivers will just magically happen without the need for driver-specific code (except for the special locking in i915 and similar things maybe). -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch