Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp11586664ybl; Fri, 27 Dec 2019 17:16:46 -0800 (PST) X-Google-Smtp-Source: APXvYqzTkkylsbnEuNjvYCyEsqIBiIMgRKVLpNasBdvOkpOyO0wHyyA7CPBJDcAiLYQX2MoBexvL X-Received: by 2002:a9d:65cf:: with SMTP id z15mr62072313oth.238.1577495805918; Fri, 27 Dec 2019 17:16:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577495805; cv=none; d=google.com; s=arc-20160816; b=YGIo4/VuvGAt5qMCE84FYkffwxxtxXHGNi0nTK7l+oagYxBXIYRdnlVxk65PwtCHaI oqfVAcmodEufaOvjT79xEGly5L/EO6KlWEzZY0Ijlw6fwsEYBJ1RIeCRf6z9+CMDZ+PD 3+VFk8UHug5jzVVpfzymQHh2UVLhHbuXUk1wP56ndvropPotAjICIYDRZfuaFTB8R78J RbiUVE4/xVqkVP2DKpqLiWei3RIg7vSTMrZOoH1ZyFtoSo23aD9DWl3IX1icZBUitWMW 1+GwERRkR87Mp7Afe/y5te0EyDhrLjNVjvAD/DldcRdyz2SGZGjYNq6cniXQvMOSEN+k yQeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=uxeXcHMTF7mcvFFtyVUrtSPGr/lvdtmZ8rqwS2jI4eA=; b=Kxpc6iCJ/5ujgIKVqeYDWEN9OoMCA2Leu9qSAKaSy5ZZttkPmlB7zeXdW5FEqw1gkI bKcxKORSp1odyDRkLroXKlnJKXz8kqafiLJheV+bkY3dRUo4aBIwytN6ffv2gR0yjA4T q6t8kapfe+q/qZ/1NP2lTTWqIbD3tzg+5nTolBxGcFxkh5cw/1oVTEyvbN4Vc+eeNhkz Fy5U96UD66K7GvRwMPrd2vj/XZuYRyAB7h4bEjTV8D1VKKptFMYP/GL6JczAyCDs3Eii ddO1g+ssO3u1NfVleHPxRgRy6pMnu7u0MgCHxBG58SHzKHvSSmfnIoOFJi2rYpOm+LYA xdRg== ARC-Authentication-Results: i=1; mx.google.com; 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 r12si18270568otq.156.2019.12.27.17.16.20; Fri, 27 Dec 2019 17:16:45 -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; 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 S1726315AbfL1BOm (ORCPT + 99 others); Fri, 27 Dec 2019 20:14:42 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:8633 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725820AbfL1BOm (ORCPT ); Fri, 27 Dec 2019 20:14:42 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D94C672DA993BA82B74C; Sat, 28 Dec 2019 09:14:39 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Sat, 28 Dec 2019 09:14:29 +0800 From: Tian Tao To: , , , , , , , , , CC: Subject: [PATCH] drm/hisilicon: Added three new resolutions and changed the alignment to 128 Bytes Date: Sat, 28 Dec 2019 09:14:40 +0800 Message-ID: <1577495680-28766-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the three new resolution 1440x900 and 1600x900, 640x480 for hibmc and Set the FB Offset of the display hardware to 128 Byte alignment Signed-off-by: Tian Tao Signed-off-by: Gong junjie --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 11 +++++------ drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_regs.h | 2 ++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c index f1ce6cb..69389b0 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c @@ -40,6 +40,7 @@ struct hibmc_dislay_pll_config { }; static const struct hibmc_dislay_pll_config hibmc_pll_table[] = { + {640, 480, CRT_PLL1_HS_25MHZ, CRT_PLL2_HS_25MHZ}, {800, 600, CRT_PLL1_HS_40MHZ, CRT_PLL2_HS_40MHZ}, {1024, 768, CRT_PLL1_HS_65MHZ, CRT_PLL2_HS_65MHZ}, {1152, 864, CRT_PLL1_HS_80MHZ_1152, CRT_PLL2_HS_80MHZ}, @@ -47,6 +48,8 @@ static const struct hibmc_dislay_pll_config hibmc_pll_table[] = { {1280, 720, CRT_PLL1_HS_74MHZ, CRT_PLL2_HS_74MHZ}, {1280, 960, CRT_PLL1_HS_108MHZ, CRT_PLL2_HS_108MHZ}, {1280, 1024, CRT_PLL1_HS_108MHZ, CRT_PLL2_HS_108MHZ}, + {1440, 900, CRT_PLL1_HS_106MHZ, CRT_PLL2_HS_106MHZ}, + {1600, 900, CRT_PLL1_HS_108MHZ, CRT_PLL2_HS_108MHZ}, {1600, 1200, CRT_PLL1_HS_162MHZ, CRT_PLL2_HS_162MHZ}, {1920, 1080, CRT_PLL1_HS_148MHZ, CRT_PLL2_HS_148MHZ}, {1920, 1200, CRT_PLL1_HS_193MHZ, CRT_PLL2_HS_193MHZ}, @@ -102,14 +105,12 @@ static void hibmc_plane_atomic_update(struct drm_plane *plane, s64 gpu_addr = 0; unsigned int line_l; struct hibmc_drm_private *priv = plane->dev->dev_private; - struct hibmc_framebuffer *hibmc_fb; struct drm_gem_vram_object *gbo; if (!state->fb) return; - hibmc_fb = to_hibmc_framebuffer(state->fb); - gbo = drm_gem_vram_of_gem(hibmc_fb->obj); + gbo = drm_gem_vram_of_gem(state->fb->obj[0]); gpu_addr = drm_gem_vram_offset(gbo); if (WARN_ON_ONCE(gpu_addr < 0)) @@ -118,11 +119,9 @@ static void hibmc_plane_atomic_update(struct drm_plane *plane, writel(gpu_addr, priv->mmio + HIBMC_CRT_FB_ADDRESS); reg = state->fb->width * (state->fb->format->cpp[0]); - /* now line_pad is 16 */ - reg = PADDING(16, reg); line_l = state->fb->width * state->fb->format->cpp[0]; - line_l = PADDING(16, line_l); + line_l = PADDING(128, line_l); writel(HIBMC_FIELD(HIBMC_CRT_FB_WIDTH_WIDTH, reg) | HIBMC_FIELD(HIBMC_CRT_FB_WIDTH_OFFS, line_l), priv->mmio + HIBMC_CRT_FB_WIDTH); diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_regs.h b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_regs.h index 9b7e859..17b30c3 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_regs.h +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_regs.h @@ -179,6 +179,7 @@ #define CRT_PLL1_HS_74MHZ 0x23941dc2 #define CRT_PLL1_HS_80MHZ 0x23941001 #define CRT_PLL1_HS_80MHZ_1152 0x23540fc2 +#define CRT_PLL1_HS_106MHZ 0x237C1641 #define CRT_PLL1_HS_108MHZ 0x23b41b01 #define CRT_PLL1_HS_162MHZ 0x23480681 #define CRT_PLL1_HS_148MHZ 0x23541dc2 @@ -191,6 +192,7 @@ #define CRT_PLL2_HS_78MHZ 0x50E147AE #define CRT_PLL2_HS_74MHZ 0x602B6AE7 #define CRT_PLL2_HS_80MHZ 0x70000000 +#define CRT_PLL2_HS_106MHZ 0x0075c28f #define CRT_PLL2_HS_108MHZ 0x80000000 #define CRT_PLL2_HS_162MHZ 0xA0000000 #define CRT_PLL2_HS_148MHZ 0xB0CCCCCD -- 2.7.4