Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3686366rwd; Mon, 29 May 2023 15:10:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7XO1rgMjfUsB2U12TNVgYD6oOoq3YwxAGLD9z+gqldmj8xbaX646S3dRlxZnEm1XKRuftB X-Received: by 2002:a17:90b:398:b0:24d:ebfe:be93 with SMTP id ga24-20020a17090b039800b0024debfebe93mr410077pjb.37.1685398214155; Mon, 29 May 2023 15:10:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685398214; cv=none; d=google.com; s=arc-20160816; b=ehlnZFt47Jk+ogeDv0Db/fyk8VA4n4eNvAAMjcTagQIAFkH/pMGrVjX+671N8HxKnX KF+s3O6GUG6+8dBf3w9rRl+u2JCHXEwHHCabOgufGsuRcW/Jcf41vBP4AYuN59t8W3Wi SJGXY7oDvun2OI/PqpHYMxmGGMf9mxL3mXf7GuLGbFd5WdNZERE6UfbGOZc+LxSpGBLj IImfTuqdFw55Wmy0k7d8ILxHH/RfNLRP/CpvLBrBJDXFg8PwCQERnP+ifuD2IwooMMKA AEIiLSSGncmcKNpAm8FT5i1l1lqgkIQut6TySoYbep4MSCtLqhkY5x4VYRoP+hF+13XA D0Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=P/X6+xYAk/xCvIq2fVuBq0byLMQr5dfzb2lYau90XMs=; b=xbQab4wQi/lpFBg5yJ0OU0ZHAKa5SFmN2VlDdcP2NYnZyy17YF4V2b4m1RYfwL9EEy 6P/NUFL6sOPk1S7L3FsVKV8WPsrhqmKrsFXWD91xpJnuOSUkTMbxg9oLDjPxGzbeb9Gl tfMNRhP9gP1hM0mYdGFHfeHOCPN/IbRuBT7vajnRfV5gpcXuIoVjwb+r9v3+W4hjDiXA 9SB7xqc/J1urSEuD/aSRJMUhOorNOYfAc1cH7oIDCDKq9JjLb0ZaXCYesx+ITwmDCi29 JKHLQYHZxDZZbET688jvvP9zbw6FAPjfp97rDhbUYI7ltyUK7OXhWGD+os8iWp7hUH5r uMoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gl12-20020a17090b120c00b002477dac5834si10300253pjb.95.2023.05.29.15.10.01; Mon, 29 May 2023 15:10:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229524AbjE2VLZ (ORCPT + 99 others); Mon, 29 May 2023 17:11:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbjE2VLY (ORCPT ); Mon, 29 May 2023 17:11:24 -0400 Received: from relay08.th.seeweb.it (relay08.th.seeweb.it [5.144.164.169]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F604C7; Mon, 29 May 2023 14:11:23 -0700 (PDT) Received: from SoMainline.org (94-211-6-86.cable.dynamic.v4.ziggo.nl [94.211.6.86]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id 65D193EBA6; Mon, 29 May 2023 23:11:21 +0200 (CEST) Date: Mon, 29 May 2023 23:11:20 +0200 From: Marijn Suijten To: Dmitry Baryshkov Cc: Neil Armstrong , Sam Ravnborg , David Airlie , Daniel Vetter , Caleb Connolly , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, Abhinav Kumar , Kuogee Hsieh , Jessica Zhang Subject: Re: [PATCH RFC 03/10] drm/panel: Add LGD panel driver for Sony Xperia XZ3 Message-ID: References: <20230521-drm-panels-sony-v1-0-541c341d6bee@somainline.org> <20230521-drm-panels-sony-v1-3-541c341d6bee@somainline.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 2023-05-22 04:16:20, Dmitry Baryshkov wrote: > > + if (ctx->dsi->dsc) { > > dsi->dsc is always set, thus this condition can be dropped. I want to leave room for possibly running the panel without DSC (at a lower resolution/refresh rate, or at higher power consumption if there is enough BW) by not assigning the pointer, if we get access to panel documentation: probably one of the magic commands sent in this driver controls it but we don't know which. > > + drm_dsc_pps_payload_pack(&pps, ctx->dsi->dsc); > > + > > + ret = mipi_dsi_picture_parameter_set(ctx->dsi, &pps); > > + if (ret < 0) { > > + dev_err(panel->dev, "failed to transmit PPS: %d\n", ret); > > + goto fail; > > + } > > + ret = mipi_dsi_compression_mode(ctx->dsi, true); > > + if (ret < 0) { > > + dev_err(dev, "failed to enable compression mode: %d\n", ret); > > + goto fail; > > + } > > + > > + msleep(28); > > + } > > + > > + ctx->prepared = true; > > + return 0; > > + > > +fail: > > + gpiod_set_value_cansleep(ctx->reset_gpio, 0); > > + regulator_disable(ctx->vddio); > > + return ret; > > +} > > + /* This panel only supports DSC; unconditionally enable it */ On that note I should perhaps reword this. > > + dsi->dsc = dsc = devm_kzalloc(&dsi->dev, sizeof(*dsc), GFP_KERNEL); > > I think double assignments are frowned upon. Ack. > > > + if (!dsc) > > + return -ENOMEM; > > + > > + dsc->dsc_version_major = 1; > > + dsc->dsc_version_minor = 1; > > + > > + dsc->slice_height = 32; > > + dsc->slice_count = 2; > > + // TODO: Get hdisplay from the mode > > Would you like to fix the TODO? I can't unless either migrating to drm_bridge (is that doable?) or expand drm_panel. That's a larger task, but I don't think this driver is the right place to track that desire. Should I drop the comment entirely or reword it? > > + WARN_ON(1440 % dsc->slice_count); > > + dsc->slice_width = 1440 / dsc->slice_count; - Marijn