From patchwork Fri Jan 24 09:27:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233269 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB6C1C2D0DB for ; Fri, 24 Jan 2020 09:44:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A4CB822527 for ; Fri, 24 Jan 2020 09:44:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579859064; bh=NsL/XEYWYT0nbrdwtmMgxsp0HrfqXxOWX3og0QqbDko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=rfKULZMg4BTLZSgbFUnHPhDIEXJV6yHE9XAvQnZCOWcLI/MF83brefTO+AyM5gJtF fRsYVPpFm0fO/B4FpchiPN7c6ZBSNBMFApUQNqmKUyMslrQUeUvhYG7uCNQEECmX5W ufL+1PFlt97QqeAoPJU6Lxczjsgrxu5aK0cEeFvs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730133AbgAXJny (ORCPT ); Fri, 24 Jan 2020 04:43:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:42054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733222AbgAXJnx (ORCPT ); Fri, 24 Jan 2020 04:43:53 -0500 Received: from localhost (unknown [145.15.244.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EF48121556; Fri, 24 Jan 2020 09:43:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579859032; bh=NsL/XEYWYT0nbrdwtmMgxsp0HrfqXxOWX3og0QqbDko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jf+mhN/OkLo+fAJbm1tr6nVlO4ZV8NLMc7htA0LlcVeKXtClngT6NiLIahzAmE8Nr pQLTU45IBxgOxBX/ImVl4ZXFiBHP9FXiZgA5VCPn3lmz51Ym4XLMVq+a5pLsVkK7EC cOxrYemY7wvRwPWDBqg2Hn/A5G/J9Jau+kHNre94= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Garry , Xinliang Liu , Sasha Levin Subject: [PATCH 4.14 013/343] drm/hisilicon: hibmc: Dont overwrite fb helper surface depth Date: Fri, 24 Jan 2020 10:27:11 +0100 Message-Id: <20200124092921.375229944@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124092919.490687572@linuxfoundation.org> References: <20200124092919.490687572@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: John Garry [ Upstream commit 0ff9f49646353ce31312411e7e7bd2281492a40e ] Currently the driver overwrites the surface depth provided by the fb helper to give an invalid bpp/surface depth combination. This has been exposed by commit 70109354fed2 ("drm: Reject unknown legacy bpp and depth for drm_mode_addfb ioctl"), which now causes the driver to fail to probe. Fix by not overwriting the surface depth. Fixes: d1667b86795a ("drm/hisilicon/hibmc: Add support for frame buffer") Signed-off-by: John Garry Reviewed-by: Xinliang Liu Signed-off-by: Xinliang Liu Signed-off-by: Sasha Levin --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c index 8bd29075ae4eb..edcca17615001 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c @@ -71,7 +71,6 @@ static int hibmc_drm_fb_create(struct drm_fb_helper *helper, DRM_DEBUG_DRIVER("surface width(%d), height(%d) and bpp(%d)\n", sizes->surface_width, sizes->surface_height, sizes->surface_bpp); - sizes->surface_depth = 32; bytes_per_pixel = DIV_ROUND_UP(sizes->surface_bpp, 8);