Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3293717lfo; Mon, 23 May 2022 00:55:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwG1ZeO5n2tuN7jSv7y+I0HO8OwfxqrpeW+h9xqMkXyvoTLzbz906nuNya9/GMRcon7H9vU X-Received: by 2002:a17:903:2042:b0:161:53e9:c7b7 with SMTP id q2-20020a170903204200b0016153e9c7b7mr22077837pla.122.1653292523695; Mon, 23 May 2022 00:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653292523; cv=none; d=google.com; s=arc-20160816; b=mdl66x2Z7DwpOTRyqnFAohnWJD/ic1dBBUrmSF3vH4cbSpxugwma1MMBDDaEGu5KZ7 2Jr1UGUSuhPOzKKXkeNibXqPao123yeKYkhRz74FrvMBiFKZcp986d9iS3/Fu90x8hoO R3wbqajuQlRKd2567k1zOSrNmzw0a9zU2GHLdIc+UC6BeBo0+Yip1oNfTKU8kP7+UkVq ns6Pdkatp6BG2iaZV7ssMyOvk+EEpkBqA4UAdNEHs7kkSGSGVbC+P/PPyX4SnFZp8IHj XMrqpdREgefzguFQIZAUJCeqKaWdfnsTAThWZ3nhiamjzu6c3E3W39fowz/Flgl8L7PW kw6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=UDIoJ4xlMzZE/j3q78dU9+IH8OxDgewtkK08b3RHhh0=; b=EhoVFZs87kJwOk3clPNbzYHDpYH8CtPcX8vt6YicFz9+yAOZTD3qHFIBiu+wW9163v 6sc7q2omRwCXWrKGRrsjQdeaG1xobDkzk5IdlUdPr5f+5Hwld1vFGfJpYzRpzh56l+B2 1f4AYPbtR66AxzgK40xOc3XtEDmytU9gUfjj8wleMg7cLSuSlhqx2L7KtvHDUzzvmYoO qJO0I/G/s0bn4hTl2GNxjtduC4VzcXPn9ejwFGcCTnRJmje+qbPoTxjpyTmeJY9+w5Xd OyGI7Nra6yRGv4uGTHaLnib1fY8Iggz/LTQIgtt1gW38Kcl8ptuSl3KYGRENRbYyHf4p 3bkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Cj9Kd/f8"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h17-20020a17090aea9100b001dfc03117d7si11449452pjz.71.2022.05.23.00.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:55:23 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Cj9Kd/f8"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5B58857B04; Sun, 22 May 2022 23:56:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347786AbiETJl6 (ORCPT + 99 others); Fri, 20 May 2022 05:41:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347776AbiETJlk (ORCPT ); Fri, 20 May 2022 05:41:40 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7E89E5A2C9 for ; Fri, 20 May 2022 02:41:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653039698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UDIoJ4xlMzZE/j3q78dU9+IH8OxDgewtkK08b3RHhh0=; b=Cj9Kd/f8HLFnfM5KxQItcgoa009SD6R9ltHiVbJFcO4m0RAemwNfpDl4+i7s1owogVfkYR fAbPUjd3dNKdyJox8rJrD3Tks4IxsH7WPkoMJV/LirXkWYrOZEICCrdvI4MqKaGGDDZ/iC Wbz/hJUuMkk300uJWBiwVApRBKe0hjw= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-280-o0Q-Zr4gMcSvpmWB-MmSrA-1; Fri, 20 May 2022 05:41:37 -0400 X-MC-Unique: o0Q-Zr4gMcSvpmWB-MmSrA-1 Received: by mail-wm1-f69.google.com with SMTP id z23-20020a05600c221700b003942fd37764so5850346wml.8 for ; Fri, 20 May 2022 02:41:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=UDIoJ4xlMzZE/j3q78dU9+IH8OxDgewtkK08b3RHhh0=; b=1HJTExaeKHVV1SDjr86XdsbofuzvksrFV55f4qRIxqKKGNB3dZJS6RQ5oqFAkGCWVz +eraP2e5tJOaZWhMvpPpacJEye+2FXgvVwjB6a1yDrecaR5CbRmNZeme+Ya/yxLx0p52 4G8Y7TMOf/oQwEESTF0TBjCTGZ4VFCwClCpeIuL+YWVJlW14RtY6qxHeo0wWgA5Ida+W FkGtSEGZKHV0vvVv27NL5PPQAwmlhoyuHU9Pt0geDvp34xt2ZSF7aTUKwcDs/G7jr4ZG rogZMWlarcI6vM7j/iJt5cxUDfuMcRc0JNeMrzJoc9NHKncxST7oYb1qLFz4NYrbOKLS MAaw== X-Gm-Message-State: AOAM53176FO8XAOjYVk+S5RKi/7xO7DJc8rfVjBqr04GMaicWtJCkC6R /3xRN8P2MfCWC+gs1NQwI1v2V/KbIeux5c0LBJjxKJ0mu4I6h1WVVN64gqmR5UsPePKpY0I6SWR vMVuH7zRmi7VwvrL6vESt8aSU X-Received: by 2002:a5d:540a:0:b0:20e:69db:4dc5 with SMTP id g10-20020a5d540a000000b0020e69db4dc5mr6044933wrv.337.1653039695981; Fri, 20 May 2022 02:41:35 -0700 (PDT) X-Received: by 2002:a5d:540a:0:b0:20e:69db:4dc5 with SMTP id g10-20020a5d540a000000b0020e69db4dc5mr6044896wrv.337.1653039695587; Fri, 20 May 2022 02:41:35 -0700 (PDT) Received: from [192.168.1.129] (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id s1-20020adf8901000000b0020c547f75easm1881682wrs.101.2022.05.20.02.41.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 May 2022 02:41:35 -0700 (PDT) Message-ID: <0bae0df1-48ae-d02f-bce4-d1f69acf269e@redhat.com> Date: Fri, 20 May 2022 11:41:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH V11 09/22] LoongArch: Add boot and setup routines Content-Language: en-US To: Ard Biesheuvel , Huacai Chen Cc: Arnd Bergmann , Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , Andrew Morton , David Airlie , Jonathan Corbet , Linus Torvalds , linux-arch , Linux Doc Mailing List , Linux Kernel Mailing List , Xuefeng Li , Yanteng Si , Huacai Chen , Guo Ren , Xuerui Wang , Jiaxun Yang , Stephen Rothwell , linux-efi References: <20220518092619.1269111-1-chenhuacai@loongson.cn> <20220518092619.1269111-10-chenhuacai@loongson.cn> From: Javier Martinez Canillas In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Ard and Huacai, On 5/20/22 11:17, Ard Biesheuvel wrote: [snip] >> + >> +static int __init register_gop_device(void) >> +{ >> + void *pd; >> + >> + if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI) >> + return 0; >> + pd = platform_device_register_data(NULL, "efi-framebuffer", 0, >> + &screen_info, sizeof(screen_info)); >> + return PTR_ERR_OR_ZERO(pd); >> +} >> +subsys_initcall(register_gop_device); > > Not sure this is now the correct way to do this - cc'ing Javier. > Is not the correct way to do it indeed, that can just be dropped. We have unified now all the system framebuffer platform device registration under drivers/firmware/sysfb.c (and the EFI quirks if needed under drivers/firmware/efi/sysfb_efi.c). So the only thing that a platform should do, is to enable the the CONFIG_SYSFB config option. The screen_info should be set correctly from the EFI GOP, but it seems that's already working since you were already using it in register_gop_device(). But also, the "efi-framebuffer" platform device matches against the legacy efifb fbdev driver. And now there's a simpledrm driver that is also able to use the firmware-provided framebuffer. You can enable that driver with CONFIG_DRM_SIMPLEDRM. That driver though doesn't match against "efi-framebuffer" but with a "simple-framebuffer", to make sysfb register that instead of the "efi-framebuffer" device, you need to set CONFIG_SYSFB_SIMPLEFB too. If for some reasons you need to provide a fbdev interface to the user-space, you can enable CONFIG_DRM_FBDEV_EMULATION to have that. In summary, just enable the following to use the firmware framebuffer: CONFIG_DRM_SIMPLEDRM=y CONFIG_DRM_FBDEV_EMULATION=y CONFIG_SYSFB=y CONFIG_SYSFB_SIMPLEFB=y -- Best regards, Javier Martinez Canillas Linux Engineering Red Hat