From patchwork Mon Sep 23 12:41:13 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: 11156771 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 ECD5117D4 for ; Mon, 23 Sep 2019 12:51:47 +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 D4E2B20835 for ; Mon, 23 Sep 2019 12:51:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D4E2B20835 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 CDC256E8B8; Mon, 23 Sep 2019 12:51:46 +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 0CD586E8BA for ; Mon, 23 Sep 2019 12:51:46 +0000 (UTC) Received: from regular2.263xmail.com (unknown [211.157.147.163]) by smtphy.263.net (Postfix) with ESMTPS id CBFD4B3 for ; Mon, 23 Sep 2019 20:44:03 +0800 (CST) Received: from regular1.263xmail.com (unknown [192.168.165.185]) by regular2.263xmail.com (Postfix) with ESMTP id EE6061B5D for ; Mon, 23 Sep 2019 20:44:01 +0800 (CST) Received: from hjc?rock-chips.com (unknown [192.168.167.16]) by regular1.263xmail.com (Postfix) with ESMTP id 3783D27E; Mon, 23 Sep 2019 20:43:58 +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:58 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <8b85543686f2ae6693688f21f9fae196> 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, VMware Graphics , Thomas Hellstrom , David Airlie , Daniel Vetter Subject: [PATCH 09/36] dm/vmwgfx: use bpp instead of cpp for drm_format_info Date: Mon, 23 Sep 2019 20:41:13 +0800 Message-Id: <1569242500-182337-10-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/vmwgfx/vmwgfx_fb.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c index 972e8fd..c516c40 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c @@ -91,7 +91,7 @@ static int vmw_fb_setcolreg(unsigned regno, unsigned red, unsigned green, default: DRM_ERROR("Bad depth %u, bpp %u.\n", par->set_fb->format->depth, - par->set_fb->format->cpp[0] * 8); + par->set_fb->format->bpp[0]); return 1; } @@ -211,7 +211,7 @@ static void vmw_fb_dirty_flush(struct work_struct *work) * Handle panning when copying from vmalloc to framebuffer. * Clip dirty area to framebuffer. */ - cpp = cur_fb->format->cpp[0]; + cpp = cur_fb->format->bpp[0] / 8; max_x = par->fb_x + cur_fb->width; max_y = par->fb_y + cur_fb->height; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c index 25e6343..e9b4b44 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c @@ -98,7 +98,7 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv) fb = entry->base.crtc.primary->state->fb; return vmw_kms_write_svga(dev_priv, w, h, fb->pitches[0], - fb->format->cpp[0] * 8, + fb->format->bpp[0], fb->format->depth); } @@ -107,7 +107,7 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv) fb = entry->base.crtc.primary->state->fb; vmw_kms_write_svga(dev_priv, fb->width, fb->height, fb->pitches[0], - fb->format->cpp[0] * 8, fb->format->depth); + fb->format->bpp[0], fb->format->depth); } /* Make sure we always show something. */ diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c index 9a2a383..79a79e2 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c @@ -487,7 +487,7 @@ static uint32_t vmw_sou_bo_define_gmrfb(struct vmw_du_update_plane *update, gmr->header = SVGA_CMD_DEFINE_GMRFB; - gmr->body.format.bitsPerPixel = update->vfb->base.format->cpp[0] * 8; + gmr->body.format.bitsPerPixel = update->vfb->base.format->bpp[0]; gmr->body.format.colorDepth = depth; gmr->body.format.reserved = 0; gmr->body.bytesPerLine = update->vfb->base.pitches[0]; @@ -997,7 +997,7 @@ static int do_bo_define_gmrfb(struct vmw_private *dev_priv, return -ENOMEM; cmd->header = SVGA_CMD_DEFINE_GMRFB; - cmd->body.format.bitsPerPixel = framebuffer->base.format->cpp[0] * 8; + cmd->body.format.bitsPerPixel = framebuffer->base.format->bpp[0]; cmd->body.format.colorDepth = depth; cmd->body.format.reserved = 0; cmd->body.bytesPerLine = framebuffer->base.pitches[0]; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c index f803bb5..52f0003 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c @@ -1074,7 +1074,7 @@ vmw_stdu_primary_plane_prepare_fb(struct drm_plane *plane, */ if (new_content_type == SEPARATE_BO) { - switch (new_fb->format->cpp[0]*8) { + switch (new_fb->format->bpp[0]) { case 32: content_srf.format = SVGA3D_X8R8G8B8; break;