From patchwork Thu Sep 26 23:06:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 2951791 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6BDB0BFF0B for ; Thu, 26 Sep 2013 23:13:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 96AA9202EA for ; Thu, 26 Sep 2013 23:13:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C73B7202E6 for ; Thu, 26 Sep 2013 23:13:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7FF4EE6CDD for ; Thu, 26 Sep 2013 16:13:56 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qc0-f173.google.com (mail-qc0-f173.google.com [209.85.216.173]) by gabe.freedesktop.org (Postfix) with ESMTP id 28E6BE7F47; Thu, 26 Sep 2013 16:06:56 -0700 (PDT) Received: by mail-qc0-f173.google.com with SMTP id c3so1258716qcv.32 for ; Thu, 26 Sep 2013 16:06:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7kcvmsXIxAa4CwIFjbQE/DKHkEvRZ0YAJQ3/L3mTrYE=; b=khk/4mjgeUcdoRi6ShSQ227LSPrxn65ovfSkFl6MsJKH1BGKGF7JV8vINmPmMFyVeX fDsAWiteMTzf88yYGRP3D5djXizMdkfiHeBuGr3Urq6CyTvpCq6OmKoRv2+nnsqolKoZ k1FddoAsEXkH1ReHvFARLWCiVymCVms0+BjSXrDKp6Z1tmS6fAz0Q77ypBMdRhfpYdJ8 eZFVbpI7SoZQXOsHQJtb8blzpGM1A2tftRAticL6+Mvr/seyNU96uqcqs4CAwiIXuERx m6X5Spl8HsL3nm6BE0K55AfN1gQFUHsiKpqdiZxuLwvCjbEUAdgsMMSZjfyr3i2NVt5C dLLw== X-Received: by 10.49.0.198 with SMTP id 6mr5104865qeg.48.1380236815868; Thu, 26 Sep 2013 16:06:55 -0700 (PDT) Received: from localhost.localdomain ([187.112.183.101]) by mx.google.com with ESMTPSA id m6sm12528338qaa.13.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 26 Sep 2013 16:06:55 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Subject: [PATCH 4/5] console/fbcon: implement con_bind and con_unbind Date: Thu, 26 Sep 2013 20:06:01 -0300 Message-Id: <1380236762-1698-5-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1380236762-1698-1-git-send-email-przanoni@gmail.com> References: <1380236762-1698-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni , dri-devel@lists.freedesktop.org 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 X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Paulo Zanoni And create fb_bind and fb_unbind fb_ops that the drivers can implement. The current problem I'm trying to solve is that when i915+fbcon is loaded on Haswell, if we disable the power well (to save power) the VGA interface gets completely disabled, so when we unbind fbcon we need to restore the VGA interface to allow vgacon to work. Signed-off-by: Paulo Zanoni --- drivers/video/console/fbcon.c | 26 ++++++++++++++++++++++++++ include/linux/fb.h | 4 ++++ 2 files changed, 30 insertions(+) diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index cd8a802..68d316a 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -3298,6 +3298,30 @@ done: return ret; } +static void fbcon_con_bind(void) +{ + struct fb_info *info = NULL; + + info = registered_fb[info_idx]; + if (!info) + return; + + if (info->fbops->fb_bind) + info->fbops->fb_bind(info); +} + +static void fbcon_con_unbind(void) +{ + struct fb_info *info = NULL; + + info = registered_fb[info_idx]; + if (!info) + return; + + if (info->fbops->fb_unbind) + info->fbops->fb_unbind(info); +} + /* * The console `switch' structure for the frame buffer based console */ @@ -3328,6 +3352,8 @@ static const struct consw fb_con = { .con_resize = fbcon_resize, .con_debug_enter = fbcon_debug_enter, .con_debug_leave = fbcon_debug_leave, + .con_bind = fbcon_con_bind, + .con_unbind = fbcon_con_unbind, }; static struct notifier_block fbcon_event_notifier = { diff --git a/include/linux/fb.h b/include/linux/fb.h index ffac70a..8074bd5 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -304,6 +304,10 @@ struct fb_ops { /* called at KDB enter and leave time to prepare the console */ int (*fb_debug_enter)(struct fb_info *info); int (*fb_debug_leave)(struct fb_info *info); + + /* called when binding/unbinding */ + void (*fb_bind)(struct fb_info *info); + void (*fb_unbind)(struct fb_info *info); }; #ifdef CONFIG_FB_TILEBLITTING