From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1ACC8C433EF for ; Thu, 14 Oct 2021 09:57:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4B64610E6 for ; Thu, 14 Oct 2021 09:57:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230128AbhJNJ70 (ORCPT ); Thu, 14 Oct 2021 05:59:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbhJNJ7Y (ORCPT ); Thu, 14 Oct 2021 05:59:24 -0400 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21A4FC061570 for ; Thu, 14 Oct 2021 02:57:20 -0700 (PDT) Received: by mail-io1-xd36.google.com with SMTP id p68so3010733iof.6 for ; Thu, 14 Oct 2021 02:57:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OZvA6vOCLe0vq1IOFdw9MbIuy04wehYkABusPOOkvWs=; b=nj99OwYtQYofo66YE9oGGAlKqR0StH4OFhjgnBjjRxq2BTK0hKdKl+0xq5V4qslSSS vK4CecV8dQlgQoKNOlmmgXmQARHrO/R0W5JKOtvGpdJDTq0TL5LYftjAhG4tthO6nYzK TgxcSUrmgtR/NkokI1+EOFLoIw5UxFoyT+rCG7bRJ+6dkUU9fEyF8Ss1mqOVueOHLyWe HUV03WhwIRM9PKHtgn62irGapZhKVmJz006wMlRGbkn4c0eQX/gHG6IuStGinBVeYgUp jFca117fHhpvzir6AvfrJPYX0ZjiIk5Gnhfuho+dA3GZJL7OJsvCBQ7nrhpF/7GJYsgV PwmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OZvA6vOCLe0vq1IOFdw9MbIuy04wehYkABusPOOkvWs=; b=WxDN5nO4j102jrIamnO9C9/z47daS4yeHsIeq22DLcLEvmJ+iUUeiYxf76qZ92h/Bq Xb0rxBM6vn0aKv8tEWFjMilDhB+rGJIn7/FpFT6cLN+kaJYYoB57sXv3RA38B3PxK6Jk ljQ7X4Vpn+pl0ivnxiZHANMPQlaYjfyz7rlH8+4zgaVumwQ6GBKXdgC5lqSyYrHdQYIj w8ZEQ1mhBL2xSZx0X8pb3J6U8qbxpjYEO6SjgLXHderq3q2lgEtzAXEWc+1L2YNjXg+y iMKp3rrXyF36jzIs9nb/ejN6mpzM1zSy9Pi7JyKbUWvDVYXJmKIF9jYGPgNvau+TxzKD hlTg== X-Gm-Message-State: AOAM533uI95PrcOvO41fi+e7hmp/AM3NeljmGOtpQXRW8TKNEyl1yzOG 7OJ8xEu1bRtD0rS2a0KXlb8rSjorZm+IHKZXVZk= X-Google-Smtp-Source: ABdhPJznhuD2wn/mF3MaGPcGhssi4eCHMwzjrwVERh1LZVOOYW30Yd/TVEo1+T7pC10cFF122/4ltVCS9fJ4oOCEkvM= X-Received: by 2002:a02:2124:: with SMTP id e36mr3327316jaa.35.1634205439528; Thu, 14 Oct 2021 02:57:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Alistair Francis Date: Thu, 14 Oct 2021 19:56:00 +1000 Message-ID: Subject: Re: Revert "video: fbdev: mxsfb: Remove driver" To: Sam Ravnborg Cc: Marek Vasut , Fabio Estevam , Shawn Guo , Sascha Hauer , dl-linux-imx , b.zolnierkie@samsung.com, Linux Kernel Mailing List , Alistair Francis Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 20, 2021 at 8:36 AM Alistair Francis wrote: > > On Fri, Aug 20, 2021 at 1:43 AM Sam Ravnborg wrote: > > > > Hi Alistair, > > > > On Thu, Aug 19, 2021 at 07:10:00PM +1000, Alistair Francis wrote: > > > On Thu, Aug 19, 2021 at 4:38 AM Sam Ravnborg wrote: > > > > > > > > Hi Alistair, > > > > > > > > > > > > > > These are the EINVAL strace tells me in the not working case: > > > > > > > > > > prctl(PR_CAPBSET_READ, 0x30 /* CAP_??? */) = -1 EINVAL (Invalid argument) > > > > > prctl(PR_CAPBSET_READ, 0x2c /* CAP_??? */) = -1 EINVAL (Invalid argument) > > > > > prctl(PR_CAPBSET_READ, 0x2a /* CAP_??? */) = -1 EINVAL (Invalid argument) > > > > > prctl(PR_CAPBSET_READ, 0x29 /* CAP_??? */) = -1 EINVAL (Invalid argument) > > > > > ioctl(5, FBIOPUT_VSCREENINFO, 0x4ce8e0) = -1 EINVAL (Invalid argument) > > > > > > > > > > I'm guessing it's related to FBIOPUT_VSCREENINFO then, is that > > > > > something that could be added to the DRM emulation? > > > > > > > > If it turns out FBIOPUT_VSCREENINFO is the culprint it would also be > > > > good to know why we see EINVAL. > > > > One way is to sprinkle a number of printk's in fb_set_var(), > > > > then you can see how far you get before it fails. > > > > > > Thanks for the help. > > > > > > I see this line: > > > > > > ret = info->fbops->fb_check_var(var, info); > > > > > > in fb_set_var() > > > > > > returning early. > > > > Super, then next step is to annotate drm_fb_helper_check_var() > > to see where it fails. > > Try this and let us know the result. > > Thanks! > > After adding some prints, I realised there are already some in there > that are disabled by default. After enabling them I see this: > > "fbdev emulation doesn't support changing the pixel clock, value of > pixclock is ignored" > > and > > "fb requested width/height/bpp can't fit in current fb request > 260x1408-32 (virtual 260x23936) > 334x1405-32" > > which returns EINVAL. > > This is where I'm confused though. The values 334 and 1405 are taken > from the vendor and in the working fbdev driver they are using the > same values. > > I tried to add a similar print to mxsfb_check_var() for the working > version, to check what the values are, but there doesn't seem to be > any equivalent of fb->width and friends. I dug into this some more. In the working mxsfb and non-working fbdev emulation the userspace software sets: xres: 260 yres: 1408 xres_virtual: 260 yres_virtual: 23936 That passes the old mxsfb_check_var() and works. While that fails the new fbdev emulation check. Even increasing the width and height from 334x14085 to 260x23936 doesn't help as I get a range of other errors and no display. Just removing the check also doesn't work and results in kernel panics. It seems there is some difference in handling the resolutions between the mxsfb driver and the fbdev emulation on the new DRM driver. I'm just not sure what the difference is. Alistair