Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8371048imu; Tue, 4 Dec 2018 07:22:57 -0800 (PST) X-Google-Smtp-Source: AFSGD/UPm37u+s7Qpm+67wh/T7MsVIZZtyJFpinznEH4+zzljllu0UW8GOS6ME9XCuQYn8o7aFPE X-Received: by 2002:a62:31c1:: with SMTP id x184mr21023436pfx.204.1543936977526; Tue, 04 Dec 2018 07:22:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543936977; cv=none; d=google.com; s=arc-20160816; b=KwhXu0avYFXM30QoqpOTBa57kYkV0VvAbV3rXBwDmwY2A55jaL05+ltV6Yl+08pjGj frCFZmpgRhlIPZmGgWBZaQdGig0lR9OcxqVjFwNorxmF7szZOD4iKaNzukqR2o94yxgN s0i33FqcSKw6aT11XPo5kb1N90vRePIraKN94EvQ7sdBrUyG/WJQwXcUPqRKy7jG94lX V8M816Po4uOOb7DTk/d3JRfKv2v8KYBLUSr7sfgFDzNzPhNjzQDgr2Y5qvTsx3sF2d+u +I+vEHAK+bMYfCaHDk5qCRBE2b6yvSRfE3IjhzX4J/i+iSu4i9EA5ZTLM5sulb1J4Bwx 1UDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=bxnZOVi3Uenah6dbS+lwc/jQi8hk5u9BafXjIbd1zAc=; b=KDxwAtIYXYqMvTdHzCCfvwIA5TkuriSOjnOy1d5AVwmgfYnzO8bLWk0nyhDn60xTeU qBQ67PmugN/OxidnMPzpn9S4EqbpkFxJt0PdyBPpBf3WTWAl6kPuhP9v4R1hdnwhR2oO FfwXV1paPH9liIofC1Mfwms+1t7Y3KbKO1H7rrJtUkGPEN8E41p/USaKAUf1ReFfAlTU E2ahjUSVtLSzX7k0tTYvpIuBBVDKQzCnsjlsjPoLa4hnHryFzgktTZ8zCMR4iu+8Sf/B W1dvahe1Y/ExcHPmY7HoJydNT3XfF+xT0I1wUD4hJwU6a8FgcsglrmWksv3GGPkWa20g 23pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marek-ca.20150623.gappssmtp.com header.s=20150623 header.b=yWdcx1Q+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t184si18853442pfb.22.2018.12.04.07.22.42; Tue, 04 Dec 2018 07:22:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@marek-ca.20150623.gappssmtp.com header.s=20150623 header.b=yWdcx1Q+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726646AbeLDPUA (ORCPT + 99 others); Tue, 4 Dec 2018 10:20:00 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:37604 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725910AbeLDPT7 (ORCPT ); Tue, 4 Dec 2018 10:19:59 -0500 Received: by mail-qk1-f193.google.com with SMTP id 131so9806454qkd.4 for ; Tue, 04 Dec 2018 07:19:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marek-ca.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=bxnZOVi3Uenah6dbS+lwc/jQi8hk5u9BafXjIbd1zAc=; b=yWdcx1Q+qZWhkm8J6pRO7zCnH6lllmHJNY6RxEHba55ATG/ycJFYifRg3BtAqXg9SP lenVpI8+22jRW0gTK5oW0xDIY9p8xlSo0NoM1w+b7yW/x5GmzXix705b7dJUhEu+lC9L MzpVRxzvUA8MTEvRc7HXmqCIIfUVZrLgdqz7NrMN07cbumli8/12oYfLUeF23hJhEmsh dUWMEAlGiD5napR5O7bhlIu0vgXYyrWOepMb2CcsakbMn/9VRxEeoJu/rsvLlRt5ifen NVOeFe/12+S4yvYgxRsWB6iHxEU6mA7eEvB1ySsVK5csHj89O3h+y82WCKURUqZrj8pv V8YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bxnZOVi3Uenah6dbS+lwc/jQi8hk5u9BafXjIbd1zAc=; b=tJnaRSed8pCphk21mQp0/q3mnteqA0eCJXh4+un5zT/T7xLZc0yYlLbBpGTI81a4+k JW0ZdmG/YDFx83w6vZH2rGaaVXMnEbR6EjYUNgfv5ZkmlTUqZXetGyWZr593GKzIOCU/ km1cyj6TosmYnpD4+EG20XtWog0TObubWAjaRtOyvyFvgTzIZX+3gwGGHau4lVfeijav cWmCvjbMu1d/tJThlC29AvqeIKjvOhqLg3Ag0874yqL17YlcNXvp0SbTOuZw9ZLSQM3a T61aR/zUgB2JxU97Pief4u9oWinxL+dYYFrozSAeXG/uomVNQvsJ6wBmVvQhCmG7dGKr OTIg== X-Gm-Message-State: AA+aEWZepI4TIS6M9t8GVlJnwHX7QF6Rs458BZ0E8frPqxYDD+C/kxXN wtT8soA6LGrVAz+Fmizn0GGVYQ== X-Received: by 2002:a37:2e42:: with SMTP id u63mr18972982qkh.249.1543936798013; Tue, 04 Dec 2018 07:19:58 -0800 (PST) Received: from localhost.localdomain (modemcable014.247-57-74.mc.videotron.ca. [74.57.247.14]) by smtp.gmail.com with ESMTPSA id q17sm11053989qtc.19.2018.12.04.07.19.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 07:19:57 -0800 (PST) From: Jonathan Marek To: freedreno@lists.freedesktop.org Cc: Chris.Healy@zii.aero, festevam@gmail.com, Rob Clark , David Airlie , Rob Herring , Mark Rutland , Sean Paul , Jeykumar Sankaran , linux-arm-msm@vger.kernel.org (open list:DRM DRIVER FOR MSM ADRENO GPU), dri-devel@lists.freedesktop.org (open list:DRM DRIVER FOR MSM ADRENO GPU), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v4 1/5] drm/msm/mdp4: add lcdc-align-lsb flag to control lane alignment Date: Tue, 4 Dec 2018 10:16:57 -0500 Message-Id: <20181204151702.8514-1-jonathan@marek.ca> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This allows controlling which of the 8 lanes are used for 6 bit color. Signed-off-by: Jonathan Marek --- v3: removed empty line and added documentation .../devicetree/bindings/display/msm/mdp4.txt | 2 ++ .../gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c | 21 ++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/display/msm/mdp4.txt b/Documentation/devicetree/bindings/display/msm/mdp4.txt index 3c341a15c..b07eeb38f 100644 --- a/Documentation/devicetree/bindings/display/msm/mdp4.txt +++ b/Documentation/devicetree/bindings/display/msm/mdp4.txt @@ -38,6 +38,8 @@ Required properties: Optional properties: - clock-names: the following clocks are optional: * "lut_clk" +- qcom,lcdc-align-lsb: Boolean value indicating that LSB alignment should be + used for LCDC. This is only valid for 18bpp panels. Example: diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c index 9e08c2efa..c9e34501a 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c @@ -377,20 +377,25 @@ static void mdp4_lcdc_encoder_enable(struct drm_encoder *encoder) unsigned long pc = mdp4_lcdc_encoder->pixclock; struct mdp4_kms *mdp4_kms = get_kms(encoder); struct drm_panel *panel; + uint32_t config; int i, ret; if (WARN_ON(mdp4_lcdc_encoder->enabled)) return; /* TODO: hard-coded for 18bpp: */ - mdp4_crtc_set_config(encoder->crtc, - MDP4_DMA_CONFIG_R_BPC(BPC6) | - MDP4_DMA_CONFIG_G_BPC(BPC6) | - MDP4_DMA_CONFIG_B_BPC(BPC6) | - MDP4_DMA_CONFIG_PACK_ALIGN_MSB | - MDP4_DMA_CONFIG_PACK(0x21) | - MDP4_DMA_CONFIG_DEFLKR_EN | - MDP4_DMA_CONFIG_DITHER_EN); + config = + MDP4_DMA_CONFIG_R_BPC(BPC6) | + MDP4_DMA_CONFIG_G_BPC(BPC6) | + MDP4_DMA_CONFIG_B_BPC(BPC6) | + MDP4_DMA_CONFIG_PACK(0x21) | + MDP4_DMA_CONFIG_DEFLKR_EN | + MDP4_DMA_CONFIG_DITHER_EN; + + if (!of_property_read_bool(dev->dev->of_node, "qcom,lcdc-align-lsb")) + config |= MDP4_DMA_CONFIG_PACK_ALIGN_MSB; + + mdp4_crtc_set_config(encoder->crtc, config); mdp4_crtc_set_intf(encoder->crtc, INTF_LCDC_DTV, 0); bs_set(mdp4_lcdc_encoder, 1); -- 2.17.1