linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH drm/hisilicon 0/3] support reading resolutions from EDID
@ 2020-12-04  1:23 Tian Tao
  2020-12-04  1:23 ` [PATCH] drm/fsl-dcu: remove redundant platform_get_irq error message Tian Tao
                   ` (12 more replies)
  0 siblings, 13 replies; 16+ messages in thread
From: Tian Tao @ 2020-12-04  1:23 UTC (permalink / raw)
  To: airlied, daniel, tzimmermann, kraxel, alexander.deucher, tglx,
	dri-devel, xinliang.liu, linux-kernel

patch #1 add a new file to implements i2c adapters, #2 read the
resolution from the edid, if that fails, set the resolution to fixed.
patch #3 update the destroy callback function to release the i2c adapters.

Tian Tao (3):
  drm/hisilicon: Support i2c driver algorithms for bit-shift adapters
  drm/hisilicon: Features to support reading resolutions from EDID
  drm/hisilicon: Releasing Resources in the Destroy callback Function

 drivers/gpu/drm/hisilicon/hibmc/Makefile         |  2 +-
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h  | 21 ++++-
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c  | 98 ++++++++++++++++++++++++
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 45 +++++++++--
 4 files changed, 157 insertions(+), 9 deletions(-)
 create mode 100644 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c

-- 
2.7.4


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] drm/fsl-dcu: remove redundant platform_get_irq error message
  2020-12-04  1:23 [PATCH drm/hisilicon 0/3] support reading resolutions from EDID Tian Tao
@ 2020-12-04  1:23 ` Tian Tao
  2020-12-04  1:23 ` [PATCH 1/2] drm/hisilicon: Use managed mode-config init Tian Tao
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Tian Tao @ 2020-12-04  1:23 UTC (permalink / raw)
  To: airlied, daniel, tzimmermann, kraxel, alexander.deucher, tglx,
	dri-devel, xinliang.liu, linux-kernel

Function dev_err() after platform_get_irq() is redundant because
platform_get_irq() already prints an error.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
index 7528e8a..476b196 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
@@ -259,7 +259,6 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
 
 	fsl_dev->irq = platform_get_irq(pdev, 0);
 	if (fsl_dev->irq < 0) {
-		dev_err(dev, "failed to get irq\n");
 		return fsl_dev->irq;
 	}
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 1/2] drm/hisilicon: Use managed mode-config init
  2020-12-04  1:23 [PATCH drm/hisilicon 0/3] support reading resolutions from EDID Tian Tao
  2020-12-04  1:23 ` [PATCH] drm/fsl-dcu: remove redundant platform_get_irq error message Tian Tao
@ 2020-12-04  1:23 ` Tian Tao
  2020-12-04  1:23 ` [PATCH] drm/msm/dp: remove duplicate include statement Tian Tao
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Tian Tao @ 2020-12-04  1:23 UTC (permalink / raw)
  To: airlied, daniel, tzimmermann, kraxel, alexander.deucher, tglx,
	dri-devel, xinliang.liu, linux-kernel

Using drmm_mode_config_init() sets up managed release of modesetting
resources.
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 5aea2e9..04fee18 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -82,7 +82,9 @@ static int hibmc_kms_init(struct hibmc_drm_private *priv)
 	struct drm_device *dev = &priv->dev;
 	int ret;
 
-	drm_mode_config_init(dev);
+	ret = drmm_mode_config_init(dev);
+	if (ret)
+		return ret;
 	priv->mode_config_initialized = true;
 
 	dev->mode_config.min_width = 0;
@@ -111,14 +113,6 @@ static int hibmc_kms_init(struct hibmc_drm_private *priv)
 	return 0;
 }
 
-static void hibmc_kms_fini(struct hibmc_drm_private *priv)
-{
-	if (priv->mode_config_initialized) {
-		drm_mode_config_cleanup(&priv->dev);
-		priv->mode_config_initialized = false;
-	}
-}
-
 /*
  * It can operate in one of three modes: 0, 1 or Sleep.
  */
@@ -248,7 +242,6 @@ static int hibmc_unload(struct drm_device *dev)
 	drm_atomic_helper_shutdown(dev);
 
 	pci_disable_msi(dev->pdev);
-	hibmc_kms_fini(priv);
 	dev->dev_private = NULL;
 	return 0;
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH] drm/msm/dp: remove duplicate include statement
  2020-12-04  1:23 [PATCH drm/hisilicon 0/3] support reading resolutions from EDID Tian Tao
  2020-12-04  1:23 ` [PATCH] drm/fsl-dcu: remove redundant platform_get_irq error message Tian Tao
  2020-12-04  1:23 ` [PATCH 1/2] drm/hisilicon: Use managed mode-config init Tian Tao
@ 2020-12-04  1:23 ` Tian Tao
  2020-12-04  1:23 ` [PATCH] drm/msm/dsi: Replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Tian Tao @ 2020-12-04  1:23 UTC (permalink / raw)
  To: airlied, daniel, tzimmermann, kraxel, alexander.deucher, tglx,
	dri-devel, xinliang.liu, linux-kernel

linux/rational.h is included more than once, Remove the one that isn't
necessary.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/drm/msm/dp/dp_catalog.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.c b/drivers/gpu/drm/msm/dp/dp_catalog.c
index b15b4ce..105fa65 100644
--- a/drivers/gpu/drm/msm/dp/dp_catalog.c
+++ b/drivers/gpu/drm/msm/dp/dp_catalog.c
@@ -5,7 +5,6 @@
 
 #define pr_fmt(fmt)	"[drm-dp] %s: " fmt, __func__
 
-#include <linux/rational.h>
 #include <linux/delay.h>
 #include <linux/iopoll.h>
 #include <linux/phy/phy.h>
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH] drm/msm/dsi: Replace spin_lock_irqsave by spin_lock in hard IRQ
  2020-12-04  1:23 [PATCH drm/hisilicon 0/3] support reading resolutions from EDID Tian Tao
                   ` (2 preceding siblings ...)
  2020-12-04  1:23 ` [PATCH] drm/msm/dp: remove duplicate include statement Tian Tao
@ 2020-12-04  1:23 ` Tian Tao
  2020-12-04  1:23 ` [PATCH] drm/nouveau/fb/gp102-: use flexible-array member instead of zero-length array Tian Tao
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Tian Tao @ 2020-12-04  1:23 UTC (permalink / raw)
  To: airlied, daniel, tzimmermann, kraxel, alexander.deucher, tglx,
	dri-devel, xinliang.liu, linux-kernel

It is redundant to do irqsave and irqrestore in hardIRQ context.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index b17ac6c..b2fb5c3 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -1555,15 +1555,14 @@ static irqreturn_t dsi_host_irq(int irq, void *ptr)
 {
 	struct msm_dsi_host *msm_host = ptr;
 	u32 isr;
-	unsigned long flags;
 
 	if (!msm_host->ctrl_base)
 		return IRQ_HANDLED;
 
-	spin_lock_irqsave(&msm_host->intr_lock, flags);
+	spin_lock(&msm_host->intr_lock);
 	isr = dsi_read(msm_host, REG_DSI_INTR_CTRL);
 	dsi_write(msm_host, REG_DSI_INTR_CTRL, isr);
-	spin_unlock_irqrestore(&msm_host->intr_lock, flags);
+	spin_unlock(&msm_host->intr_lock);
 
 	DBG("isr=0x%x, id=%d", isr, msm_host->id);
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH] drm/nouveau/fb/gp102-: use flexible-array member instead of zero-length array
  2020-12-04  1:23 [PATCH drm/hisilicon 0/3] support reading resolutions from EDID Tian Tao
                   ` (3 preceding siblings ...)
  2020-12-04  1:23 ` [PATCH] drm/msm/dsi: Replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
@ 2020-12-04  1:23 ` Tian Tao
  2020-12-04  1:23 ` [PATCH] drm/nouveau: Use vmemdup_user() Tian Tao
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Tian Tao @ 2020-12-04  1:23 UTC (permalink / raw)
  To: airlied, daniel, tzimmermann, kraxel, alexander.deucher, tglx,
	dri-devel, xinliang.liu, linux-kernel

fixed the coccicheck:
drivers/gpu/drm/nouveau/include/nvfw/hs.h:26:5-9: WARNING use
flexible-array member instead.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/drm/nouveau/include/nvfw/hs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/include/nvfw/hs.h b/drivers/gpu/drm/nouveau/include/nvfw/hs.h
index 64d0d32..b53bbc4 100644
--- a/drivers/gpu/drm/nouveau/include/nvfw/hs.h
+++ b/drivers/gpu/drm/nouveau/include/nvfw/hs.h
@@ -23,7 +23,7 @@ struct nvfw_hs_load_header {
 	u32 data_dma_base;
 	u32 data_size;
 	u32 num_apps;
-	u32 apps[0];
+	u32 apps[];
 };
 
 const struct nvfw_hs_load_header *
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH] drm/nouveau: Use vmemdup_user()
  2020-12-04  1:23 [PATCH drm/hisilicon 0/3] support reading resolutions from EDID Tian Tao
                   ` (4 preceding siblings ...)
  2020-12-04  1:23 ` [PATCH] drm/nouveau/fb/gp102-: use flexible-array member instead of zero-length array Tian Tao
@ 2020-12-04  1:23 ` Tian Tao
  2020-12-04  1:23 ` [PATCH] drm/tilcdc: Remove unnecessary THIS_MODULE Tian Tao
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Tian Tao @ 2020-12-04  1:23 UTC (permalink / raw)
  To: airlied, daniel, tzimmermann, kraxel, alexander.deucher, tglx,
	dri-devel, xinliang.liu, linux-kernel

Replace alloc and copy with vmemdup_user()

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/drm/nouveau/nouveau_gem.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index 787d05e..df986d9 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -591,14 +591,9 @@ u_memcpya(uint64_t user, unsigned nmemb, unsigned size)
 
 	size *= nmemb;
 
-	mem = kvmalloc(size, GFP_KERNEL);
-	if (!mem)
-		return ERR_PTR(-ENOMEM);
-
-	if (copy_from_user(mem, userptr, size)) {
-		u_free(mem);
-		return ERR_PTR(-EFAULT);
-	}
+	mem = vmemdup_user(userptr, size);
+	if (IS_ERR(mem))
+		return ERR_CAST(mem);
 
 	return mem;
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH] drm/tilcdc: Remove unnecessary THIS_MODULE
  2020-12-04  1:23 [PATCH drm/hisilicon 0/3] support reading resolutions from EDID Tian Tao
                   ` (5 preceding siblings ...)
  2020-12-04  1:23 ` [PATCH] drm/nouveau: Use vmemdup_user() Tian Tao
@ 2020-12-04  1:23 ` Tian Tao
  2020-12-04  1:23 ` [PATCH] drm/ttm: remove unused varibles Tian Tao
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Tian Tao @ 2020-12-04  1:23 UTC (permalink / raw)
  To: airlied, daniel, tzimmermann, kraxel, alexander.deucher, tglx,
	dri-devel, xinliang.liu, linux-kernel

As THIS_MODULE has been set in platform_driver_register(),
so remove it.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/drm/tilcdc/tilcdc_panel.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
index 00efc30..4235780 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
@@ -399,7 +399,6 @@ static struct platform_driver panel_driver = {
 	.probe = panel_probe,
 	.remove = panel_remove,
 	.driver = {
-		.owner = THIS_MODULE,
 		.name = "tilcdc-panel",
 		.of_match_table = panel_of_match,
 	},
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH] drm/ttm: remove unused varibles
  2020-12-04  1:23 [PATCH drm/hisilicon 0/3] support reading resolutions from EDID Tian Tao
                   ` (6 preceding siblings ...)
  2020-12-04  1:23 ` [PATCH] drm/tilcdc: Remove unnecessary THIS_MODULE Tian Tao
@ 2020-12-04  1:23 ` Tian Tao
  2020-12-04  1:23 ` [PATCH] drm/vc4: Deleted the drm_device declaration Tian Tao
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Tian Tao @ 2020-12-04  1:23 UTC (permalink / raw)
  To: airlied, daniel, tzimmermann, kraxel, alexander.deucher, tglx,
	dri-devel, xinliang.liu, linux-kernel

fixed the following warnings
drivers/gpu/drm/nouveau/nouveau_bo.c:1227:17: warning: variable ‘dev’
set but not used [-Wunused-but-set-variable]
drivers/gpu/drm/nouveau/nouveau_bo.c:1251:17: warning: variable ‘dev’
set but not used [-Wunused-but-set-variable]

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/drm/nouveau/nouveau_bo.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 7aa4286..9465f56 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -1228,7 +1228,6 @@ nouveau_ttm_tt_populate(struct ttm_bo_device *bdev,
 {
 	struct ttm_tt *ttm_dma = (void *)ttm;
 	struct nouveau_drm *drm;
-	struct device *dev;
 	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
 
 	if (ttm_tt_is_populated(ttm))
@@ -1242,7 +1241,6 @@ nouveau_ttm_tt_populate(struct ttm_bo_device *bdev,
 	}
 
 	drm = nouveau_bdev(bdev);
-	dev = drm->dev->dev;
 
 	return ttm_pool_alloc(&drm->ttm.bdev.pool, ttm, ctx);
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH] drm/vc4: Deleted the drm_device declaration
  2020-12-04  1:23 [PATCH drm/hisilicon 0/3] support reading resolutions from EDID Tian Tao
                   ` (7 preceding siblings ...)
  2020-12-04  1:23 ` [PATCH] drm/ttm: remove unused varibles Tian Tao
@ 2020-12-04  1:23 ` Tian Tao
  2020-12-04  1:23 ` [PATCH] gpu: ipu-v3: replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Tian Tao @ 2020-12-04  1:23 UTC (permalink / raw)
  To: airlied, daniel, tzimmermann, kraxel, alexander.deucher, tglx,
	dri-devel, xinliang.liu, linux-kernel

drm_modeset_lock.h already declares struct drm_device, so there's no
need to declare it in vc4_drv.h

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/drm/vc4/vc4_drv.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h
index 8c8d96b..8717a1c 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.h
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
@@ -19,7 +19,6 @@
 
 #include "uapi/drm/vc4_drm.h"
 
-struct drm_device;
 struct drm_gem_object;
 
 /* Don't forget to update vc4_bo.c: bo_type_names[] when adding to
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH] gpu: ipu-v3: replace spin_lock_irqsave by spin_lock in hard IRQ
  2020-12-04  1:23 [PATCH drm/hisilicon 0/3] support reading resolutions from EDID Tian Tao
                   ` (8 preceding siblings ...)
  2020-12-04  1:23 ` [PATCH] drm/vc4: Deleted the drm_device declaration Tian Tao
@ 2020-12-04  1:23 ` Tian Tao
  2020-12-04  1:23 ` [PATCH 2/2] drm/hisilicon: Deletted unused local parameters Tian Tao
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Tian Tao @ 2020-12-04  1:23 UTC (permalink / raw)
  To: airlied, daniel, tzimmermann, kraxel, alexander.deucher, tglx,
	dri-devel, xinliang.liu, linux-kernel

The code has been in a irq-disabled context since it is hard IRQ. There
is no necessity to do it again.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/ipu-v3/ipu-image-convert.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/ipu-v3/ipu-image-convert.c b/drivers/gpu/ipu-v3/ipu-image-convert.c
index aa1d4b6..c28764c 100644
--- a/drivers/gpu/ipu-v3/ipu-image-convert.c
+++ b/drivers/gpu/ipu-v3/ipu-image-convert.c
@@ -1737,9 +1737,8 @@ static irqreturn_t eof_irq(int irq, void *data)
 	struct ipu_image_convert_run *run;
 	irqreturn_t ret = IRQ_HANDLED;
 	bool tile_complete = false;
-	unsigned long flags;
 
-	spin_lock_irqsave(&chan->irqlock, flags);
+	spin_lock(&chan->irqlock);
 
 	/* get current run and its context */
 	run = chan->current_run;
@@ -1778,7 +1777,7 @@ static irqreturn_t eof_irq(int irq, void *data)
 	if (tile_complete)
 		ret = do_tile_complete(run);
 out:
-	spin_unlock_irqrestore(&chan->irqlock, flags);
+	spin_unlock(&chan->irqlock);
 	return ret;
 }
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/2] drm/hisilicon: Deletted unused local parameters
  2020-12-04  1:23 [PATCH drm/hisilicon 0/3] support reading resolutions from EDID Tian Tao
                   ` (9 preceding siblings ...)
  2020-12-04  1:23 ` [PATCH] gpu: ipu-v3: replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
@ 2020-12-04  1:23 ` Tian Tao
  2020-12-04  1:23 ` [PATCH v2] drm/hisilicon: Delete the entire file hibmc_ttm.c Tian Tao
  2020-12-04  1:23 ` [PATCH drm/hisilicon v3 0/2] support reading resolutions from EDID Tian Tao
  12 siblings, 0 replies; 16+ messages in thread
From: Tian Tao @ 2020-12-04  1:23 UTC (permalink / raw)
  To: airlied, daniel, tzimmermann, kraxel, alexander.deucher, tglx,
	dri-devel, xinliang.liu, linux-kernel

deletted unused variable ‘priv’.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 04fee18..8a04014 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -237,12 +237,9 @@ static int hibmc_hw_init(struct hibmc_drm_private *priv)
 
 static int hibmc_unload(struct drm_device *dev)
 {
-	struct hibmc_drm_private *priv = to_hibmc_drm_private(dev);
-
 	drm_atomic_helper_shutdown(dev);
-
 	pci_disable_msi(dev->pdev);
-	dev->dev_private = NULL;
+
 	return 0;
 }
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2] drm/hisilicon: Delete the entire file hibmc_ttm.c
  2020-12-04  1:23 [PATCH drm/hisilicon 0/3] support reading resolutions from EDID Tian Tao
                   ` (10 preceding siblings ...)
  2020-12-04  1:23 ` [PATCH 2/2] drm/hisilicon: Deletted unused local parameters Tian Tao
@ 2020-12-04  1:23 ` Tian Tao
  2020-12-04  1:23 ` [PATCH drm/hisilicon v3 0/2] support reading resolutions from EDID Tian Tao
  12 siblings, 0 replies; 16+ messages in thread
From: Tian Tao @ 2020-12-04  1:23 UTC (permalink / raw)
  To: airlied, daniel, tzimmermann, kraxel, alexander.deucher, tglx,
	dri-devel, xinliang.liu, linux-kernel

Delete the entire file hibmc_ttm.c. drmm_vram_helper_init() can be
called directly from hibmc_load(). hibmc_dumb_create() and
hibmc_mode_funcs can go to hibmc_drm_drv.c

v2:
change Deletted to Delete

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/hisilicon/hibmc/Makefile        |  2 +-
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 21 ++++++++++-
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h |  4 --
 drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c     | 50 -------------------------
 4 files changed, 20 insertions(+), 57 deletions(-)
 delete mode 100644 drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c

diff --git a/drivers/gpu/drm/hisilicon/hibmc/Makefile b/drivers/gpu/drm/hisilicon/hibmc/Makefile
index 684ef79..d25c75e 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/Makefile
+++ b/drivers/gpu/drm/hisilicon/hibmc/Makefile
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
-hibmc-drm-y := hibmc_drm_drv.o hibmc_drm_de.o hibmc_drm_vdac.o hibmc_ttm.o hibmc_drm_i2c.o
+hibmc-drm-y := hibmc_drm_drv.o hibmc_drm_de.o hibmc_drm_vdac.o hibmc_drm_i2c.o
 
 obj-$(CONFIG_DRM_HISI_HIBMC) += hibmc-drm.o
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 5aea2e9..3687753 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -16,6 +16,7 @@
 
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_drv.h>
+#include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_gem_vram_helper.h>
 #include <drm/drm_irq.h>
 #include <drm/drm_managed.h>
@@ -43,6 +44,12 @@ static irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
 	return IRQ_HANDLED;
 }
 
+static int hibmc_dumb_create(struct drm_file *file, struct drm_device *dev,
+			     struct drm_mode_create_dumb *args)
+{
+	return drm_gem_vram_fill_create_dumb(file, dev, 0, 128, args);
+}
+
 static const struct drm_driver hibmc_driver = {
 	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
 	.fops			= &hibmc_fops,
@@ -77,6 +84,13 @@ static const struct dev_pm_ops hibmc_pm_ops = {
 				hibmc_pm_resume)
 };
 
+static const struct drm_mode_config_funcs hibmc_mode_funcs = {
+	.mode_valid = drm_vram_helper_mode_valid,
+	.atomic_check = drm_atomic_helper_check,
+	.atomic_commit = drm_atomic_helper_commit,
+	.fb_create = drm_gem_fb_create,
+};
+
 static int hibmc_kms_init(struct hibmc_drm_private *priv)
 {
 	struct drm_device *dev = &priv->dev;
@@ -262,9 +276,12 @@ static int hibmc_load(struct drm_device *dev)
 	if (ret)
 		goto err;
 
-	ret = hibmc_mm_init(priv);
-	if (ret)
+	ret = drmm_vram_helper_init(dev, pci_resource_start(dev->pdev, 0),
+				    priv->fb_size);
+	if (ret) {
+		drm_err(dev, "Error initializing VRAM MM; %d\n", ret);
 		goto err;
+	}
 
 	ret = hibmc_kms_init(priv);
 	if (ret)
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h
index 2786de5..a49c10e 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h
@@ -64,10 +64,6 @@ int hibmc_de_init(struct hibmc_drm_private *priv);
 int hibmc_vdac_init(struct hibmc_drm_private *priv);
 
 int hibmc_mm_init(struct hibmc_drm_private *hibmc);
-int hibmc_dumb_create(struct drm_file *file, struct drm_device *dev,
-		      struct drm_mode_create_dumb *args);
 int hibmc_ddc_create(struct drm_device *drm_dev, struct hibmc_connector *connector);
 
-extern const struct drm_mode_config_funcs hibmc_mode_funcs;
-
 #endif
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
deleted file mode 100644
index 892d566..0000000
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
+++ /dev/null
@@ -1,50 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/* Hisilicon Hibmc SoC drm driver
- *
- * Based on the bochs drm driver.
- *
- * Copyright (c) 2016 Huawei Limited.
- *
- * Author:
- *	Rongrong Zou <zourongrong@huawei.com>
- *	Rongrong Zou <zourongrong@gmail.com>
- *	Jianhua Li <lijianhua@huawei.com>
- */
-
-#include <linux/pci.h>
-
-#include <drm/drm_atomic_helper.h>
-#include <drm/drm_gem.h>
-#include <drm/drm_gem_framebuffer_helper.h>
-#include <drm/drm_gem_vram_helper.h>
-#include <drm/drm_print.h>
-
-#include "hibmc_drm_drv.h"
-
-int hibmc_mm_init(struct hibmc_drm_private *hibmc)
-{
-	int ret;
-	struct drm_device *dev = &hibmc->dev;
-
-	ret = drmm_vram_helper_init(dev, pci_resource_start(dev->pdev, 0),
-				    hibmc->fb_size);
-	if (ret) {
-		drm_err(dev, "Error initializing VRAM MM; %d\n", ret);
-		return ret;
-	}
-
-	return 0;
-}
-
-int hibmc_dumb_create(struct drm_file *file, struct drm_device *dev,
-		      struct drm_mode_create_dumb *args)
-{
-	return drm_gem_vram_fill_create_dumb(file, dev, 0, 128, args);
-}
-
-const struct drm_mode_config_funcs hibmc_mode_funcs = {
-	.mode_valid = drm_vram_helper_mode_valid,
-	.atomic_check = drm_atomic_helper_check,
-	.atomic_commit = drm_atomic_helper_commit,
-	.fb_create = drm_gem_fb_create,
-};
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH drm/hisilicon v3 0/2] support reading resolutions from EDID
  2020-12-04  1:23 [PATCH drm/hisilicon 0/3] support reading resolutions from EDID Tian Tao
                   ` (11 preceding siblings ...)
  2020-12-04  1:23 ` [PATCH v2] drm/hisilicon: Delete the entire file hibmc_ttm.c Tian Tao
@ 2020-12-04  1:23 ` Tian Tao
  12 siblings, 0 replies; 16+ messages in thread
From: Tian Tao @ 2020-12-04  1:23 UTC (permalink / raw)
  To: airlied, daniel, tzimmermann, kraxel, alexander.deucher, tglx,
	dri-devel, xinliang.liu, linux-kernel

patch #1 add a new file to implements i2c adapters, #2 read the
resolution from the edid, if that fails, set the resolution to fixed.
and update the destroy callback function to release the i2c adapters

Changes since v1:
-merge patch #3 into patch #2.
-add new function to_hibmc_drm_private, modify three functions in
hibmc_drm_i2c.c with the newly added function.
-deleting the member variable dev from the structure hibmc_connector.
-modify print log incorrectly.
-Modify hibmc_connector_get_modes.

Changes since v2:
-rewrite the funtion to_hibmc_drm_private, and rename GPIO_SCL_MASK
to I2C_SCL_MASK

Tian Tao (2):
  drm/hisilicon: Support i2c driver algorithms for bit-shift adapters
  drm/hisilicon: Features to support reading resolutions from EDID

 drivers/gpu/drm/hisilicon/hibmc/Makefile         |  2 +-
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h  | 25 +++++-
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c  | 99 ++++++++++++++++++++++++
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 38 ++++++++-
 4 files changed, 158 insertions(+), 6 deletions(-)
 create mode 100644 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c

-- 
2.7.4


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] drm/ttm: remove unused varibles
@ 2020-11-20  6:49 Tian Tao
  2020-11-19 20:18 ` Christian König
  0 siblings, 1 reply; 16+ messages in thread
From: Tian Tao @ 2020-11-20  6:49 UTC (permalink / raw)
  To: bskeggs, airlied, daniel, sumit.semwal, christian.koenig
  Cc: dri-devel, nouveau, linux-kernel, linux-media, linaro-mm-sig

fixed the following warnings
drivers/gpu/drm/nouveau/nouveau_bo.c:1227:17: warning: variable ‘dev’
set but not used [-Wunused-but-set-variable]
drivers/gpu/drm/nouveau/nouveau_bo.c:1251:17: warning: variable ‘dev’
set but not used [-Wunused-but-set-variable]

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/drm/nouveau/nouveau_bo.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 7aa4286..9465f56 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -1228,7 +1228,6 @@ nouveau_ttm_tt_populate(struct ttm_bo_device *bdev,
 {
 	struct ttm_tt *ttm_dma = (void *)ttm;
 	struct nouveau_drm *drm;
-	struct device *dev;
 	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
 
 	if (ttm_tt_is_populated(ttm))
@@ -1242,7 +1241,6 @@ nouveau_ttm_tt_populate(struct ttm_bo_device *bdev,
 	}
 
 	drm = nouveau_bdev(bdev);
-	dev = drm->dev->dev;
 
 	return ttm_pool_alloc(&drm->ttm.bdev.pool, ttm, ctx);
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH] drm/ttm: remove unused varibles
  2020-11-20  6:49 [PATCH] drm/ttm: remove unused varibles Tian Tao
@ 2020-11-19 20:18 ` Christian König
  0 siblings, 0 replies; 16+ messages in thread
From: Christian König @ 2020-11-19 20:18 UTC (permalink / raw)
  To: Tian Tao, bskeggs, airlied, daniel, sumit.semwal
  Cc: dri-devel, nouveau, linux-kernel, linux-media, linaro-mm-sig

Am 20.11.20 um 07:49 schrieb Tian Tao:
> fixed the following warnings
> drivers/gpu/drm/nouveau/nouveau_bo.c:1227:17: warning: variable ‘dev’
> set but not used [-Wunused-but-set-variable]
> drivers/gpu/drm/nouveau/nouveau_bo.c:1251:17: warning: variable ‘dev’
> set but not used [-Wunused-but-set-variable]
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>

The subject should read drm/nouveau instead of drm/ttm, but apart from 
that the patch is Acked-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/nouveau/nouveau_bo.c | 2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
> index 7aa4286..9465f56 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> @@ -1228,7 +1228,6 @@ nouveau_ttm_tt_populate(struct ttm_bo_device *bdev,
>   {
>   	struct ttm_tt *ttm_dma = (void *)ttm;
>   	struct nouveau_drm *drm;
> -	struct device *dev;
>   	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
>   
>   	if (ttm_tt_is_populated(ttm))
> @@ -1242,7 +1241,6 @@ nouveau_ttm_tt_populate(struct ttm_bo_device *bdev,
>   	}
>   
>   	drm = nouveau_bdev(bdev);
> -	dev = drm->dev->dev;
>   
>   	return ttm_pool_alloc(&drm->ttm.bdev.pool, ttm, ctx);
>   }


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-12-04  1:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04  1:23 [PATCH drm/hisilicon 0/3] support reading resolutions from EDID Tian Tao
2020-12-04  1:23 ` [PATCH] drm/fsl-dcu: remove redundant platform_get_irq error message Tian Tao
2020-12-04  1:23 ` [PATCH 1/2] drm/hisilicon: Use managed mode-config init Tian Tao
2020-12-04  1:23 ` [PATCH] drm/msm/dp: remove duplicate include statement Tian Tao
2020-12-04  1:23 ` [PATCH] drm/msm/dsi: Replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
2020-12-04  1:23 ` [PATCH] drm/nouveau/fb/gp102-: use flexible-array member instead of zero-length array Tian Tao
2020-12-04  1:23 ` [PATCH] drm/nouveau: Use vmemdup_user() Tian Tao
2020-12-04  1:23 ` [PATCH] drm/tilcdc: Remove unnecessary THIS_MODULE Tian Tao
2020-12-04  1:23 ` [PATCH] drm/ttm: remove unused varibles Tian Tao
2020-12-04  1:23 ` [PATCH] drm/vc4: Deleted the drm_device declaration Tian Tao
2020-12-04  1:23 ` [PATCH] gpu: ipu-v3: replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
2020-12-04  1:23 ` [PATCH 2/2] drm/hisilicon: Deletted unused local parameters Tian Tao
2020-12-04  1:23 ` [PATCH v2] drm/hisilicon: Delete the entire file hibmc_ttm.c Tian Tao
2020-12-04  1:23 ` [PATCH drm/hisilicon v3 0/2] support reading resolutions from EDID Tian Tao
  -- strict thread matches above, loose matches on Subject: below --
2020-11-20  6:49 [PATCH] drm/ttm: remove unused varibles Tian Tao
2020-11-19 20:18 ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).