From patchwork Wed Dec 20 14:53:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pieter \\\"PoroCYon\\\" Sluys" X-Patchwork-Id: 10125795 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3056060388 for ; Wed, 20 Dec 2017 14:53:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FB542977C for ; Wed, 20 Dec 2017 14:53:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1233D29799; Wed, 20 Dec 2017 14:53:24 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_TVD_MIME_EPI, URIBL_BLACK autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 499F52977C for ; Wed, 20 Dec 2017 14:53:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754746AbdLTOxW (ORCPT ); Wed, 20 Dec 2017 09:53:22 -0500 Received: from cock.li ([185.100.85.212]:51735 "EHLO cock.li" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753868AbdLTOxV (ORCPT ); Wed, 20 Dec 2017 09:53:21 -0500 Subject: Re: [PATCH] vfb: fix video mode and line_length being set when loaded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=national.shitposting.agency; s=mail; t=1513781599; bh=1x8NIAr3ok2uhXDlXXEvRk4BO95jroEYu4X6BQdW0fo=; h=Subject:To:References:From:Cc:Date:In-Reply-To:From; b=sT9eAacOSo+aLdpLntivIANjunnptu/kO1kUnDhCqw+6WZnSNNJ8UTCz2g3p95D1f sblaIPgLy6bguJMZkG7h/M6Dq7Mv1lCrpHtJMBb2WNAX2DhEhBd1fmolmqFIDuTOUR gJ94jeeJvb5GTvs19DzZ4AJMFpk44U21J0N6aAALwF6hVPNRBTdLigAoHjGd7kYLHt +pg1ay03kJKa/86/w7jNMMLWsgF52PvwXFRhfP2W3pGLyhfYAyDeeVrvBLVcng9il+ 72K4hABZ4IeOTeFzAuOxM5ZfaFXZxy3MxpBLJnLj1eGJPU4bcd71vJ/61HJCmznkQL /Jmbz/Of4l6jg== To: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <39a57338-18ac-c64f-1cf1-70a5f905990a@national.shitposting.agency> From: "Pieter \"PoroCYon\" Sluys" Cc: Bartlomiej Zolnierkiewicz , Geert Uytterhoeven Message-ID: <81bf0d1e-ee7a-29ea-d19e-ffeb41d285fe@national.shitposting.agency> Date: Wed, 20 Dec 2017 14:53:00 +0000 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Geert Uytterhoeven: > Please add your "Signed-off-by", cfr. > Documentation/process/submitting-patches.rst. Sorry I knew I would've messed up *something*. > You can drop the tests for 2 and 4, as these are no longer used by the driver. Done that. Cc: Bartlomiej Zolnierkiewicz Signed-off-by: Pieter "PoroCYon" Sluys --- drivers/video/fbdev/vfb.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.15.1 Fix vfb not setting the video mode and line_length when loaded. Copyright 2017 Pieter "PoroCYon" Sluys under the terms of the GPLv2 --- drivers/video/fbdev/vfb.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/video/fbdev/vfb.c b/drivers/video/fbdev/vfb.c index da653a080394..5fb360283c6b 100644 --- a/drivers/video/fbdev/vfb.c +++ b/drivers/video/fbdev/vfb.c @@ -239,8 +239,23 @@ static int vfb_check_var(struct fb_var_screeninfo *var, */ static int vfb_set_par(struct fb_info *info) { + switch (info->var.bits_per_pixel) { + case 1: + info->fix.visual = FB_VISUAL_MONO01; + break; + case 8: + info->fix.visual = FB_VISUAL_PSEUDOCOLOR; + break; + case 16: + case 24: + case 32: + info->fix.visual = FB_VISUAL_TRUECOLOR; + break; + } + info->fix.line_length = get_line_length(info->var.xres_virtual, info->var.bits_per_pixel); + return 0; } @@ -450,6 +465,8 @@ static int vfb_probe(struct platform_device *dev) goto err2; platform_set_drvdata(dev, info); + vfb_set_par(info); + fb_info(info, "Virtual frame buffer device, using %ldK of video memory\n", videomemorysize >> 10); return 0; -- 2.15.1