From patchwork Thu Mar 28 12:04:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Luis R. Rodriguez" X-Patchwork-Id: 2356331 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 8C2D23FD40 for ; Thu, 28 Mar 2013 12:16:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7EE04E5F42 for ; Thu, 28 Mar 2013 05:16:05 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by gabe.freedesktop.org (Postfix) with ESMTP id 5AD4FE5CF8 for ; Thu, 28 Mar 2013 05:04:55 -0700 (PDT) Received: by mail-pa0-f50.google.com with SMTP id bg2so2661289pad.37 for ; Thu, 28 Mar 2013 05:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=E8K39DW+QALwKmi7elzjDA5jJvGgruhshOXHtyRixFI=; b=Nh4vEjKbeJIgbDE7pnzJCxpRX4LGWLrxmoMS5c/cA9wgWCGgGH9PBtjbmbXVoi5Tpb 7XX3Nz2/0T/UVDx2GTPtlFaCDu3vmNqC/Cn8M1ZAcsVL57PCdCZ0zr5QJiJqiI6RiDpN FOaX7GRsSgkTnfsIGWu6WaVlLxoqqRIMW7Q57V01RVZPEM6Mf6/sUPFVr5Zn3o2AD/E3 k71swgflLTfzBVmlvVXdhN2YrEECv1PUpvTK2ZtGYCfHJSclQ0RQ7j91w7G40qdRjk5Z wrAMDejB8WfqTtvpKjGXVilyRQ/rCGJpOiXiU3SVt+luYZ1onX5SvtgyIXNiMnd1leWP u/aQ== X-Received: by 10.68.247.163 with SMTP id yf3mr34855622pbc.113.1364472295084; Thu, 28 Mar 2013 05:04:55 -0700 (PDT) Received: from mcgrof@gmail.com (c-24-7-61-223.hsd1.ca.comcast.net. [24.7.61.223]) by mx.google.com with ESMTPS id vd4sm25327997pbc.35.2013.03.28.05.04.51 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 28 Mar 2013 05:04:53 -0700 (PDT) Received: by mcgrof@gmail.com (sSMTP sendmail emulation); Thu, 28 Mar 2013 05:04:49 -0700 From: "Luis R. Rodriguez" To: FlorianSchandinat@gmx.de Subject: [PATCH 3/4] compat-drivers: simplify backport fb_info->skip_vt_switch CE Date: Thu, 28 Mar 2013 05:04:29 -0700 Message-Id: <1364472270-9297-4-git-send-email-mcgrof@do-not-panic.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1364472270-9297-1-git-send-email-mcgrof@do-not-panic.com> References: <1364472270-9297-1-git-send-email-mcgrof@do-not-panic.com> X-Mailman-Approved-At: Thu, 28 Mar 2013 05:12:03 -0700 Cc: linux-fbdev@vger.kernel.org, backports@vger.kernel.org, "Luis R. Rodriguez" , daniel.vetter@ffwll.ch, rafael.j.wysocki@intel.com, linux-kernel@vger.kernel.org, julia.lawall@lip6.fr, dri-devel@lists.freedesktop.org, cocci@systeme.lip6.fr X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: "Luis R. Rodriguez" The collateral evolution (CE) on the fb_info data structure that added the skip_vt_switch element can be simplified further by replacing the #ifdef hell with a static inline. Furthermore, if the static inline is added upstream it'd mean we can get rid of all these static inline replacements for this data structure element CE. Cc: cocci@systeme.lip6.fr Cc: backports@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Julia Lawall Cc: Rodrigo Vivi Cc: Daniel Vetter Cc: Jesse Barnes Cc: Rafael J. Wysocki Signed-off-by: Luis R. Rodriguez --- .../drm/0001-fb-info-vt_switch.patch | 25 ++++---------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/patches/collateral-evolutions/drm/0001-fb-info-vt_switch.patch b/patches/collateral-evolutions/drm/0001-fb-info-vt_switch.patch index cdced87..39b13d1 100644 --- a/patches/collateral-evolutions/drm/0001-fb-info-vt_switch.patch +++ b/patches/collateral-evolutions/drm/0001-fb-info-vt_switch.patch @@ -8,23 +8,7 @@ pm_vt_switch_unregister() would not have been made. This patch cannot be broken down further so I'm pegging this as the first one with 4 digits under the DRM folder for collateral evolutions. This reflects its as atomic as -is possible. As we'll see on the next commit, these type -of collateral evolutions can best be backported not by -keeping ifdef's as below but instead by using a wrapper -caller, to help reduce with the amount of lines of code -we need. If a static inline is added upstream for these -changes, then no code is required for backporting, at all, -we'd just implement the static inline later upstream as -a no-op. - -The tradeoffs to consider for this is if we can live with -these practices upstream, we may be able to support full -subsystems only with a compat module, and no need for -patches. This also means less code and likely less bugs -on the distribution front when backporting is required. -At least IMHO this may be worthy to consider at least to -support kernels listed as supported on kernel.org. We could -just leave the ifdef hell to older unsupported kernels. +is possible. Relevant commits below, starting with the first one that added this new collateral evolution. @@ -60,14 +44,13 @@ Date: Tue Mar 26 09:25:45 2013 -0700 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c -@@ -150,8 +150,10 @@ static int intelfb_create(struct drm_fb_ +@@ -150,8 +150,8 @@ static int intelfb_create(struct drm_fb_ } info->screen_size = size; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) /* This driver doesn't need a VT switch to restore the mode on resume */ - info->skip_vt_switch = true; -+#endif +- info->skip_vt_switch = true; ++ fb_enable_skip_vt_switch(info); drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth); drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height);