[PATCH drm/hisilicon 0/2] hibmc clean up

2020-07-31 Thread Tian Tao
Do some refactoring of the code, #1 is clean up, #2 is for code refactoring. Tian Tao (2): drm/hisilicon: Remove the unnecessary header files drm/hisilicon: Code refactoring for hibmc_drv_de drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 58 ++-- drivers/gpu/drm

[PATCH v3] drm/hisilicon: Fixed the warning: Assignment of 0/1 to bool variable

2020-07-28 Thread Tian Tao
t's no need to set dev->pdev->msi_enabled again. Signed-off-by: Tian Tao --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 5 + drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm

[PATCH v2] drm/hisilicon: Fixed the warning: Assignment of 0/1 to bool variable

2020-07-07 Thread Tian Tao
fixed the following warning: hibmc_drm_drv.c:296:1-18:WARNING: Assignment of 0/1 to bool variable. hibmc_drm_drv.c:301:2-19: WARNING: Assignment of 0/1 to bool variable. v2: using the pci_dev.msi_enabled instead of priv->msi_enabled. Signed-off-by: Tian Tao --- drivers/gpu/drm/hisilicon/hi

[PATCH v3] drm/hisilicon: Code refactoring for hibmc_drv_vdac

2020-07-03 Thread Tian Tao
code refactoring for hibmc_drv_vdac.c, no actual function changes. v2: remove the debug message. v3: embedding connector and encoder in struct hibmc_drm_private. Signed-off-by: Tian Tao --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h | 2 + drivers/gpu/drm/hisilicon/hibmc

[PATCH v3] drm/hisilicon: Use drmm_kzalloc() instead of devm_kzalloc()

2020-07-03 Thread Tian Tao
using the new API drmm_kzalloc() instead of devm_kzalloc() v3: still fixed include statements sorted alphabetically. v2: keep the DRM include statements sorted alphabetically. Signed-off-by: Tian Tao Reviewed-by: Thomas Zimmermann --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 3

[PATCH] drm/hisilicon: Fixed the warning: Assignment of 0/1 to bool variable

2020-07-03 Thread Tian Tao
fixed the following warning: hibmc_drm_drv.c:296:1-18:WARNING: Assignment of 0/1 to bool variable. hibmc_drm_drv.c:301:2-19: WARNING: Assignment of 0/1 to bool variable. Signed-off-by: Tian Tao --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH] drm/hisilicon: Use drmm_kzalloc() instead of devm_kzalloc()

2020-07-02 Thread Tian Tao
using the new API drmm_kzalloc() instead of devm_kzalloc() Signed-off-by: Tian Tao --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc

[PATCH v2] drm/hisilicon: Use drmm_kzalloc() instead of devm_kzalloc()

2020-07-02 Thread Tian Tao
using the new API drmm_kzalloc() instead of devm_kzalloc() v2: keep the DRM include statements sorted alphabetically. Signed-off-by: Tian Tao Reviewed-by: Thomas Zimmermann --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 18 +- 1 file changed, 9 insertions(+), 9

[PATCH v2] drm/hisilicon: Add the shutdown for hibmc_pci_driver

2020-04-16 Thread Tian Tao
add the shutdown function to release the resource. v2: Remove the unnecessary unmap function. Signed-off-by: Tian Tao Reviewed-by: Sam Ravnborg --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm

[PATCH] drm/hisilicon: Add the shutdown for hibmc_pci_driver

2020-04-11 Thread Tian Tao
add the shutdown function to release the resource. Signed-off-by: Tian Tao --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc

[PATCH v2] drm/hisilicon: Code refactoring for hibmc_drv_vdac

2020-04-11 Thread Tian Tao
code refactoring for hibmc_drv_vdac.c, no actual function changes. v2: remove the debug message. Signed-off-by: Tian Tao Reviewed-by: Joe Perches --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 50 +++- 1 file changed, 14 insertions(+), 36 deletions(-) diff --git

[PATCH] drm/hisilicon: Code refactoring for hibmc_drv_vdac

2020-04-11 Thread Tian Tao
code refactoring for hibmc_drv_vdac.c, no actual function changes. Signed-off-by: Tian Tao --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 48 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c b

[PATCH] drm/hisilicon: Code cleanup for hibmc_drv_vdac

2020-03-06 Thread Tian Tao
code cleanup for hibmc_drv_vdac.c, no actual function changes. Signed-off-by: Tian Tao Signed-off-by: Gong junjie --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 49 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc

[PATCH 4/4] drm/hisilicon: Add the shutdown for hibmc_pci_driver

2020-03-06 Thread Tian Tao
add the shutdown function to release the resource. Signed-off-by: Tian Tao --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc

[PATCH 2/4] drm/hisilicon: Code cleanup for hibmc_drv_vdac

2020-03-06 Thread Tian Tao
code cleanup for hibmc_drv_vdac.c, no actual function changes. Signed-off-by: Tian Tao Signed-off-by: Gong junjie --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 49 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc

[PATCH] drm/hisilicon: Add the shutdown for hibmc_pci_driver

2020-03-06 Thread Tian Tao
add the shutdown function to release the resource. Signed-off-by: Tian Tao --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc

[PATCH] drm/hisilicon: Add the load and unload for hibmc_driver

2020-03-06 Thread Tian Tao
using the load and unload function provided by drm framework instead of doing the same work in the hibmc_pci_probe and do some code cleanup. Signed-off-by: Tian Tao Signed-off-by: Gong junjie --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 62 + drivers/gpu/drm

[PATCH 3/4] drm/hisilicon: Add the load and unload for hibmc_driver

2020-03-06 Thread Tian Tao
using the load and unload function provided by drm framework instead of doing the same work in the hibmc_pci_probe and do some code cleanup. Signed-off-by: Tian Tao Signed-off-by: Gong junjie --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 62 + drivers/gpu/drm

[PATCH 1/4] drm/hisilicon: Enforce 128-byte stride alignment to fix the hardware limitation

2020-03-06 Thread Tian Tao
because the hardware limitation,The initial color depth must set to 32bpp and must set the FB Offset of the display hardware to 128Byte alignment, which is used to solve the display problem at 800x600 and 1440x900 resolution under 16bpp. Signed-off-by: Tian Tao Signed-off-by: Gong junjie

[PATCH v2] drm/hisilicon: Fixed pcie resource conflict between drm and firmware

2020-02-24 Thread Tian Tao
use the drm_fb_helper_remove_conflicting_pci_framebuffer to remove the framebuffer initialized by fireware/bootloader to avoid resource conflict. Signed-off-by: Tian Tao --- v2: use the general API to remove the conflict resource instead of rolling our own. --- --- drivers/gpu/drm

[PATCH] drm/hisilicon: Fixed pcie resource conflict using the general API

2020-02-21 Thread Tian Tao
the kernel provide the drm_fb_helper_remove_conflicting_pci_framebuffer to remvoe the pcie resource conflict,there is no need to driver it again. Signed-off-by: Tian Tao --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 22 +- 1 file changed, 5 insertions(+), 17

[PATCH] drm/hisilicon: Set preferred mode resolution and maximum resolution

2020-02-19 Thread Tian Tao
set the preferred mode resolution to 1024 * 768 and maximum resolution to 1920 * 1200. Signed-off-by: Tian Tao Signed-off-by: Gong junjie --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/hisilicon

[PATCH] drm/hisilicon: Fixed pcie resource conflict between drm and firmware

2020-02-19 Thread Tian Tao
remove the framebuffer initialized by fireware/bootloader,which will use hibmc's pcie resource, and may cause conflict. Signed-off-by: Tian Tao Signed-off-by: Gong junjie --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 18 ++ 1 file changed, 18 insertions(+) diff --git

[PATCH] drm/hisilicon: Enable the shadowfb for hibmc

2020-01-12 Thread Tian Tao
set the prefer_shadow as 1,so we use the shadowfb to acceleration. Signed-off-by: Tian Tao Signed-off-by: Gong junjie --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b

[PATCH v2] drm/hisilicon: Add the mode_valid function

2020-01-09 Thread Tian Tao
add mode_valid function, we can make sure the resolution is valid. Signed-off-by: Tian Tao Signed-off-by: Gong junjie Reviewed-by: Thomas Zimmermann --- v2: declare hibmc_crtc_mode_valid as static. Modify the return value of hibmc_crtc_mode_valid . --- drivers/gpu/drm/hisilicon

[PATCH] drm/hisilicon: add the mode_valid function

2020-01-09 Thread Tian Tao
add mode_valid function, and we can also use it to make suse the resolution is valid. Signed-off-by: Tian Tao Signed-off-by: Gong junjie --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 20 1 file changed, 20 insertions(+) diff --git a/drivers/gpu/drm/hisilicon/hibmc

[PATCH] drm/hisilicon: Enforce 128-byte stride alignment to fix the display problem

2020-01-04 Thread Tian Tao
because the hardware limitation,The initial color depth must set to 32bpp and must set the FB Offset of the display hardware to 128Byte alignment, which is used to solve the display problem at 800x600 and 1440x900 resolution under 16bpp. Signed-off-by: Tian Tao Signed-off-by: Gong junjie

[PATCH] drm/hisilicon: fixed the wrong resolution configurations

2020-01-04 Thread Tian Tao
The maximum resolution supported by hibmc is 1920 * 1200 instead of 1920 * 1440, this patch fixed this problem Signed-off-by: Tian Tao Signed-off-by: Gong junjie --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu

[PATCH] drm/hisilicon: get the BO from drm_fb rather than hibmc_fb

2019-12-31 Thread Tian Tao
since we can get the BO from drm_fb rather than hibmc_fb,do not need the hibmc_fb.so we delete the local variable hibmc_fb. Signed-off-by: Tian Tao Signed-off-by: Gong junjie --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git

[PATCH] drm/hisilicon: Add new clock/resolution configurations

2019-12-31 Thread Tian Tao
Add the three new pll config for corresponding resolution 1440x900 and 1600x900, 640x480 for hibmc Signed-off-by: Tian Tao Signed-off-by: Gong junjie --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 3 +++ drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_regs.h | 2 ++ 2 files changed, 5

[PATCH] drm/hisilicon: Checked the resolution is valid before connector

2019-12-28 Thread Tian Tao
In the previous version, the callback function mode_valid of drm_connector_helper_funcs directly returned MODE_OK. Now we will ensure that the resolution is correct and return MODE_OK, otherwise return MODE_NOMODE. Signed-off-by: Tian Tao Signed-off-by: Gong junjie --- drivers/gpu/drm

[PATCH] drm/hisilicon: Checked the resolution is valid before connector

2019-12-28 Thread Tian Tao
In the previous version, the callback function mode_valid of drm_connector_helper_funcs directly returned MODE_OK. Now we will ensure that the resolution is correct and return MODE_OK, otherwise return MODE_NOMODE. Signed-off-by: Tian Tao Signed-off-by: Gong junjie --- drivers/gpu/drm

[PATCH] drm/hisilicon: Added three new resolutions and changed the alignment to 128 Bytes

2019-12-28 Thread Tian Tao
Add the three new resolution 1440x900 and 1600x900, 640x480 for hibmc and Set the FB Offset of the display hardware to 128 Byte alignment Signed-off-by: Tian Tao Signed-off-by: Gong junjie --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 11 +-- drivers/gpu/drm/hisilicon/hibmc

<    1   2   3