From patchwork Thu Jan 24 16:58:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10779547 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 926361515 for ; Thu, 24 Jan 2019 16:58:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BCCB299E4 for ; Thu, 24 Jan 2019 16:58:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AC302F39F; Thu, 24 Jan 2019 16:58:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A38A92E9AD for ; Thu, 24 Jan 2019 16:58:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 323386F1C4; Thu, 24 Jan 2019 16:58:49 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8F32B6F1B3 for ; Thu, 24 Jan 2019 16:58:46 +0000 (UTC) Received: by mail-ed1-x544.google.com with SMTP id y56so5139786edd.11 for ; Thu, 24 Jan 2019 08:58:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZfPUtFHJWeXlrBkM9EK/stth9GLtfNoYoHaTSCdWdoc=; b=A2TOKbEkD0HX+Hw81jtQy9+Rl0gBSprlQXAmvGwtCyRuFlMe1M36kzdIedk8Cfn2XA 3Z2gJaLlFBhdOROAeGH3rxhxet0rJmswiwZTYpopHT1CaZZ+sJ07S1BRuqCEwLg+V7mf o8OLmtTlXhoBq6TcNYMKUF0afXyI7uin0KBue5nn0lCDdsXFAsiK6TP0q1RXVUdWNF3x HzDV//IzgNTv5uxexoIKwTlMwPJzZI9jP4xv8EhnUFy7j/RtLByJEMUTcynYjIopdYhk VWKANzmk65bbBlgzTlm0fMZej2FGX6mDpJ2s0Ei+QWmuzC944L3fdqTzD1F6vFYtl4Cv cxdw== X-Gm-Message-State: AJcUukdaF07SsdajhCG0E2vbcKqv/EvkskuzyQkfiR2N08KPdJ1d/5sP xMd3uwhPooEFlf79gy6LQUQ+IjFQd6A= X-Google-Smtp-Source: ALg8bN71XybfaIEGlYvO87jMK8YFRGhLeSO+uPOiv/b0l/+f9pexB0Og3BX98HwlfEjiiG4DjFHeYg== X-Received: by 2002:a50:98c5:: with SMTP id j63mr7371387edb.273.1548349124474; Thu, 24 Jan 2019 08:58:44 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id w31sm11219233edw.82.2019.01.24.08.58.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 08:58:43 -0800 (PST) From: Daniel Vetter To: DRI Development Date: Thu, 24 Jan 2019 17:58:09 +0100 Message-Id: <20190124165831.16427-5-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190124165831.16427-1-daniel.vetter@ffwll.ch> References: <20190124165831.16427-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 04/26] drm/fb-helper: Add fill_info() functions X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Intel Graphics Development , Daniel Vetter Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP The fbdev split between fix and var information is kinda pointless for drm drivers since everything is fixed: The fbdev emulation doesn't support changing modes at all. Create a new simplified helper and use it in the generic fbdev helper code. Follow-up patches will beef it up more and roll it out to all drivers. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_fb_helper.c | 27 +++++++++++++++++++++++++-- include/drm/drm_fb_helper.h | 1 + 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 5eaccd202f4f..34c4ed378796 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -2105,6 +2105,30 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe } EXPORT_SYMBOL(drm_fb_helper_fill_var); +/** + * drm_fb_helper_fill_info - initializes fbdev information + * @info: fbdev instance to set up + * @fb_helper: fb helper instance to use as template + * + * + * Sets up the variable and fixed fbdev metainformation from the given fb helper + * instance and the drm framebuffer allocated in &drm_fb_helper.fb. + * + * Drivers should call this (or their equivalent setup code) from their + * &drm_fb_helper_funcs.fb_probe callback after having allocated the fbdev + * backing storage framebuffer. + */ +void drm_fb_helper_fill_info(struct fb_info *info, + struct drm_fb_helper *fb_helper) +{ + struct drm_framebuffer *fb = fb_helper->fb; + + drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth); + drm_fb_helper_fill_var(info, fb_helper, fb->width, fb->height); + +} +EXPORT_SYMBOL(drm_fb_helper_fill_info); + static int drm_fb_helper_probe_connector_modes(struct drm_fb_helper *fb_helper, uint32_t maxX, uint32_t maxY) @@ -3163,8 +3187,7 @@ int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper, #endif strcpy(fbi->fix.id, "DRM emulated"); - drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->format->depth); - drm_fb_helper_fill_var(fbi, fb_helper, sizes->fb_width, sizes->fb_height); + drm_fb_helper_fill_info(fbi, fb_helper); if (fb->funcs->dirty) { struct fb_ops *fbops; diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index bb9acea61369..e8d92724f472 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h @@ -292,6 +292,7 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe uint32_t fb_width, uint32_t fb_height); void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, uint32_t depth); +void drm_fb_helper_fill_info(struct fb_info *info, struct drm_fb_helper *fb_helper); void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper);