From patchwork Tue Jun 13 07:04:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manikandan Muralidharan X-Patchwork-Id: 107117 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp357428vqr; Tue, 13 Jun 2023 00:18:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4x19hsr618qg5AZ8fJAuUCGG3vvxc0asxEkRHrTvP3L4Us+d0S6n/3bJK0NLn624srDBcL X-Received: by 2002:a17:906:7947:b0:974:e767:e1db with SMTP id l7-20020a170906794700b00974e767e1dbmr12525768ejo.46.1686640700883; Tue, 13 Jun 2023 00:18:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686640700; cv=none; d=google.com; s=arc-20160816; b=s37nckuCLRB/LLMgfl1nv9EPKZ+N7rrlGRGqRVLD/QrBamY4ZshqnNZlKkiPIX54ZJ wXJAssVl8Et/dD0h0C4Lgo4vZt5eR9PWo3531vVXF3ZXT9HgfTfOX7cehRMO9h5iW19G 2MjOtoYJKK5xtRNQPPQodJeQ3WTuQ/7+oNAsC5aaizVWi2OQF5oY+QAV1S3zMsjAIyeV AJvsdmwds4t7aJUPXDHJyAeEHXWGO/9VtkLdPTPdXLvXg96U3U+vUhs1P+6QStRb5U9M RCnOSh2v6h7nSHrTnp98JyAIwcmL91F3xpZmpphLvIrliZZVY6YtmmFmvgiKrF1zhVnT EMTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JRWwxC2xvquConYUsUskl8FgJUY+7MaZ1UUs7R38bm8=; b=nrwMl8mYLV8Erb5V3r0Y1ikYh9MHXGHC2f0Mre5HvhslJ0jB9eIh4McXAOnET0wTo+ JomjYEv9aggWBN5lOGie9xUB/V248Z4OKps3S+Bz/DkHLWtEiqLc1DZGGprC7InysKoC G5b5+9KLt/YtIwcffa0UuOTjN3aFCFes7Tx1SDGR87TBVzgDzuNc4f8TVbAd54kQz8zS TJz0q0QY2mfYkyFbtAEXHykOc+iv1O0dshb8u+oFp16s9WuwCdl044IjqbOhoQzthu6w lqRJ7zejj+VXv5l6cPPb4/8J80/+hqxxK+aqsOdFQsqMP4U7KgKTt6TSFz11J0OYH5VE wp7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=lauxSJOB; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kk6-20020a170907766600b00976a813d882si3005909ejc.4.2023.06.13.00.17.56; Tue, 13 Jun 2023 00:18:20 -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; dkim=pass header.i=@microchip.com header.s=mchp header.b=lauxSJOB; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240417AbjFMHGA (ORCPT + 99 others); Tue, 13 Jun 2023 03:06:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238213AbjFMHFr (ORCPT ); Tue, 13 Jun 2023 03:05:47 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6C0E1997; Tue, 13 Jun 2023 00:05:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1686639946; x=1718175946; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YVXAjXjjBdiZ15FDtA1gEK4Qgld3EqNhdGvvetoHNks=; b=lauxSJOBAtHwttZXjxV8muU89Vbek/Yiw5CnSl7WSuykiDU83T5/13xO CfRZCCW1easTxQkUkhUPDBlDGc2Wh+DNea6HCwb/9pNK4foJmGFoVAt0o lSohy/KSHE4sd+cQ5eoHwQcdmKZ8kQGwGqa2F4GhVB5O/P3kCiihae910 T6UgzjZevNdSrMCimpVlYUZCmNwHZJSxmwmZqxY5lXJoUNr7S841W9Eix S73MF6v/Fl7moJWBaLzvzzr68Cs7okVvZ8dBSZbEtPt2bt5JAFiq5sC6a 5WJdDKPspu9OHuN/+wP2YtpTDlsaSbQqPt9Sl8rzHLjY1s5EBCLK/EOe1 Q==; X-IronPort-AV: E=Sophos;i="6.00,238,1681196400"; d="scan'208";a="218182246" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 13 Jun 2023 00:05:45 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Tue, 13 Jun 2023 00:05:29 -0700 Received: from che-lt-i67131.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Tue, 13 Jun 2023 00:05:20 -0700 From: Manikandan Muralidharan To: , , , , , , , , , , , , , , CC: , , , , , , , Manikandan Subject: [PATCH 3/9] drm: atmel-hlcdc: add LCD controller layer definition for SAM9X7 Date: Tue, 13 Jun 2023 12:34:20 +0530 Message-ID: <20230613070426.467389-4-manikandan.m@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230613070426.467389-1-manikandan.m@microchip.com> References: <20230613070426.467389-1-manikandan.m@microchip.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768570959084458167?= X-GMAIL-MSGID: =?utf-8?q?1768570959084458167?= Add the LCD controller layer definition and descriptor structure for SAM9X7 for the following layers, - Base Layer - Overlay1 Layer - Overlay2 Layer - High End Overlay Signed-off-by: Manikandan Muralidharan --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 96 ++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c index fa0f9a93d50d..d7ad828e9e8c 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -462,6 +462,98 @@ static const struct atmel_hlcdc_dc_desc atmel_hlcdc_dc_sam9x60 = { .layers = atmel_hlcdc_sam9x60_layers, }; +static const struct atmel_hlcdc_layer_desc atmel_xlcdc_sam9x7_layers[] = { + { + .name = "base", + .formats = &atmel_hlcdc_plane_rgb_formats, + .regs_offset = 0x60, + .id = 0, + .type = ATMEL_HLCDC_BASE_LAYER, + .cfgs_offset = 0x1c, + .layout = { + .xstride = { 2 }, + .default_color = 3, + .general_config = 4, + .disc_pos = 5, + .disc_size = 6, + }, + .clut_offset = 0x700, + }, + { + .name = "overlay1", + .formats = &atmel_hlcdc_plane_rgb_formats, + .regs_offset = 0x160, + .id = 1, + .type = ATMEL_HLCDC_OVERLAY_LAYER, + .cfgs_offset = 0x1c, + .layout = { + .pos = 2, + .size = 3, + .xstride = { 4 }, + .pstride = { 5 }, + .default_color = 6, + .chroma_key = 7, + .chroma_key_mask = 8, + .general_config = 9, + }, + .clut_offset = 0xb00, + }, + { + .name = "overlay2", + .formats = &atmel_hlcdc_plane_rgb_formats, + .regs_offset = 0x260, + .id = 2, + .type = ATMEL_HLCDC_OVERLAY_LAYER, + .cfgs_offset = 0x1c, + .layout = { + .pos = 2, + .size = 3, + .xstride = { 4 }, + .pstride = { 5 }, + .default_color = 6, + .chroma_key = 7, + .chroma_key_mask = 8, + .general_config = 9, + }, + .clut_offset = 0xf00, + }, + { + .name = "high-end-overlay", + .formats = &atmel_hlcdc_plane_rgb_and_yuv_formats, + .regs_offset = 0x360, + .id = 3, + .type = ATMEL_HLCDC_OVERLAY_LAYER, + .cfgs_offset = 0x30, + .layout = { + .pos = 2, + .size = 3, + .memsize = 4, + .xstride = { 5, 7 }, + .pstride = { 6, 8 }, + .default_color = 9, + .chroma_key = 10, + .chroma_key_mask = 11, + .general_config = 12, + .csc = 16, + .scaler_config = 23, + }, + .clut_offset = 0x1300, + }, +}; + +static const struct atmel_hlcdc_dc_desc atmel_xlcdc_dc_sam9x7 = { + .min_width = 0, + .min_height = 0, + .max_width = 2048, + .max_height = 2048, + .max_spw = 0xff, + .max_vpw = 0xff, + .max_hpw = 0x3ff, + .fixed_clksrc = true, + .nlayers = ARRAY_SIZE(atmel_xlcdc_sam9x7_layers), + .layers = atmel_xlcdc_sam9x7_layers, +}; + static const struct of_device_id atmel_hlcdc_of_match[] = { { .compatible = "atmel,at91sam9n12-hlcdc", @@ -487,6 +579,10 @@ static const struct of_device_id atmel_hlcdc_of_match[] = { .compatible = "microchip,sam9x60-hlcdc", .data = &atmel_hlcdc_dc_sam9x60, }, + { + .compatible = "microchip,sam9x7-xlcdc", + .data = &atmel_xlcdc_dc_sam9x7, + }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, atmel_hlcdc_of_match);