From patchwork Thu Aug 20 03:39:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 248001 Delivered-To: patches@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp1001160ils; Wed, 19 Aug 2020 20:39:44 -0700 (PDT) X-Received: by 2002:a63:4e56:: with SMTP id o22mr1048589pgl.381.1597894784843; Wed, 19 Aug 2020 20:39:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597894784; cv=none; d=google.com; s=arc-20160816; b=mBL1zvlywy3Kynyq4fg/Zdae5FCtISCV5z3K7oYkGpGWM9z7tfVOybtR2Hz+ohdvPL +T/aXeRunI9BF7vC36mELE6VILMtnUnleTnwRdUvCiVeyIyhVBi8q94gvNIWAMQ3uDfh fExvFDWvaWed4npWsDe7r1RPRuH6oUmYSrkzGYFxTU0P5bdyLGXyolzXbuIWOXIrBXuy Hn+rmVt+mXoU/NNxsYGQ5UINUtPAjbG8rpMOgChRK4MfAuN6JIiq9gbmG3gkBZTNQv5h hW0Ps5b9H6tLjkoRZOWcHuLhiGgnYpYMgvBACOtyDEghT179Qnj94ydc5L2yXRZJfQXo vLFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1Pl5M3ukYq8iQYrf+dpnwbhWHmgNw4KikJbcw2NDFaY=; b=UhBb3OSgZytMzeXx2EMeb/63B5e9qfPC1lbXCdpPDLScggcOx3HHKPg2nE61T7vl4T nI9CZooGhe6bOntg+I4ZxLY382Isiq2lC8pVFsNUM9VkHMeyRPxQIWvPXfOSh7YrPuX1 FvwmVvVDGYlLNWM/9Sf3jcjoOYhQOYGdrhDBcnj+uT+njhc/JNnVjjrHrKSnBTBh2G2+ +0q0ApDBLw+RTgcwebO+ztSWKxqbss4bjlK3U4hlvWH6pjsQpvbRuikQrl5wEqHxX99b 7Z0+exfpSh/MLIkDDngsXC7VtG46Bz0ifIly72Jdaz6oWZJ0YD8kJ0ktjDJxOVeS3twQ UR1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vTe4qnU9; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id y6sor301576pgy.16.2020.08.19.20.39.44 for (Google Transport Security); Wed, 19 Aug 2020 20:39:44 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vTe4qnU9; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1Pl5M3ukYq8iQYrf+dpnwbhWHmgNw4KikJbcw2NDFaY=; b=vTe4qnU9syJCWAEG6DywC43aFT6u9KZAlrNQGmPhdjb381EGy/7CuoAm9utkz4bzrG 4SG+ix3+/d12Nxe5oanUjOKPqMy5JQTG0Au7MQCx6D1b3h5hrYHptueFtC0w8E22GncH DB2Y7zUz/eoUKXh71v8MfxvstgAeMB+V62r5YgLgPyBICXwPYQHT/m3+h1M0Q2csztN0 TCDTkwGAvRaH5KrhuFHXK1EGUaAK2H0SFsB9FNscx4D1VkVetzaiZddED0nXU/abKuOG Nx1wDsfslpX8BT0VVyTmT1fo8OBVjpFGcYyAarNIrOlWcuEFZHuQsf1Q6XNSoIPGiVFP 4XNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1Pl5M3ukYq8iQYrf+dpnwbhWHmgNw4KikJbcw2NDFaY=; b=WpNaPtkgUTYz3mSrKgCvehQ6fhUer6x4re4NnpzsWYIxbZL3y9sP2NXQ2+h9tWFwmG 4UQCE4DSspA9NcuvvA/C/zSUqLMJNcqbtkp27pOD4t8XhVgMud90dTjXZHr8FVFyOEcb pfChqwuMqyGL9sHKIA/Rv/ZPEQrAdVmLOSiTc3I4lGzsrjbnUSKsr1YotAej3UHKiWzb kQkUNgYXim5/wSRv/0VrmyXL3LNGiPPApfeqOYJaAQAfsE892Hcv058jd19cP231IRyW 4RygGGtGad6wukqHOnruHLx8tAP06EdU5jc6z0SQy7n1TAPYe5nADH8FSwD2t1NEUcvf GRYw== X-Gm-Message-State: AOAM533yu/cUg/e+cSpurl5LV1Ys6X0lHY6esHXw8OXSLzlcyHHF7BnN O3HsCa7tDNn6zezjdXFQTe3vA/Ci X-Google-Smtp-Source: ABdhPJw7+wbEcxeGvP6s6ZJ+K9s54oBWBNNce+Q9YhzT/XYIL8Tlrz5uMXzYbvij9iHIj3eAZ0TnWg== X-Received: by 2002:a63:5a1e:: with SMTP id o30mr1131758pgb.62.1597894784312; Wed, 19 Aug 2020 20:39:44 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id h9sm803062pfq.18.2020.08.19.20.39.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2020 20:39:43 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Mauro Carvalho Chehab , Greg Kroah-Hartman , Manivannan Sadhasivam , dri-devel , Liwei Cai , Xinliang Liu , Laurent Pinchart , Sam Ravnborg , Sumit Semwal , Chen Feng Subject: [PATCH 1/3] drm: hikey9xx: Fix inconsistent compat string Date: Thu, 20 Aug 2020 03:39:39 +0000 Message-Id: <20200820033939.127932-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: This is against Mauro's tree here: https://gitlab.freedesktop.org/mchehab_kernel/hikey-970/-/commits/master/ A previous patch changed this string to be "hisilicon,kirin960-dpe", but there are other place where the code still expects "hisilicon,hi3660-dpe", so change it back. Cc: Mauro Carvalho Chehab Cc: Greg Kroah-Hartman Cc: Manivannan Sadhasivam Cc: dri-devel Cc: Liwei Cai Cc: Xinliang Liu Cc: Laurent Pinchart Cc: Sam Ravnborg Cc: Sumit Semwal Cc: Chen Feng Signed-off-by: John Stultz --- drivers/staging/hikey9xx/gpu/kirin9xx_drm_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/staging/hikey9xx/gpu/kirin9xx_drm_drv.c b/drivers/staging/hikey9xx/gpu/kirin9xx_drm_drv.c index 18fec5a1b59d..efa5727612f5 100644 --- a/drivers/staging/hikey9xx/gpu/kirin9xx_drm_drv.c +++ b/drivers/staging/hikey9xx/gpu/kirin9xx_drm_drv.c @@ -339,7 +339,7 @@ static int kirin_drm_platform_resume(struct platform_device *pdev) } static const struct of_device_id kirin_drm_dt_ids[] = { - { .compatible = "hisilicon,kirin960-dpe", + { .compatible = "hisilicon,hi3660-dpe", .data = &kirin960_dss_dc_ops, }, { .compatible = "hisilicon,kirin970-dpe", From patchwork Thu Aug 20 03:40:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 248002 Delivered-To: patches@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp1001863ils; Wed, 19 Aug 2020 20:41:04 -0700 (PDT) X-Received: by 2002:a63:5012:: with SMTP id e18mr1094633pgb.169.1597894863975; Wed, 19 Aug 2020 20:41:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597894863; cv=none; d=google.com; s=arc-20160816; b=l3T1OdTPQVhkrvfyCfOF3DHkMWhergbc+sXGR3HJ1VSYHsa45HJjD8WxLLIfZ2m8FX 7yNZDlmbfMOrFse2GbK6yBQizgcl84rLPDkn6tCkbqExiYDO9mibVr+QxiwSV9kSJ7Qg ODXb/9ISJXD3P5nHXiWDETjZX+h6blsINq0Cenekelo2vLvHa/yQN/1hIjyBGMDAtS4P 6wPLq4XJSXvRjqbCPwdVnYq/wc8IuE7gXKD7jbPSHcJc/bz14lbsbPjErlI9ympgDnhc 8bElk+nb13bAwzjNlYF/fP1ZHS5F/u9DNxPfqc4LHE1dzr+6lySIF2QYnyp5nMYIDpI1 +12w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=J8YVoHBmhP7CwdTtvl1VuAAC1kupCb0CJ2Q7eWIL2Qg=; b=As6+o3dwijT6y8YxqAlvwT+8kxCkzS767NouL9aTLVson4hpHsuOmdFvg7K8k+wMK4 jJtfrU8ROOTd12jm6G3k58i9WC5Rp9GnDnVQOW9nUyoSOXmxZh6tNjg+JB9sp1vKtkzN X1onHGGUXhZLfRFy529tZbws5VO+1/NoIY8Lmff3zu4SJVkesU9ZXtMWlM31yMQp6bNs ZIcQeaL8J46ICrRYQmPx/CR0E8/Ja34EYAoDRQjSBu/6yGvtVnXbsh0TUozH7eepBY3g Jq/2m4wAUP3G1puv2foDRjZduepq+rxfDdEZCViPTEuWrdl32ypEmSsEyB/KgDhiwaBp Q8Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AU6pOAFy; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id v13sor418928pfm.26.2020.08.19.20.41.03 for (Google Transport Security); Wed, 19 Aug 2020 20:41:03 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AU6pOAFy; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=J8YVoHBmhP7CwdTtvl1VuAAC1kupCb0CJ2Q7eWIL2Qg=; b=AU6pOAFyZUuERVPlUGgQ633WDZ41yAxyiPrfn91iU3wpnAPmf83Atkl0hdBSgRmmQS ZRjcfQxA+fFqXOfJY/CcH1Ey1UJnYB374q6Zg6zrY+vQldYy40Sq3WpW19jFKM8kncFR sICeqEb93KmCfIlNkBuLhO8EXviVMyxL/narlfzvxjt2d31fXtUTgkxALNvyVPFSkDHY OarfKqjNid+4wytiNixG0wOlTER+obDITTobrWnFtWAUxICEccsVp6YtHtGlzaclXw0p fCUB5NbFnDne0+bgV9UZe9umxJtdTCRMjusN2+Cd3dsrweZQhQZ3M+LzPKkPw0aZKOzB M9DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=J8YVoHBmhP7CwdTtvl1VuAAC1kupCb0CJ2Q7eWIL2Qg=; b=e+X1U7alXvD9MrY1bEJw+Zc4xLEkK9Ha8ZtlVbPEnb63VX90gwBTvgJquVymXxnWrX pUOLYrz4c0s/U+JaVotmMcUH47YqLYeAUVAoMOePEHKermkQGICXLEIIu2wuA4SQmC14 LNpRUnbqEdcAqdA742dba1KgYXJiyP0IwSVQb2FoJXMbjHUd/aoQr6x7Ypgr8F3nPK7d T9hcSFboHLkBO8dkG0nS68V4iTbFUCaQ5NBnkoj88fAnnqxolLXOmLUpXnBA3W94q3dZ cjx0j8jH+4g0s27pnm24dQ5UV84cRxMNW06B+IJtuCn1hu0+6ZJQXOI0r7Z0EiqAvgsj tBSQ== X-Gm-Message-State: AOAM533QAaTGAbyDSe0aGov2fu477lb/FMsy/7JynEj0w2/F+x276bZ8 oqWEg8kmId853IWz525hjDEolNmF X-Google-Smtp-Source: ABdhPJyhB2GNDaHZkcuGGQCn+7emHrUxCM2nzwttMrYziKfs722BrdQHw/nqTvpSU6n6JeP5+jhfIw== X-Received: by 2002:a62:5cc4:: with SMTP id q187mr799823pfb.95.1597894863592; Wed, 19 Aug 2020 20:41:03 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id y126sm786477pfy.138.2020.08.19.20.41.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2020 20:41:02 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Mauro Carvalho Chehab , Greg Kroah-Hartman , Manivannan Sadhasivam , dri-devel , Liwei Cai , Xinliang Liu , Laurent Pinchart , Sam Ravnborg , Sumit Semwal , Chen Feng Subject: [PATCH 2/3] drm: kirin9xxx: Add additional color formats Date: Thu, 20 Aug 2020 03:40:59 +0000 Message-Id: <20200820034100.128062-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200820033939.127932-1-john.stultz@linaro.org> References: <20200820033939.127932-1-john.stultz@linaro.org> This is against Mauro's tree here: https://gitlab.freedesktop.org/mchehab_kernel/hikey-970/-/commits/master/ Add support for two color formats (ARGB and ABGR) needed for use with drm_hwcomposer and AOSP. NOTE: I see Red/Blue swapped colors with this (and yes I did try the obvious swap of formats here, to no luck :), so I need to dig more on whats different from the other driver on this. But with these formats supported drm_hwcomposer no longer crashes Cc: Mauro Carvalho Chehab Cc: Greg Kroah-Hartman Cc: Manivannan Sadhasivam Cc: dri-devel Cc: Liwei Cai Cc: Xinliang Liu Cc: Laurent Pinchart Cc: Sam Ravnborg Cc: Sumit Semwal Cc: Chen Feng Signed-off-by: John Stultz --- drivers/staging/hikey9xx/gpu/kirin9xx_drm_dss.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/staging/hikey9xx/gpu/kirin9xx_drm_dss.c b/drivers/staging/hikey9xx/gpu/kirin9xx_drm_dss.c index e3a1f85bdbd2..f2e99c766927 100644 --- a/drivers/staging/hikey9xx/gpu/kirin9xx_drm_dss.c +++ b/drivers/staging/hikey9xx/gpu/kirin9xx_drm_dss.c @@ -55,14 +55,15 @@ static const struct dss_format dss_formats[] = { { DRM_FORMAT_XBGR8888, HISI_FB_PIXEL_FORMAT_BGRX_8888 }, { DRM_FORMAT_RGBA8888, HISI_FB_PIXEL_FORMAT_RGBA_8888 }, { DRM_FORMAT_BGRA8888, HISI_FB_PIXEL_FORMAT_BGRA_8888 }, - /*{ DRM_FORMAT_ARGB8888, },*/ - /*{ DRM_FORMAT_ABGR8888, },*/ + { DRM_FORMAT_ARGB8888, HISI_FB_PIXEL_FORMAT_RGBA_8888 }, + { DRM_FORMAT_ABGR8888, HISI_FB_PIXEL_FORMAT_BGRA_8888 }, }; static const u32 channel_formats1[] = { DRM_FORMAT_RGB565, DRM_FORMAT_BGR565, DRM_FORMAT_XRGB8888, DRM_FORMAT_XBGR8888, - DRM_FORMAT_RGBA8888, DRM_FORMAT_BGRA8888 + DRM_FORMAT_RGBA8888, DRM_FORMAT_BGRA8888, + DRM_FORMAT_ARGB8888, DRM_FORMAT_ABGR8888, }; u32 dss_get_channel_formats(u8 ch, const u32 **formats) From patchwork Thu Aug 20 03:41:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 248003 Delivered-To: patches@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp1001872ils; Wed, 19 Aug 2020 20:41:05 -0700 (PDT) X-Received: by 2002:a17:90a:ce0f:: with SMTP id f15mr863675pju.96.1597894865281; Wed, 19 Aug 2020 20:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597894865; cv=none; d=google.com; s=arc-20160816; b=NLuLfgoBVqbK2dYgin9erD7nJ2730wy8iq0oZhfL9v84WzokUcGZhhWI4EUpPGCz0q Mi3WcEJxxmh1GtaF+mFv+0Pt5XJ8Nsyk6udLU4Nk/6AwUqX0i/Imyf1n5W1fCiVpuZuP bWcjkld1UeKomyZRUfb5/HWLE3AN/sBBhlefzuNxH18FtKV2XuAyxHxERlE48Hie9FS3 r1YEckVbwjwFk2iVrWJ888Avy/zFt6Yf6YyPkU5kdzEhPkW6kQne+OFkwo2yEMpvibXD Jv5WeFkHYxKHoyHcr7Dw+PZeponq8/vzZjyMObDWUwq9B13hsZ+nMGCn0sFsZDg/6uyh CrWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=B9EvtRMB5UVF86YnoHZC/uHFJ9AM6zutWYeLdC0SWPo=; b=F5e33Qgr4fXfXPXuOnPGUTuVMqoUkBUMSO17Q+OW3354Ve6jxXMUY0TudkOGRYlvBR Nswl3IigEEPZyMIEoShamW8VVjoZuiwaVYh5qVEKcnIfNNMM+phSQE+DX1ne5Al7Tn05 j1flG6/SOyVUUpoqitTqLWOpbDXbA6xHAgoxYzj1va55NlmJwvvvqi8u1bd4glCDrA58 Si+kUblpIUpagaGaq/ZJGeOhLnizjxGZmFE5Ugwcx4cJqD3SaaD5rQG55JRfbBxLi4k3 uik+dBhzYPQgGMAXWHUm7VKdlK9U2elMliKh1DOWxUT79zlF3sLso+mDCQA6BEYIUPNz 4lpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J6C7ICzF; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id x28sor287061pgl.86.2020.08.19.20.41.05 for (Google Transport Security); Wed, 19 Aug 2020 20:41:05 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J6C7ICzF; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=B9EvtRMB5UVF86YnoHZC/uHFJ9AM6zutWYeLdC0SWPo=; b=J6C7ICzFYJGV3tWZk5soVRVxCRF4eadzc/OAyuvKSnyBUVeWXBJufUSp5SrId1XKLj 6r8wz5IPJFIHX0hv0Wcz3JhYOlDMDmjjvsYRvUIi9AvCpajh4gxxFFK0oTZ40OErAzvJ f+6KcTMpbTTJYB31y7uvlnnh0BWMfpBEFWYAZ+0czMfx7bY9/uzn6Z1Clf70GKetDBlG XD9018HxSAbapSc9yzX4y2kX8+LEnZuLQu3B+K28eZJAwtBKLALb8UhkI7rsm9x78qae JuNYMBjzUhSe8+1cnTN0L9cAdrvRNRHgAgnB41Zy7/htCDlJKnQG5p1JjhX/4saRcFsK wE7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=B9EvtRMB5UVF86YnoHZC/uHFJ9AM6zutWYeLdC0SWPo=; b=XW0NWq8xgYbCvBTBSo3sV6OWTts17wIjCDmvu7m5de1ekauP6YeEpmiKOrjzGAenjF e9237wTyyz9rDof6IZ6bhCgxvpnBKZbR/DYSPvAK/8NlyXBeI58V+U+k+HwyX39X1krQ mDmgbq+pL9lhsNQ7vE5+ZTZnecdI6F1Zw2ChQKUAAuCPtpWVIp17SZixvblSFx/bb1U9 YTC85anUvWhPxEpfYsuoOdPYwo9EdOgSN48N00Tvoh13AhyuT1fxYORSM+Ryfisk9wK5 X7EEIVuyO4K5YbwEOQWc/qr4hinDPA6rrc89PwIR79PmBW5gJrnkMDBFX58sWayT+ZW+ MfQA== X-Gm-Message-State: AOAM532Hy0x1bWI5wB+06wdg3s21Y449jrVQAYpX3o8oYeHJgIdDjUjL VdTP2SV+N1oAymyuk84XBthmDzRX X-Google-Smtp-Source: ABdhPJw4A1teuRlyb1TkMhqLDkqloYQulBKDv393Chr/svrFg49o9APmr8NElPKuIMXNWDkeTvOLiA== X-Received: by 2002:a63:5552:: with SMTP id f18mr1054188pgm.298.1597894864955; Wed, 19 Aug 2020 20:41:04 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id y126sm786477pfy.138.2020.08.19.20.41.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2020 20:41:04 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Mauro Carvalho Chehab , Greg Kroah-Hartman , Manivannan Sadhasivam , dri-devel , Liwei Cai , Xinliang Liu , Laurent Pinchart , Sam Ravnborg , Sumit Semwal , Chen Feng Subject: [PATCH 3/3] drm: hikey9xxx: Fix null pointer crash on reboot Date: Thu, 20 Aug 2020 03:41:00 +0000 Message-Id: <20200820034100.128062-2-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200820034100.128062-1-john.stultz@linaro.org> References: <20200820033939.127932-1-john.stultz@linaro.org> <20200820034100.128062-1-john.stultz@linaro.org> This is against Mauro's tree here: https://gitlab.freedesktop.org/mchehab_kernel/hikey-970/-/commits/master/ On reboot we see the following crash: [ 608.746787] Unable to handle kernel read from unreadable memory at virtual address 00000000000000a8 ... [ 608.822101] CPU: 3 PID: 234 Comm: kworker/3:2 Not tainted 5.8.0-00183-g03481a190c60-dirty #32 [ 608.830626] Hardware name: HiKey960 (DT) [ 608.834571] Workqueue: events drm_mode_rmfb_work_fn [ 608.839454] pstate: 80400005 (Nzcv daif +PAN -UAO BTYPE=--) [ 608.845031] pc : drm_gem_fb_get_obj+0x10/0x28 [ 608.849390] lr : drm_fb_cma_get_gem_obj+0x10/0x20 [ 608.854093] sp : ffffffc012f63b10 [ 608.857404] x29: ffffffc012f63b10 x28: ffffff8212282e00 [ 608.862716] x27: 0000000000000000 x26: ffffff8217501800 [ 608.868027] x25: 0000000000000000 x24: ffffffc012f63d60 [ 608.873339] x23: 0000000000000001 x22: ffffff8217504080 [ 608.878652] x21: ffffffc0119b9000 x20: ffffff8212282e00 [ 608.883963] x19: ffffff82175047c0 x18: ffffffffffffffff [ 608.889275] x17: ffffff8219c97708 x16: ffffff8219c97728 [ 608.894586] x15: ffffffc0119b9d08 x14: 0000000000000000 [ 608.899898] x13: 0000000000000000 x12: 0000000000000000 [ 608.905209] x11: 0000003c00000000 x10: 0000046500000441 [ 608.910519] x9 : ffffffc0119b9d08 x8 : ffffffc011bf7000 [ 608.915830] x7 : 0000000000000898 x6 : ffffff8217504080 [ 608.921142] x5 : ffffff8212282e00 x4 : ffffffc0111935e0 [ 608.926454] x3 : 0000000000000000 x2 : ffffffc0119b9d08 [ 608.931764] x1 : 0000000000000000 x0 : 0000000000000000 [ 608.937079] Call trace: [ 608.939531] drm_gem_fb_get_obj+0x10/0x28 [ 608.943547] hisi_fb_pan_display+0x50/0x1f8 [ 608.947736] dss_plane_atomic_update+0x10/0x20 [ 608.952183] drm_atomic_helper_commit_planes+0xe0/0x228 [ 608.957412] drm_atomic_helper_commit_tail+0x34/0x80 [ 608.962377] commit_tail+0x150/0x180 [ 608.965955] drm_atomic_helper_commit+0x164/0x178 [ 608.970665] drm_atomic_commit+0x4c/0x60 [ 608.974591] drm_framebuffer_remove+0x3f4/0x440 [ 608.979123] drm_mode_rmfb_work_fn+0x48/0x68 [ 608.983398] process_one_work+0x1ec/0x4b0 [ 608.987408] worker_thread+0x208/0x478 [ 608.991160] kthread+0x140/0x150 [ 608.994390] ret_from_fork+0x10/0x30 [ 608.997972] Code: d503233f 71000c3f 540000a8 8b214c01 (f9405420) [ 609.004069] ---[ end trace a837c42fc434e1a4 ]--- Which is due to the plane->state->fb value being null. Fix this with a solution used in a different version of this patch series. Cc: Mauro Carvalho Chehab Cc: Greg Kroah-Hartman Cc: Manivannan Sadhasivam Cc: dri-devel Cc: Liwei Cai Cc: Xinliang Liu Cc: Laurent Pinchart Cc: Sam Ravnborg Cc: Sumit Semwal Cc: Chen Feng Signed-off-by: John Stultz --- drivers/staging/hikey9xx/gpu/kirin9xx_drm_dss.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.17.1 diff --git a/drivers/staging/hikey9xx/gpu/kirin9xx_drm_dss.c b/drivers/staging/hikey9xx/gpu/kirin9xx_drm_dss.c index f2e99c766927..7adbd924bec2 100644 --- a/drivers/staging/hikey9xx/gpu/kirin9xx_drm_dss.c +++ b/drivers/staging/hikey9xx/gpu/kirin9xx_drm_dss.c @@ -702,6 +702,13 @@ static int dss_plane_atomic_check(struct drm_plane *plane, static void dss_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { + struct drm_plane_state *state = plane->state; + + if (!state->fb) { + state->visible = false; + return; + } + hisi_fb_pan_display(plane); }