From patchwork Mon Jul 13 06:43:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Archit Taneja X-Patchwork-Id: 6775481 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D4861C05AC for ; Mon, 13 Jul 2015 06:45:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9DF21205F9 for ; Mon, 13 Jul 2015 06:45:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 955F2205C2 for ; Mon, 13 Jul 2015 06:45:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CEE616E751; Sun, 12 Jul 2015 23:45:04 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by gabe.freedesktop.org (Postfix) with ESMTPS id D13586E751 for ; Sun, 12 Jul 2015 23:45:02 -0700 (PDT) Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id A5CD6140A2E; Mon, 13 Jul 2015 06:45:02 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id 96C15140A33; Mon, 13 Jul 2015 06:45:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost (unknown [202.46.23.61]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: architt@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id C9BD8140A2E; Mon, 13 Jul 2015 06:45:00 +0000 (UTC) From: Archit Taneja To: dri-devel@lists.freedesktop.org, daniel@ffwll.ch Subject: [RFC 12/21] drm/udl: Remove FB_KMS_HELPER and FB related config options Date: Mon, 13 Jul 2015 12:13:59 +0530 Message-Id: <1436769848-4990-13-git-send-email-architt@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1436769848-4990-1-git-send-email-architt@codeaurora.org> References: <1436769848-4990-1-git-send-email-architt@codeaurora.org> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP Cc: linux-arm-msm@vger.kernel.org, =?UTF-8?q?St=C3=A9phane=20Marchesin?= , Haixia Shi X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Remove FB_* config options since the driver doesn't call any fbdev functions directly. Remove FB_KMS_HELPER as this would now be selected by the top level FBDEV_EMULATION config option. If the fbdev emulation isn't selected, the drm_fb_helper functions will be stubbed out. The code relying on DEFERRED_IO can't be stubbed out using drm_fb_helper functions. This is because the deferred io members in fbdev core structs are defined based on whether FB_DEFERRED_IO is defined or not. For now, wrap around deferred io code with an #ifdef check for CONFIG_DEFERRED_IO. We could consider creating stub fb helper functions here, but this would require some changes in the core fbdev structs. Cc: David Airlie Cc: Haixia Shi Cc: "Stéphane Marchesin" Signed-off-by: Archit Taneja --- drivers/gpu/drm/udl/Kconfig | 5 ----- drivers/gpu/drm/udl/udl_fb.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/udl/Kconfig b/drivers/gpu/drm/udl/Kconfig index 613ab06..1616ec4 100644 --- a/drivers/gpu/drm/udl/Kconfig +++ b/drivers/gpu/drm/udl/Kconfig @@ -4,12 +4,7 @@ config DRM_UDL depends on USB_SUPPORT depends on USB_ARCH_HAS_HCD select USB - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT - select FB_DEFERRED_IO select DRM_KMS_HELPER - select DRM_KMS_FB_HELPER help This is a KMS driver for the USB displaylink video adapters. Say M/Y to add support for these devices via drm/kms interfaces. diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c index 9fd6e83..4aa5118d 100644 --- a/drivers/gpu/drm/udl/udl_fb.c +++ b/drivers/gpu/drm/udl/udl_fb.c @@ -24,11 +24,15 @@ #define DL_DEFIO_WRITE_DELAY (HZ/20) /* fb_deferred_io.delay in jiffies */ +#ifdef CONFIG_FB_DEFERRED_IO static int fb_defio = 0; /* Optionally enable experimental fb_defio mmap support */ +#endif static int fb_bpp = 16; module_param(fb_bpp, int, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP); +#ifdef CONFIG_FB_DEFERRED_IO module_param(fb_defio, int, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP); +#endif struct udl_fbdev { struct drm_fb_helper helper; @@ -78,6 +82,7 @@ static uint16_t rgb16(uint32_t col) } #endif +#ifdef CONFIG_FB_DEFERRED_IO /* * NOTE: fb_defio.c is holding info->fbdefio.mutex * Touching ANY framebuffer memory that triggers a page fault @@ -139,6 +144,7 @@ error: >> 10)), /* Kcycles */ &udl->cpu_kcycles_used); } +#endif int udl_handle_damage(struct udl_framebuffer *fb, int x, int y, int width, int height) @@ -331,6 +337,7 @@ static int udl_fb_open(struct fb_info *info, int user) ufbdev->fb_count++; +#ifdef CONFIG_FB_DEFERRED_IO if (fb_defio && (info->fbdefio == NULL)) { /* enable defio at last moment if not disabled by client */ @@ -346,6 +353,7 @@ static int udl_fb_open(struct fb_info *info, int user) info->fbdefio = fbdefio; fb_deferred_io_init(info); } +#endif pr_notice("open /dev/fb%d user=%d fb_info=%p count=%d\n", info->node, user, info, ufbdev->fb_count); @@ -363,12 +371,14 @@ static int udl_fb_release(struct fb_info *info, int user) ufbdev->fb_count--; +#ifdef CONFIG_FB_DEFERRED_IO if ((ufbdev->fb_count == 0) && (info->fbdefio)) { fb_deferred_io_cleanup(info); kfree(info->fbdefio); info->fbdefio = NULL; info->fbops->fb_mmap = udl_fb_mmap; } +#endif pr_warn("released /dev/fb%d user=%d count=%d\n", info->node, user, ufbdev->fb_count);