Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5954293pxb; Mon, 14 Feb 2022 11:35:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrUCBQnt2QUspy/mKUhgV6p20x8oWxEZmLe0Hle32bsfoccuy+DowJgZJ6UP0CcxJfIOMn X-Received: by 2002:a17:903:2083:: with SMTP id d3mr313313plc.110.1644867332737; Mon, 14 Feb 2022 11:35:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644867332; cv=none; d=google.com; s=arc-20160816; b=ho/Ou93P5Th9S/0m6eX36E47m0A/gmHdygRbvcU0+YLQrid75hRc3Jc46dPEiS7wAK ieELcIcK2VxdL6o16G4rN2UnXEBaJ8ciU69dbXxwnGj8yVkJgcZar9K48raBPnW+d0Be 1YE3rUVRHxfkqGl3utmoUyvJD8ilx6uC0QdmLRhb1mrpCa4DT8w5bG1xazq5NgR0yLMt w7jIoXlKQU8sBZ8aKHJdzma4glQz4+59Zs0uQRQIW4GhicW+HX2ar1dI8Lymn8QZ40qz am/zbifsiqzCSwXdd6quBTYU9jZeq40TwV+hmslp8arm/hMw6PaPvuSvhGuAiN7TYO9G XLiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=EaOHzElyl19Lio2+IgXQrdRampgn3IJJk51hhGDrqvQ=; b=OYiGiuHu7Rn/41uJ1xhIMXSjaO2GpiBqqKwzLjyuAOL9bBU1TaXR6diMbAx+O1SRDT 51zVQ+UdiWyK8+HiAvbDffI6frV/8yAuijnKTg0i64wnM01eS5Z2nT1c980HG1umEIW7 yx0rmtRu7sBQ8jRDfwYzqtb+MVjhbLX3FBVVvDzcKmQIPgV2Q9fsOtaYn3eur9LjyQHP zvMxE0Ih72JG/3UB6VEH1Ol5ASoeSHx+/CnXucQyvQvWKYWp5nONSaXDdKjHsKLOKwWO Mh95RdUyQvPBbMKDh0lvP1BMeeg8ZqtE6XL3q2Ase4PdzBx95aFy/NwckEDo+tTgX3Rn vTqA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id n1si530530pgj.690.2022.02.14.11.35.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 11:35:32 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B8241F9FB0; Mon, 14 Feb 2022 11:23:10 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231849AbiBLUw5 (ORCPT + 99 others); Sat, 12 Feb 2022 15:52:57 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231812AbiBLUw4 (ORCPT ); Sat, 12 Feb 2022 15:52:56 -0500 Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBEF1606EA; Sat, 12 Feb 2022 12:52:50 -0800 (PST) Received: by mail-io1-f44.google.com with SMTP id s18so15542959ioa.12; Sat, 12 Feb 2022 12:52:50 -0800 (PST) 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=EaOHzElyl19Lio2+IgXQrdRampgn3IJJk51hhGDrqvQ=; b=lg1AvYy9fZrQEDNWMtPVa7VQR/1im6pdmkOxCByxuogTnT6Digp6YIDUe8/RfOWcQt EpYLoGOo+HKj8g8VLaEstBQCwy63+OHBHFLux5Tw1ckyt1irbvPq67VKjPFfUPdgb/WS qgkYn629dTWv0a99DWcCJ+2NNOGP9t36tcYcZndKL1eN0lxw88u2uaHyCnaMi+vRhyou um+qg76vyaql2ViSTBqvpC4UiQQUd0P3ykW0K9zRP1E3PQ3N1FITHBYk2aP1LVjdbIda SHaokF84Rz9TQqVMebHYFAX/8QANtUOnl23lGBA6EJzQPqo9ueLvzNox8/6w+lZMebqh dNLw== X-Gm-Message-State: AOAM533aSqEAKNbU7h4xUxLB7yfC9Koru/1rDd2NKNPx8ehh2tKN1QB2 GHPqRTSQGo6K+b+aO7fMRW8QwEWxqf9LplraZqs= X-Received: by 2002:a05:6638:37a1:: with SMTP id w33mr3957440jal.73.1644699168559; Sat, 12 Feb 2022 12:52:48 -0800 (PST) MIME-Version: 1.0 References: <20220203082546.3099-1-15330273260@189.cn> <20220203082546.3099-2-15330273260@189.cn> <20220203085851.yqstkfgt4dz7rcnw@houat> <11ac5696-29e3-fefa-31c0-b7b86c88bbdc@189.cn> <20220209084908.kub4bs64rzhvpvon@houat> <84bfb2fc-595c-3bae-e8a0-c19ccbcfcfd8@189.cn> <20220209161624.42ijbnhanaaari46@houat> In-Reply-To: <20220209161624.42ijbnhanaaari46@houat> From: Ilia Mirkin Date: Sat, 12 Feb 2022 15:52:37 -0500 Message-ID: Subject: Re: [PATCH v6 1/3] drm/lsdc: add drm driver for loongson display controller To: Maxime Ripard Cc: Sui Jingfeng <15330273260@189.cn>, Thomas Bogendoerfer , suijingfeng , David Airlie , dri-devel , Randy Dunlap , Roland Scheidegger , linux-mips@vger.kernel.org, Krzysztof Kozlowski , LKML , Andrey Zhizhikin , Rob Herring , Dan Carpenter , Sam Ravnborg Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Wed, Feb 9, 2022 at 11:16 AM Maxime Ripard wrote: > > On Wed, Feb 09, 2022 at 10:38:41PM +0800, Sui Jingfeng wrote: > > On 2022/2/9 16:49, Maxime Ripard wrote: > > > On Fri, Feb 04, 2022 at 12:04:19AM +0800, Sui Jingfeng wrote: > > > > > > +/* Get the simple EDID data from the device tree > > > > > > + * the length must be EDID_LENGTH, since it is simple. > > > > > > + * > > > > > > + * @np: device node contain edid data > > > > > > + * @edid_data: where the edid data to store to > > > > > > + */ > > > > > > +static bool lsdc_get_edid_from_dtb(struct device_node *np, > > > > > > + unsigned char *edid_data) > > > > > > +{ > > > > > > + int length; > > > > > > + const void *prop; > > > > > > + > > > > > > + if (np == NULL) > > > > > > + return false; > > > > > > + > > > > > > + prop = of_get_property(np, "edid", &length); > > > > > > + if (prop && (length == EDID_LENGTH)) { > > > > > > + memcpy(edid_data, prop, EDID_LENGTH); > > > > > > + return true; > > > > > > + } > > > > > > + > > > > > > + return false; > > > > > > +} > > > > > You don't have a device tree binding for that driver, this is something > > > > > that is required. And it's not clear to me why you'd want EDID in the > > > > > DTB? > > > > 1) It is left to the end user of this driver. > > > > > > > > The downstream motherboard maker may use a dpi(XRGB888) or LVDS panel > > > > which don't have DDC support either, doing this way allow them put a > > > > EDID property into the dc device node in the DTS. Then the entire system works. > > > > Note those panel usually support only one display mode. > > > I guess it depends on what we mean exactly by the user, but the DTB > > > usually isn't under the (end) user control. And the drm.edid_firmware is > > > here already to address exactly this issue. > > > > > > On the other end, if the board has a static panel without any DDC lines, > > > then just put the timings in the device tree, there's no need for an > > > EDID blob. > > > > Loongson have a long history of using PMON firmware, The PMON firmware > > support flush the dtb into the the firmware before grub loading the kernel. > > You press 'c' key, then the PMON will give you a shell. it is much like a > > UEFI shell. Suppose foo.dtb is what you want to pass to the vmlinuz. > > Then type the follow single command can flush the dtb into the PMON firmware. > > > > |load_dtb /dev/fs/fat@usb0/foo.dtb| > > > > For our PMON firmware, it**is** totally under developer/pc board maker's control. > > You can flush whatever dtb every time you bootup until you satisfied. > > It(the pmon firmware) is designed to let downstream motherboard maker and/or > > customers to play easily. > > > > Support of reading EDID from the dtb is really a feature which downstream > > motherboard maker or customer wanted. They sometimes using eDP also whose > > resolution is not 1024x768. This is out of control for a graphic driver > > developer like me. > > And, to reinstate, we already have a mechanism to set an EDID, and if it > wasn't an option, the DT is not the place to store an EDID blob. Note that it's pretty common on laptop GPUs to have the attached panel's EDID be baked into the VBIOS or ACPI (for LVDS / eDP). The hw drivers in question (e.g. nouveau, radeon, probably i915) know how to retrieve it specially. I'm no DT expert, but I'd imagine that it's meant to allow mirroring those types of configurations. Stuff like "drm.edid_firmware" isn't really meant for system-configuration-level things, more as an out in case something doesn't work as it should. Cheers, -ilia