Kenneth Feng
6da6c27928
drm/amd/amdgpu: disable MMHUB PG for navi10
...
Disable MMHUB PG for navi10 according to the production requirement.
Signed-off-by: Kenneth Feng <kenneth.feng@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Kevin Wang <kevin1.wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:18:05 -05:00
Evan Quan
6169631236
drm/amd/powerplay: correct typo
...
"COMPUTE" was wrongly spelled as "CUSTOM".
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Kevin Wang <kevin1.wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:17:57 -05:00
Evan Quan
a056ddce9b
drm/amd/powerplay: correct SW smu11 thermal range settings
...
Problems with current settings:
1. The min value was overrided to 0 on Vega20 & Navi10. While
the expected should be -273.15 C.
2. The thermal min/max threshold was output in wrong unit on
Navi10 & Arcturus. As TEMP_RANGE_MIN/MAX is already in
millicelsius. And "*1000" in smu_v11_0_start_thermal_control
makes the output wrongly.
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:17:49 -05:00
Evan Quan
69174eebc9
drm/amd/powerplay: set Arcturus default fclk as bootup value on dpm disabled
...
On fclk dpm disabled, the default dpm table will be setup with only one
level and clock frequency as bootup value.
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Kevin Wang <kevin1.wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:17:42 -05:00
Evan Quan
88810f907b
drm/amd/powerplay: get bootup fclk value
...
This is available with firmwareinfo table v3.2 or later.
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Kevin Wang <kevin1.wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:17:35 -05:00
Evan Quan
9aef809b5c
drm/amd/powerplay: expose supported clock domains only through sysfs
...
Do not expose those unsupported clock domains through sysfs on
Arcturus.
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Kevin Wang <kevin1.wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:17:28 -05:00
Evan Quan
d80ead63a8
drm/amd/powerplay: update Arcturus smc fw and driver interface header
...
Update smc fw and driver interface header.
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Kevin Wang <kevin1.wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:17:21 -05:00
Kevin Wang
03dce35deb
drm/amd/powerplay: remove duplicate macro smu_get_uclk_dpm_states in amdgpu_smu.h
...
remove duplicate macro smu_get_uclk_dpm_states in amdgpu_smu.h
"
#define smu_get_uclk_dpm_states(smu, clocks_in_khz, num_states) \
((smu)->ppt_funcs->get_uclk_dpm_states ? (smu)->ppt_funcs->get_uclk_dpm_states((smu), (clocks_in_khz), (num_states)) : 0)
#define smu_get_max_sustainable_clocks_by_dc(smu, max_clocks) \
((smu)->funcs->get_max_sustainable_clocks_by_dc ? (smu)->funcs->get_max_sustainable_clocks_by_dc((smu), (max_clocks)) : 0)
#define smu_get_uclk_dpm_states(smu, clocks_in_khz, num_states) \
((smu)->ppt_funcs->get_uclk_dpm_states ? (smu)->ppt_funcs->get_uclk_dpm_states((smu), (clocks_in_khz), (num_states)) : 0)
"
Signed-off-by: Kevin Wang <kevin1.wang@amd.com >
Reviewed-by: Huang Rui <ray.huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:17:14 -05:00
Kevin Wang
ebecc6c48f
drm/amd/powerplay: fix variable type errors in smu_v11_0_setup_pptable
...
fix size type errors, from uint32_t to uint16_t.
it will cause only initializes the highest 16 bits in
smu_get_atom_data_table function.
bug report:
This fixes the following static checker warning.
drivers/gpu/drm/amd/amdgpu/../powerplay/smu_v11_0.c:390 smu_v11_0_setup_pptable()
warn: passing casted pointer '&size' to 'smu_get_atom_data_table()' 32 vs 16.
Signed-off-by: Kevin Wang <kevin1.wang@amd.com >
Reported-by: Dan Carpenter <dan.carpenter@oracle.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:17:07 -05:00
Kevin Wang
9744214073
drm/amd/powerplay: add smu_smc_read_sensor support for arcturus
...
the bellow patch refine the sensor read sequence,
but missed to add arcuturs support. (arcuturs_ppt.c)
it will cause some sensor is not supported in arcturus.
drm/amd/powerplay: change smu_read_sensor sequence in smu
Signed-off-by: Kevin Wang <kevin1.wang@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:16:59 -05:00
Christophe JAILLET
6a9d8de7e9
drm/amdgpu: Fix a typo in the include header guard of 'navi12_ip_offset.h'
...
'_navi10_ip_offset_HEADER' is already used in 'navi10_ip_offset.h', so use
'_navi12_ip_offset_HEADER' instead here.
Reviewed-by: Xiaojie Yuan <xiaojie.yuan@amd.com >
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:16:55 -05:00
Tianci.Yin
828d6fde7f
drm/amdgpu/psp: move TMR to cpu invisible vram region
...
so that more visible vram can be available for umd.
Reviewed-by: Christian König <christian.koenig@amd.com >.
Signed-off-by: Tianci.Yin <tianci.yin@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:16:45 -05:00
Xiaojie Yuan
50e275e880
drm/amdgpu: remove redundant argument for psp_funcs::cmd_submit callback
...
Signed-off-by: Xiaojie Yuan <xiaojie.yuan@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:16:37 -05:00
Yong Zhao
c181159a5b
drm/amdkfd: Fill the name field in node topology with asic name v2
...
The name field in node topology has not been used. We re-purpose it to
hold the asic name, which can be queried by user space applications
through sysfs.
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com >
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:16:28 -05:00
Dave Airlie
c011b93c1a
Merge tag 'du-next-20190816' of git://linuxtv.org/pinchartl/media into drm-next
...
- R-Car DU fixes
- Misc. DRM cleanups
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190816133500.GJ5020@pendragon.ideasonboard.com
2019-08-22 13:16:19 +10:00
Feifei Xu
51bfac71ca
drm/amdgpu: Set no-retry as default.
...
This is to improve performance.
Signed-off-by: Feifei Xu <Feifei.Xu@amd.com >
Tested-by: Candice Li <candice.li@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:16:18 -05:00
Xiaojie Yuan
c5fb912653
drm/amdgpu: add firmware header printing for psp fw loading (v2)
...
firmware header information is printed for direct fw loading but not
added for psp fw loading yet
v2: squash in warning fix (Alex)
Signed-off-by: Xiaojie Yuan <xiaojie.yuan@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:16:18 -05:00
Xiaojie Yuan
6c2243efa0
drm/amdgpu: fix debug level for ppt offset/size
...
Signed-off-by: Xiaojie Yuan <xiaojie.yuan@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:15:28 -05:00
Xiaojie Yuan
cc216214ac
drm/amdgpu: remove special autoload handling for navi12
...
s/r list in rlc firmware is ready, so remove the special autoload handling
Signed-off-by: Xiaojie Yuan <xiaojie.yuan@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:15:14 -05:00
Nicholas Kazlauskas
01c22997be
drm/amd/display: Calculate bpc based on max_requested_bpc
...
[Why]
The only place where state->max_bpc is updated on the connector is
at the start of atomic check during drm_atomic_connector_check. It
isn't updated when adding the connectors to the atomic state after
the fact. It also doesn't necessarily reflect the right value when
called in amdgpu during mode validation outside of atomic check.
This can cause the wrong bpc to be used even if the max_requested_bpc
is the correct value.
[How]
Don't rely on state->max_bpc reflecting the real bpc value and just
do the min(...) based on display info bpc and max_requested_bpc.
Fixes: 01933ba42d ("drm/amd/display: Use current connector state if NULL when checking bpc")
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com >
Reviewed-by: Leo Li <sunpeng.li@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 22:15:13 -05:00
Alex Deucher
b05f65d772
drm/amdgpu/gfx9: update pg_flags after determining if gfx off is possible
...
We need to set certain power gating flags after we determine
if the firmware version is sufficient to support gfxoff.
Previously we set the pg flags in early init, but we later
we might have disabled gfxoff if the firmware versions didn't
support it. Move adding the additional pg flags after we
determine whether or not to support gfxoff.
Fixes: 005440066f ("drm/amdgpu: enable gfxoff again on raven series (v2)")
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com >
Tested-by: Tom St Denis <tom.stdenis@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com >
2019-08-21 22:15:13 -05:00
Dave Airlie
1e85e6cad2
Merge tag 'drm-fixes-5.3-2019-08-21' of git://people.freedesktop.org/~agd5f/linux into drm-fixes
...
drm-fixes-5.3-2019-08-21:
amdgpu:
- Fix gfxoff logic on RV
- Powerplay fixes
- Fix a possible memory leak in CS ioctl
- bpc fix for display
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Alex Deucher <alexdeucher@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190822021022.3356-1-alexander.deucher@amd.com
2019-08-22 12:59:11 +10:00
Dave Airlie
2ba552b29b
Merge tag 'mediatek-drm-fixes-5.3' of https://github.com/ckhu-mediatek/linux.git-tags into drm-fixes
...
Mediatek memory leak drm fix for Linux 5.3
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: CK Hu <ck.hu@mediatek.com >
Link: https://patchwork.freedesktop.org/patch/msgid/1566264270.30493.4.camel@mtksdaap41
2019-08-22 12:56:55 +10:00
Jason Gunthorpe
daa138a58c
Merge branch 'odp_fixes' into hmm.git
...
From rdma.git
Jason Gunthorpe says:
====================
This is a collection of general cleanups for ODP to clarify some of the
flows around umem creation and use of the interval tree.
====================
The branch is based on v5.3-rc5 due to dependencies, and is being taken
into hmm.git due to dependencies in the next patches.
* odp_fixes:
RDMA/mlx5: Use odp instead of mr->umem in pagefault_mr
RDMA/mlx5: Use ib_umem_start instead of umem.address
RDMA/core: Make invalidate_range a device operation
RDMA/odp: Use kvcalloc for the dma_list and page_list
RDMA/odp: Check for overflow when computing the umem_odp end
RDMA/odp: Provide ib_umem_odp_release() to undo the allocs
RDMA/odp: Split creating a umem_odp from ib_umem_get
RDMA/odp: Make the three ways to create a umem_odp clear
RMDA/odp: Consolidate umem_odp initialization
RDMA/odp: Make it clearer when a umem is an implicit ODP umem
RDMA/odp: Iterate over the whole rbtree directly
RDMA/odp: Use the common interval tree library instead of generic
RDMA/mlx5: Fix MR npages calculation for IB_ACCESS_HUGETLB
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2019-08-21 20:58:18 -03:00
Nicholas Kazlauskas
ec6e491353
drm/amd/display: Calculate bpc based on max_requested_bpc
...
[Why]
The only place where state->max_bpc is updated on the connector is
at the start of atomic check during drm_atomic_connector_check. It
isn't updated when adding the connectors to the atomic state after
the fact. It also doesn't necessarily reflect the right value when
called in amdgpu during mode validation outside of atomic check.
This can cause the wrong bpc to be used even if the max_requested_bpc
is the correct value.
[How]
Don't rely on state->max_bpc reflecting the real bpc value and just
do the min(...) based on display info bpc and max_requested_bpc.
Fixes: 01933ba42d ("drm/amd/display: Use current connector state if NULL when checking bpc")
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com >
Reviewed-by: Leo Li <sunpeng.li@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 17:33:32 -05:00
Nicolai Hähnle
1a701ea924
drm/amdgpu: prevent memory leaks in AMDGPU_CS ioctl
...
Error out if the AMDGPU_CS ioctl is called with multiple SYNCOBJ_OUT and/or
TIMELINE_SIGNAL chunks, since otherwise the last chunk wins while the
allocated array as well as the reference counts of sync objects are leaked.
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 17:32:39 -05:00
Kenneth Feng
221a2bdbd5
drm/amd/amdgpu: disable MMHUB PG for navi10
...
Disable MMHUB PG for navi10 according to the production requirement.
Signed-off-by: Kenneth Feng <kenneth.feng@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Kevin Wang <kevin1.wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 17:32:24 -05:00
Kevin Wang
155f85c0d5
drm/amd/powerplay: remove duplicate macro smu_get_uclk_dpm_states in amdgpu_smu.h
...
remove duplicate macro smu_get_uclk_dpm_states in amdgpu_smu.h
"
#define smu_get_uclk_dpm_states(smu, clocks_in_khz, num_states) \
((smu)->ppt_funcs->get_uclk_dpm_states ? (smu)->ppt_funcs->get_uclk_dpm_states((smu), (clocks_in_khz), (num_states)) : 0)
#define smu_get_max_sustainable_clocks_by_dc(smu, max_clocks) \
((smu)->funcs->get_max_sustainable_clocks_by_dc ? (smu)->funcs->get_max_sustainable_clocks_by_dc((smu), (max_clocks)) : 0)
#define smu_get_uclk_dpm_states(smu, clocks_in_khz, num_states) \
((smu)->ppt_funcs->get_uclk_dpm_states ? (smu)->ppt_funcs->get_uclk_dpm_states((smu), (clocks_in_khz), (num_states)) : 0)
"
Signed-off-by: Kevin Wang <kevin1.wang@amd.com >
Reviewed-by: Huang Rui <ray.huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 17:31:12 -05:00
Kevin Wang
00430144ff
drm/amd/powerplay: fix variable type errors in smu_v11_0_setup_pptable
...
fix size type errors, from uint32_t to uint16_t.
it will cause only initializes the highest 16 bits in
smu_get_atom_data_table function.
bug report:
This fixes the following static checker warning.
drivers/gpu/drm/amd/amdgpu/../powerplay/smu_v11_0.c:390 smu_v11_0_setup_pptable()
warn: passing casted pointer '&size' to 'smu_get_atom_data_table()' 32 vs 16.
Signed-off-by: Kevin Wang <kevin1.wang@amd.com >
Reported-by: Dan Carpenter <dan.carpenter@oracle.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-08-21 17:30:45 -05:00
Alex Deucher
98f58ada2d
drm/amdgpu/gfx9: update pg_flags after determining if gfx off is possible
...
We need to set certain power gating flags after we determine
if the firmware version is sufficient to support gfxoff.
Previously we set the pg flags in early init, but we later
we might have disabled gfxoff if the firmware versions didn't
support it. Move adding the additional pg flags after we
determine whether or not to support gfxoff.
Fixes: 005440066f ("drm/amdgpu: enable gfxoff again on raven series (v2)")
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com >
Tested-by: Tom St Denis <tom.stdenis@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com >
Cc: stable@vger.kernel.org
2019-08-21 17:29:49 -05:00
Chris Wilson
8e40983dec
drm/i915/selftests: Fixup a couple of missing serialisation with vma
...
In commit 70d6894d14 ("drm/i915: Serialize against vma moves")
I managed to miss a couple of i915_vma_move_to_active() that had not
serialised against an async vma pinning. Add the missing
i915_request_await.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Matthew Auld <matthew.auld@intel.com >
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190821193851.18232-1-chris@chris-wilson.co.uk
2019-08-21 22:21:57 +01:00
Xu YiPing
89a565dba1
drm: kirin: Move ade drm init to kirin drm drv
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch renames ade_data to
kirin_drm_private, and moves crtc_init and plane_init to
kirin drm drv too. Now that they are generic the functions
can be shared between the kirin620 and (to be added later)
kirin960 specific support code.
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
[jstultz: Reworded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-26-john.stultz@linaro.org
2019-08-21 19:15:46 +02:00
Xu YiPing
28cd05eee4
drm: kirin: Pass driver data to crtc init and plane init
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch changes the code
via a passed in driver_data pointer, rather than hardcoding
them via ade_driver_data variable.
This will allow those funcitons to be later moved to the
generic kirin_drm_drv.c using alternative driver_data structures
that support other hardware.
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
[jstultz: Reworded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-25-john.stultz@linaro.org
2019-08-21 19:15:45 +02:00
Xu YiPing
2e89b4fbca
drm: kirin: Add alloc_hw_ctx/clean_hw_ctx ops in driver data
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch changes the
alloc/clean_hw_ctx functions to be called via driver_data
specific funciton pointers.
This will allow the ade_drm_init to later be made generic and
moved to kirin_drm_drv.c
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
[jstultz: Reworded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-24-john.stultz@linaro.org
2019-08-21 19:15:45 +02:00
Xu YiPing
27dd04a591
drm: kirin: Make driver_data variable non-global
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch changes the driver_data
value to not be a global variable. Instead the driver_data value
is accessed via the of_device_get_match_data() when needed.
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
[jstultz: Reworded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-23-john.stultz@linaro.org
2019-08-21 19:15:44 +02:00
Xu YiPing
a8c8af59e4
drm: kirin: Fix dev->driver_data setting
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch changes the
dev->driver_data to point to a drm_device, not ade_data.
Thus we set the driver data to drm device after alloc.
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
[jstultz: Reworded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-22-john.stultz@linaro.org
2019-08-21 19:15:44 +02:00
Xu YiPing
a51735befe
drm: kirin: Rename plane_init and crtc_init
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch renames
ade_crtc/plane_init kirin_plane/crtc_init, as they will later be
moved to kirin drm drv and shared with the kirin960 hardware
support.
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
[jstultz: reworded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-21-john.stultz@linaro.org
2019-08-21 19:15:43 +02:00
Xu YiPing
d606dc9a63
drm: kirin: Add register connect helper functions in drm init
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch adds a flag to the
device specific driver data so that we can conditionally
register the connectors at init.
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
[jstultz: reworded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-20-john.stultz@linaro.org
2019-08-21 19:15:42 +02:00
Xu YiPing
1053d01864
drm: kirin: Move drm driver to driver data
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch moves the drm_driver
structure to be under device specific driver data.
This will allow us to more easily add support for kirin960
hardware with later patches.
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
[jstultz: Reworded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-19-john.stultz@linaro.org
2019-08-21 19:15:42 +02:00
Xu YiPing
49af461139
drm: kirin: Move config max_width and max_height to driver data
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch moves the max_width
and max_height values used in kirin_drm_mode_config_inita to
hardware specific driver data.
This will make it easier to add support for new devices
via a new kirin_drm_data structure.
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
[jstultz: reworded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-18-john.stultz@linaro.org
2019-08-21 19:15:41 +02:00
Xu YiPing
48fa7c17d1
drm: kirin: Move plane number and primay plane in driver data
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch moves the number of
planes and the primary plane value to the kirin_drm_data
structure
This will make it easier to add support for new devices
via a new kirin_drm_data structure.
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-17-john.stultz@linaro.org
2019-08-21 19:15:40 +02:00
Xu YiPing
bdaf419efe
drm: kirin: Move mode config function to driver_data
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch moves the mode config
initialization values into the kirin_drm_data structure.
This will make it easier to add support for new devices
via a new kirin_drm_data structure.
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-16-john.stultz@linaro.org
2019-08-21 19:15:40 +02:00
Xu YiPing
e200d8eb39
drm: kirin: Move channel formats to driver data
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch moves the channel
format arrays into the kirin_drm_data structure.
This will make it easier to add support for new devices
via a new kirin_drm_data structure.
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
[jstultz: reworded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-15-john.stultz@linaro.org
2019-08-21 19:15:39 +02:00
Xu YiPing
5fb2e411be
drm: kirin: Move ade crtc/plane help functions to driver_data
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch moves the crtc
and plane funcs/helper_funcs to the struct kirin_drm_data.
This will make it easier to add support for new devices
via a new kirin_drm_data structure.
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
[jstultz: reworded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-14-john.stultz@linaro.org
2019-08-21 19:15:39 +02:00
Xu YiPing
7903ba41e9
drm: kirin: Reanme dc_ops to kirin_drm_data
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch renames the
struct kirin_dc_ops to struct kirin_drm_data and cleans
up the related variable names.
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
[jstultz: reworded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-13-john.stultz@linaro.org
2019-08-21 19:15:38 +02:00
Xu YiPing
c11a03f6eb
drm: kirin: Move kirin_crtc, kirin_plane, kirin_format to kirin_drm_drv.h
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch moves some shared
structures and helpers to the common kirin_drm_drv.h
These structures will later used by both kirin620 and
future kirin960 driver
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
[jstultz: reworded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-12-john.stultz@linaro.org
2019-08-21 19:15:37 +02:00
John Stultz
529277121b
drm: kirin: Move workqueue to ade_hw_ctx structure
...
The workqueue used to reset the display when we hit an LDI
underflow error is ADE specific, so since this patch series
works to make the kirin_crtc structure more generic, move the
workqueue to the ade_hw_ctx structure instead.
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-11-john.stultz@linaro.org
2019-08-21 19:15:36 +02:00
Xu YiPing
36f8d22dbc
drm: kirin: Move request irq handle in ade hw ctx alloc
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch modifies the
initialization routines so the devm_request_irq() function
is called as part of the allocation function.
This will be needed in the future when we will have different
allocation functions to allocate hardware specific hw_ctx
structures, which will setup the vblank irq differently.
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
[jstultz: reworded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-10-john.stultz@linaro.org
2019-08-21 19:15:36 +02:00
Xu YiPing
43774b0eed
drm: kirin: Dynamically allocate the hw_ctx
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch modifies the
initialization function to dynamically allocate the ade_hw_ctx
structure previously kept as part of struct ade_data.
This is done so that later we can have the hw_ctx point to
hardware revision specific ctx structures.
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
[jstultz: reworded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-9-john.stultz@linaro.org
2019-08-21 19:15:36 +02:00
Xu YiPing
ada7f67da9
drm: kirin: Rename ade_crtc to kirin_crtc
...
As part of refactoring the kirin driver to better support
different hardware revisions, this patch renames the
struct ade_crtc to kirin_crtc.
The struct kirin_crtc will later used by both kirin620 and
future kirin960 driver, and will be moved to a common
kirin_drm_drv.h in a future patch
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel <dri-devel@lists.freedesktop.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Xinliang Liu <z.liuxinliang@hisilicon.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com >
[jstultz: reworded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-8-john.stultz@linaro.org
2019-08-21 19:15:35 +02:00