From patchwork Mon Sep 23 12:41:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?6buE5a626ZKX?= X-Patchwork-Id: 11156779 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 850D917D4 for ; Mon, 23 Sep 2019 12:51:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6CD8E20820 for ; Mon, 23 Sep 2019 12:51:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6CD8E20820 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 727966E8C0; Mon, 23 Sep 2019 12:51:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtphy.263.net (sg-smtp01.263.net [54.255.195.220]) by gabe.freedesktop.org (Postfix) with ESMTPS id F3B2A6E8BC for ; Mon, 23 Sep 2019 12:51:45 +0000 (UTC) Received: from regular2.263xmail.com (unknown [211.157.147.163]) by smtphy.263.net (Postfix) with ESMTPS id 355D3122 for ; Mon, 23 Sep 2019 20:43:52 +0800 (CST) Received: from regular1.263xmail.com (unknown [192.168.165.230]) by regular2.263xmail.com (Postfix) with ESMTP id A37AD282 for ; Mon, 23 Sep 2019 20:43:46 +0800 (CST) Received: from hjc?rock-chips.com (unknown [192.168.167.16]) by regular1.263xmail.com (Postfix) with ESMTP id 3B792B76; Mon, 23 Sep 2019 20:43:44 +0800 (CST) X-263anti-spam: KSV:0;BIG:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ADDR-CHECKED4: 1 X-ABS-CHECKED: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P3051T140289744058112S1569242621440080_; Mon, 23 Sep 2019 20:43:45 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <1d669510ee6b1eb3d84b0708437add94> X-RL-SENDER: hjc@rock-chips.com X-SENDER: hjc@rock-chips.com X-LOGIN-NAME: hjc@rock-chips.com X-FST-TO: dri-devel@lists.freedesktop.org X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 From: Sandy Huang To: dri-devel@lists.freedesktop.org, Patrik Jakobsson , David Airlie , Daniel Vetter Subject: [PATCH 07/36] drm/gma500: use bpp instead of cpp for drm_format_info Date: Mon, 23 Sep 2019 20:41:11 +0800 Message-Id: <1569242500-182337-8-git-send-email-hjc@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1569242500-182337-7-git-send-email-hjc@rock-chips.com> References: <1569242500-182337-7-git-send-email-hjc@rock-chips.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" cpp[BytePerPlane] can't describe the 10bit data format correctly, So we use bpp[BitPerPlane] to instead cpp. Signed-off-by: Sandy Huang --- drivers/gpu/drm/gma500/framebuffer.c | 4 ++-- drivers/gpu/drm/gma500/gma_display.c | 4 ++-- drivers/gpu/drm/gma500/mdfld_intel_display.c | 6 +++--- drivers/gpu/drm/gma500/oaktrail_crtc.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index 218f3bb..97e9274 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c @@ -61,7 +61,7 @@ static int psbfb_setcolreg(unsigned regno, unsigned red, unsigned green, (transp << info->var.transp.offset); if (regno < 16) { - switch (fb->format->cpp[0] * 8) { + switch (fb->format->bpp[0]) { case 16: ((uint32_t *) info->pseudo_palette)[regno] = v; break; @@ -221,7 +221,7 @@ static int psb_framebuffer_init(struct drm_device *dev, * 4 bytes per pixel. */ info = drm_get_format_info(dev, mode_cmd); - if (!info || !info->depth || info->cpp[0] > 4) + if (!info || !info->depth || info->bpp[0] > 32) return -EINVAL; if (mode_cmd->pitches[0] & 63) diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c index e20ccb5..95e975e 100644 --- a/drivers/gpu/drm/gma500/gma_display.c +++ b/drivers/gpu/drm/gma500/gma_display.c @@ -78,14 +78,14 @@ int gma_pipe_set_base(struct drm_crtc *crtc, int x, int y, if (ret < 0) goto gma_pipe_set_base_exit; start = gtt->offset; - offset = y * fb->pitches[0] + x * fb->format->cpp[0]; + offset = y * fb->pitches[0] + x * fb->format->bpp[0] / 8; REG_WRITE(map->stride, fb->pitches[0]); dspcntr = REG_READ(map->cntr); dspcntr &= ~DISPPLANE_PIXFORMAT_MASK; - switch (fb->format->cpp[0] * 8) { + switch (fb->format->bpp[0]) { case 8: dspcntr |= DISPPLANE_8BPP; break; diff --git a/drivers/gpu/drm/gma500/mdfld_intel_display.c b/drivers/gpu/drm/gma500/mdfld_intel_display.c index b8bfb96..5564472 100644 --- a/drivers/gpu/drm/gma500/mdfld_intel_display.c +++ b/drivers/gpu/drm/gma500/mdfld_intel_display.c @@ -139,7 +139,7 @@ static int check_fb(struct drm_framebuffer *fb) if (!fb) return 0; - switch (fb->format->cpp[0] * 8) { + switch (fb->format->bpp[0]) { case 8: case 16: case 24: @@ -187,13 +187,13 @@ static int mdfld__intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, return 0; start = to_gtt_range(fb->obj[0])->offset; - offset = y * fb->pitches[0] + x * fb->format->cpp[0]; + offset = y * fb->pitches[0] + x * fb->format->bpp[0] / 8; REG_WRITE(map->stride, fb->pitches[0]); dspcntr = REG_READ(map->cntr); dspcntr &= ~DISPPLANE_PIXFORMAT_MASK; - switch (fb->format->cpp[0] * 8) { + switch (fb->format->bpp[0]) { case 8: dspcntr |= DISPPLANE_8BPP; break; diff --git a/drivers/gpu/drm/gma500/oaktrail_crtc.c b/drivers/gpu/drm/gma500/oaktrail_crtc.c index 167c107..8278dfb 100644 --- a/drivers/gpu/drm/gma500/oaktrail_crtc.c +++ b/drivers/gpu/drm/gma500/oaktrail_crtc.c @@ -607,14 +607,14 @@ static int oaktrail_pipe_set_base(struct drm_crtc *crtc, return 0; start = to_gtt_range(fb->obj[0])->offset; - offset = y * fb->pitches[0] + x * fb->format->cpp[0]; + offset = y * fb->pitches[0] + x * fb->format->bpp[0] / 8; REG_WRITE(map->stride, fb->pitches[0]); dspcntr = REG_READ(map->cntr); dspcntr &= ~DISPPLANE_PIXFORMAT_MASK; - switch (fb->format->cpp[0] * 8) { + switch (fb->format->bpp[0]) { case 8: dspcntr |= DISPPLANE_8BPP; break; From patchwork Mon Sep 23 12:41:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?6buE5a626ZKX?= X-Patchwork-Id: 11156777 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AEDF314ED for ; Mon, 23 Sep 2019 12:51:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 966D020820 for ; Mon, 23 Sep 2019 12:51:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 966D020820 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 514AD6E8BE; Mon, 23 Sep 2019 12:51:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtphy.263.net (syd-smtp02.263.net [13.237.61.158]) by gabe.freedesktop.org (Postfix) with ESMTPS id B238D6E8BA for ; Mon, 23 Sep 2019 12:51:45 +0000 (UTC) Received: from regular2.263xmail.com (unknown [211.157.147.163]) by smtphy.263.net (Postfix) with ESMTPS id 3F0FF1200E3 for ; Mon, 23 Sep 2019 20:44:07 +0800 (CST) Received: from regular1.263xmail.com (unknown [192.168.165.231]) by regular2.263xmail.com (Postfix) with ESMTP id 0B979236 for ; Mon, 23 Sep 2019 20:44:03 +0800 (CST) Received: from hjc?rock-chips.com (unknown [192.168.167.16]) by regular1.263xmail.com (Postfix) with ESMTP id 0DEC2B96; Mon, 23 Sep 2019 20:44:00 +0800 (CST) X-263anti-spam: KSV:0;BIG:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ADDR-CHECKED4: 1 X-ABS-CHECKED: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P3051T140289744058112S1569242621440080_; Mon, 23 Sep 2019 20:44:00 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <6e704a054898d3f23dd3220778556226> X-RL-SENDER: hjc@rock-chips.com X-SENDER: hjc@rock-chips.com X-LOGIN-NAME: hjc@rock-chips.com X-FST-TO: dri-devel@lists.freedesktop.org X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 From: Sandy Huang To: dri-devel@lists.freedesktop.org, "James (Qian) Wang" , Liviu Dudau , Brian Starkey , David Airlie , Daniel Vetter Subject: [PATCH 10/36] drm/arm: use bpp instead of cpp for drm_format_info Date: Mon, 23 Sep 2019 20:41:14 +0800 Message-Id: <1569242500-182337-11-git-send-email-hjc@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1569242500-182337-7-git-send-email-hjc@rock-chips.com> References: <1569242500-182337-7-git-send-email-hjc@rock-chips.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" cpp[BytePerPlane] can't describe the 10bit data format correctly, So we use bpp[BitPerPlane] to instead cpp. Signed-off-by: Sandy Huang --- drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c | 2 +- drivers/gpu/drm/arm/malidp_hw.c | 2 +- drivers/gpu/drm/arm/malidp_planes.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c index 3b0a70e..d02dfc6 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c @@ -89,7 +89,7 @@ komeda_fb_afbc_size_check(struct komeda_fb *kfb, struct drm_file *file, alignment_header); kfb->afbc_size = kfb->offset_payload + n_blocks * - ALIGN(info->cpp[0] * AFBC_SUPERBLK_PIXELS, + ALIGN(info->bpp[0] / 8 * AFBC_SUPERBLK_PIXELS, AFBC_SUPERBLK_ALIGNMENT); min_size = kfb->afbc_size + fb->offsets[0]; if (min_size > obj->size) { diff --git a/drivers/gpu/drm/arm/malidp_hw.c b/drivers/gpu/drm/arm/malidp_hw.c index bd8265f..54be8d1 100644 --- a/drivers/gpu/drm/arm/malidp_hw.c +++ b/drivers/gpu/drm/arm/malidp_hw.c @@ -384,7 +384,7 @@ static void malidp500_modeset(struct malidp_hw_device *hwdev, struct videomode * int malidp_format_get_bpp(u32 fmt) { const struct drm_format_info *info = drm_format_info(fmt); - int bpp = info->cpp[0] * 8; + int bpp = info->bpp[0]; if (bpp == 0) { switch (fmt) { diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 3c70a53..628f325 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -225,7 +225,7 @@ bool malidp_format_mod_supported(struct drm_device *drm, if (modifier & AFBC_SPLIT) { if (!info->is_yuv) { - if (info->cpp[0] <= 2) { + if (info->bpp[0] <= 16) { DRM_DEBUG_KMS("RGB formats <= 16bpp are not supported with SPLIT\n"); return false; }