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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E5C7C77B73 for ; Mon, 22 May 2023 13:47:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232966AbjEVNrX (ORCPT ); Mon, 22 May 2023 09:47:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230107AbjEVNrW (ORCPT ); Mon, 22 May 2023 09:47:22 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DCE0ED for ; Mon, 22 May 2023 06:47:20 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4eed764a10cso6695716e87.0 for ; Mon, 22 May 2023 06:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684763238; x=1687355238; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=BEm06L/7RszwTIxy7pZPEut/9V9YOp9nD/0czZj6vfg=; b=qspBx3gPki+B/6OIlBL+/7rh81kgid9ZjuEPUTdGBfHWkhsgiYeag/dvITBGiPSh1e CtHpklW80UGUb+vB9V86s3hKhhoJNxDxud2VmrA5IE88VG8UnnwzAX3kgoF7kkWBv9Jz 8pLxhBA0imSQOkFB+FaM28GXUAqHo1KN9YY2C+fFsyJagKWtyU6uC/t1oPLjdyldwN3+ h2WnRYyuExTMMhRhbmqMYkAORscjl6KXw0N5yaT+gDb2Lzx8NKVFeFv39ofDf7MaH//a zIHPG/1YnrNz1cz1QYsKp0PvTZ+hXwlJ+VGmmm6mFzIdmHQ75tNWr/8FQXKHGEeMWl0E gszg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684763238; x=1687355238; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BEm06L/7RszwTIxy7pZPEut/9V9YOp9nD/0czZj6vfg=; b=Wyp1QKGP8kkWlTU/hesiuMiyf2Y2bLREF8mBiPkY3voa4z8jAcJ3QRBQzcvuq4hzQj RM0JdL/iBxCil4p2p2PF1z0BFRU/KEmu5nIoMwBHRecSATn3HMKv/CjMHAmkzyt76cTj II6mCVpOxh9K1Bx8riPG8cjMy2btKPJxv0njSyojO4z2B8Ko0s7ACHUa8KxWwUDym/nR PD0jdGlHzO4KbvBOSM3gk0reXTuV49pYb9rSgDRgaNvSMYIdukF390YctU3ht6QPEfQx d2EJkHrzmfGtIKemzoMcynVyrXY83aFotkDn2cwcEGFuiAICvh347TLpF6NlBGoywIFk tASA== X-Gm-Message-State: AC+VfDxcH+Dm74drFY1rb9y4EfvpIuuolWCJAZdNZXMBtp/E+9GrpKcK EL14SDmdFxXMrjFN+dsQ75lunA== X-Google-Smtp-Source: ACHHUZ554G38stoHAuoE6L5jFwpgLt44bq7oflbiqDD8iP07EyugQUr3QL7/ePqCIUhz7TIxfRodCA== X-Received: by 2002:ac2:539a:0:b0:4cc:96f8:f9c6 with SMTP id g26-20020ac2539a000000b004cc96f8f9c6mr3451737lfh.5.1684763238295; Mon, 22 May 2023 06:47:18 -0700 (PDT) Received: from ?IPV6:2001:14ba:a0db:1f00::8a5? (dzdqv0yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a0db:1f00::8a5]) by smtp.gmail.com with ESMTPSA id x14-20020ac259ce000000b004f13bd73419sm996412lfn.38.2023.05.22.06.47.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 May 2023 06:47:17 -0700 (PDT) Message-ID: <2e17e84d-aced-1f28-990f-689c8c56ce45@linaro.org> Date: Mon, 22 May 2023 16:47:17 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH 2/2] drm/panel: Add driver for Visionox r66451 panel Content-Language: en-GB To: neil.armstrong@linaro.org, Jessica Zhang , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski Cc: Abhinav Kumar , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230516-b4-r66451-panel-driver-v1-0-4210bcbb1649@quicinc.com> <20230516-b4-r66451-panel-driver-v1-2-4210bcbb1649@quicinc.com> <3cca2809-fa26-f0cf-2ccc-6737d150b43d@linaro.org> <69c6f4fe-4610-8301-b90b-03bcea7587b9@linaro.org> From: Dmitry Baryshkov In-Reply-To: <69c6f4fe-4610-8301-b90b-03bcea7587b9@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 22/05/2023 12:10, Neil Armstrong wrote: > On 18/05/2023 02:19, Dmitry Baryshkov wrote: >> On 16/05/2023 23:20, Jessica Zhang wrote: >>> Add support for the 1080x2340 Visionox R66451 AMOLED DSI panel that >>> comes with the Qualcomm HDK8350 display expansion pack. >>> >>> The panel enables display compression (DSC v1.2) by default. >>> >>> Signed-off-by: Jessica Zhang >>> --- >>>   drivers/gpu/drm/panel/Kconfig                 |   8 + >>>   drivers/gpu/drm/panel/Makefile                |   1 + >>>   drivers/gpu/drm/panel/panel-visionox-r66451.c | 395 >>> ++++++++++++++++++++++++++ >>>   3 files changed, 404 insertions(+) [skipped] >>> + >>> +    ret = mipi_dsi_dcs_exit_sleep_mode(dsi); >>> +    if (ret < 0) { >>> +        dev_err(dev, "Failed to exit sleep mode: %d\n", ret); >>> +        return ret; >>> +    } >>> +    msleep(120); >>> + >>> +    ret = mipi_dsi_dcs_set_display_on(dsi); >> >> Should the mipi_dsi_dcs_set_display_on() (and maybe exit sleep mode) >> be a a part of _enable()? Correspondingly _off should IMO be a part of >> _disable callback(). > > Nop, mipi_dsi_dcs_set_display_on() should be part of prepare, to be > called *before* the video stream starts, enable is called after in the > atomic modeset chain, To summarize our discussion: some controllers do not support sending commands in non-LPM mode. Thus the panel driver should send all commands before the DSI host switches from LPM to VIDEO mode. Is this corret? > >> >>> +    if (ret < 0) { >>> +        dev_err(dev, "Failed on set display on: %d\n", ret); >>> +        return ret; >>> +    } >>> +    msleep(20); >> >> >> Do we need to add here the following line? >> >> dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; >> > > No, it will be changed by the DSI core. Hmm, where? > >> >>> + >>> +    return 0; >>> +} [skipped] >>> +static int visionox_r66451_bl_update_status(struct backlight_device >>> *bl) >>> +{ >>> +    struct mipi_dsi_device *dsi = bl_get_data(bl); >>> +    u16 brightness = backlight_get_brightness(bl); >>> + >>> +    return mipi_dsi_dcs_set_display_brightness(dsi, >>> cpu_to_le16(brightness)); >> >> mipi_dsi_dcs_set_display_brightness() already converts the brightness, >> so you don't need cpu_to_le16 here. > > > The _large variant must be used instead. But cpu_to_le16 is NOP, isn't it? -- With best wishes Dmitry