Separate JPEG from VCN
Subsystems (2)
cover Separate JPEG from VCN
From JPEG2.0, JPEG is a separated IP block, and has it own PG/CG, and power management. It doesn't require FW, so indepedent from FW loading as well.
Patch 1-4: Separate JPEG1.0 from SW wise, since JPEG1.0 is still combined with VCN1.0 esp. in power management;
Patch 5-10: Separate JPEG2.0 as an independent IP with PG/CG; Patch 11-15: Add power management for JPEG of Navi1x and Renoir; Patch 16: Enable JPEG2.0;
Patch 17-20: Separate JPEG2.5 from VCN2.5;
Patch 21: Enable JPEG2.5
Leo Liu (21):
drm/amdgpu: add JPEG HW IP and SW structures drm/amdgpu: add amdgpu_jpeg and JPEG tests drm/amdgpu: separate JPEG1.0 code out from VCN1.0 drm/amdgpu: use the JPEG structure for general driver support drm/amdgpu: add JPEG IP block type
drm/amdgpu: add JPEG common functions to amdgpu_jpeg drm/amdgpu: add JPEG v2.0 function supports drm/amdgpu: remove unnecessary JPEG2.0 code from VCN2.0 drm/amdgpu: add JPEG PG and CG interface drm/amdgpu: add PG and CG for JPEG2.0 drm/amd/powerplay: add JPEG Powerplay interface drm/amd/powerplay: add JPEG power control for Navi1x drm/amd/powerplay: add Powergate JPEG for Renoir drm/amd/powerplay: add JPEG power control for Renoir drm/amd/powerplay: set JPEG to SMU dpm
drm/amdgpu: enable JPEG2.0 dpm
drm/amdgpu: add driver support for JPEG2.0 and above drm/amdgpu: enable JPEG2.0 for Navi1x and Renoir drm/amdgpu: move JPEG2.5 out from VCN2.5 drm/amdgpu: enable Arcturus CG for VCN and JPEG blocks drm/amdgpu: enable Arcturus JPEG2.5 block
drivers/gpu/drm/amd/amdgpu/Makefile | 8 +- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 5 + drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 215 +++++ drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h | 62 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 15 +- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 8 + drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 113 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 5 - drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c | 584 +++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.h | 32 + drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 827 ++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.h | 42 + drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 641 ++++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h | 29 + drivers/gpu/drm/amd/amdgpu/nv.c | 11 +- drivers/gpu/drm/amd/amdgpu/soc15.c | 10 +- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 481 +--------- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 496 +---------- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.h | 13 - drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 246 +----- drivers/gpu/drm/amd/include/amd_shared.h | 5 +- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 5 + .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 3 + drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h | 2 + drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 32 +- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 27 + drivers/gpu/drm/amd/powerplay/smu_internal.h | 4 + drivers/gpu/drm/amd/powerplay/smu_v12_0.c | 11 + 31 files changed, 2593 insertions(+), 1346 deletions(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.h create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.h create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/21 drm/amdgpu: add JPEG HW IP and SW structures
It will be used for JPEG IP 1.0, 2.0, 2.5 and later.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 5 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h | 46 ++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h
drivers/gpu/drm/amd/amdgpu/amdgpu.h +5 -0
@@ -69,6 +69,7 @@#include "amdgpu_uvd.h" #include "amdgpu_vce.h" #include "amdgpu_vcn.h" +#include "amdgpu_jpeg.h" #include "amdgpu_mn.h" #include "amdgpu_gmc.h" #include "amdgpu_gfx.h"
@@ -710,6 +711,7 @@ enum amd_hw_ip_block_type {MP1_HWIP ,UVD_HWIP ,VCN_HWIP =UVD_HWIP , +JPEG_HWIP =VCN_HWIP ,VCE_HWIP ,DF_HWIP , DCE_HWIP,
@@ -905,6 +907,9 @@ struct amdgpu_device {/* vcn */ struct amdgpu_vcn vcn; +/* jpeg */ +struct amdgpu_jpeg jpeg; +/* firmwares */ struct amdgpu_firmware firmware;
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h new file +46 -0
46 lines not on this page · raw message
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/21 drm/amdgpu: add amdgpu_jpeg and JPEG tests
In reply to a message not in the archiveIt will be used for all versions of JPEG eventually. Previous JPEG tests will be removed later since they are still used by JPEG2.x.
--- drivers/gpu/drm/amd/amdgpu/Makefile | 5 +- drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 135 +++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h | 3 + 3 files changed, 141 insertions(+), 2 deletions(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
drivers/gpu/drm/amd/amdgpu/Makefile +3 -2
@@ -147,12 +147,13 @@ amdgpu-y += \ vce_v3_0.o \ vce_v4_0.o -# add VCN block +# add VCN and JPEG block amdgpu-y += \ amdgpu_vcn.o \ vcn_v1_0.o \ vcn_v2_0.o \ - vcn_v2_5.o + vcn_v2_5.o \ + amdgpu_jpeg.o # add ATHUB block amdgpu-y += \
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c new file +135 -0
135 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h +3 -0
@@ -43,4 +43,7 @@ struct amdgpu_jpeg { unsigned harvest_config; }; +int amdgpu_jpeg_dec_ring_test_ring (struct amdgpu_ring *ring); +int amdgpu_jpeg_dec_ring_test_ib (struct amdgpu_ring *ring,long timeout); +#endif /*__AMDGPU_JPEG_H__*/
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/21 drm/amdgpu: separate JPEG1.0 code out from VCN1.0
In reply to a message not in the archiveFor VCN1.0, the separation is just in code wise, JPEG1.0 HW is still included in the VCN1.0 HW.
--- drivers/gpu/drm/amd/amdgpu/Makefile | 3 +- drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c | 584 +++++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.h | 32 ++ drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 481 +------------------- 4 files changed, 630 insertions(+), 470 deletions(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.h
drivers/gpu/drm/amd/amdgpu/Makefile +2 -1
@@ -153,7 +153,8 @@ amdgpu-y += \ vcn_v1_0.o \ vcn_v2_0.o \ vcn_v2_5.o \ - amdgpu_jpeg.o + amdgpu_jpeg.o \ + jpeg_v1_0.o # add ATHUB block amdgpu-y += \
drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c new file +584 -0
584 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* Copyright 2019 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +*/ + +#ifndef __JPEG_V1_0_H__ +#define __JPEG_V1_0_H__ + +int jpeg_v1_0_early_init (void *handle); +int jpeg_v1_0_sw_init (void *handle); +void jpeg_v1_0_sw_fini (void *handle); +void jpeg_v1_0_start (struct amdgpu_device *adev,int mode); + +#endif /*__JPEG_V1_0_H__*/
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +12 -469
570 lines not on this page · raw message
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/21 drm/amdgpu: use the JPEG structure for general driver support
In reply to a message not in the archiveJPEG1.0 will be functional along with VCN1.0
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 8 +++----- 3 files changed, 8 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +2 -2
@@ -169,10 +169,10 @@ static int amdgpu_ctx_init(struct amdgpu_device *adev, }break ;case AMDGPU_HW_IP_VCN_JPEG : -for (j =0 ; j < adev->vcn.num_vcn_inst; ++j) { +for (j =0 ; j < adev->jpeg.num_jpeg_inst; ++j) {if (adev->vcn.harvest_config & (1 << j))continue ; - rings[num_rings++] = &adev->vcn.inst[j].ring_jpeg; + rings[num_rings++] = &adev->jpeg.inst[j].ring_dec; }break ; }
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -3
@@ -401,11 +401,11 @@ static int amdgpu_hw_ip_info(struct amdgpu_device *adev,break ;case AMDGPU_HW_IP_VCN_JPEG : type =AMD_IP_BLOCK_TYPE_VCN ; -for (i =0 ; i < adev->vcn.num_vcn_inst; i++) { -if (adev->uvd.harvest_config & (1 << i)) +for (i =0 ; i < adev->jpeg.num_jpeg_inst; i++) { +if (adev->jpeg.harvest_config & (1 << i))continue ; -if (adev->vcn.inst[i].ring_jpeg.sched.ready) +if (adev->jpeg.inst[i].ring_dec.sched.ready) ++num_rings; } ib_start_alignment =16 ;
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +3 -5
@@ -212,8 +212,6 @@ int amdgpu_vcn_sw_fini(struct amdgpu_device *adev)for (i =0 ; i < adev->vcn.num_enc_rings; ++i)amdgpu_ring_fini (&adev->vcn.inst[j].ring_enc[i]); - -amdgpu_ring_fini (&adev->vcn.inst[j].ring_jpeg); }release_firmware (adev->vcn.fw);
@@ -306,7 +304,7 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work)else new_state.fw_based =VCN_DPG_STATE__UNPAUSE ; -if (amdgpu_fence_count_emitted (&adev->vcn.inst[j].ring_jpeg)) +if (amdgpu_fence_count_emitted (&adev->jpeg.inst[j].ring_dec)) new_state.jpeg =VCN_DPG_STATE__PAUSE ;else new_state.jpeg =VCN_DPG_STATE__UNPAUSE ;
@@ -314,7 +312,7 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work) adev->vcn.pause_dpg_mode (adev, &new_state); } - fence[j] +=amdgpu_fence_count_emitted (&adev->vcn.inst[j].ring_jpeg); + fence[j] +=amdgpu_fence_count_emitted (&adev->jpeg.inst[j].ring_dec); fence[j] +=amdgpu_fence_count_emitted (&adev->vcn.inst[j].ring_dec); fences += fence[j]; }
@@ -358,7 +356,7 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)else new_state.fw_based =VCN_DPG_STATE__UNPAUSE ; -if (amdgpu_fence_count_emitted (&adev->vcn.inst[ring->me].ring_jpeg)) +if (amdgpu_fence_count_emitted (&adev->jpeg.inst[ring->me].ring_dec)) new_state.jpeg =VCN_DPG_STATE__PAUSE ;else new_state.jpeg =VCN_DPG_STATE__UNPAUSE ;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/21 drm/amdgpu: add JPEG IP block type
In reply to a message not in the archiveFrom VCN2.0, JPEG2.0 is a separated IP block.
--- drivers/gpu/drm/amd/include/amd_shared.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/include/amd_shared.h +2 -1
@@ -53,7 +53,8 @@ enum amd_ip_block_type {AMD_IP_BLOCK_TYPE_VCE ,AMD_IP_BLOCK_TYPE_ACP ,AMD_IP_BLOCK_TYPE_VCN , -AMD_IP_BLOCK_TYPE_MES +AMD_IP_BLOCK_TYPE_MES , +AMD_IP_BLOCK_TYPE_JPEG }; enum amd_clockgating_state {
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/21 drm/amdgpu: add JPEG common functions to amdgpu_jpeg
In reply to a message not in the archiveThey will be used for JPEG2.0 and later.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 80 ++++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h | 10 +++ 2 files changed, 90 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c +80 -0
@@ -26,9 +26,89 @@#include "amdgpu.h" #include "amdgpu_jpeg.h" +#include "amdgpu_pm.h" #include "soc15d.h" #include "soc15_common.h" +#define JPEG_IDLE_TIMEOUT msecs_to_jiffies(1000) + +static void amdgpu_jpeg_idle_work_handler (struct work_struct *work); + +int amdgpu_jpeg_sw_init (struct amdgpu_device *adev) +{ +INIT_DELAYED_WORK (&adev->jpeg.idle_work, amdgpu_jpeg_idle_work_handler); + +return 0 ; +} + +int amdgpu_jpeg_sw_fini (struct amdgpu_device *adev) +{ +int i; + +cancel_delayed_work_sync (&adev->jpeg.idle_work); + +for (i =0 ; i < adev->jpeg.num_jpeg_inst; ++i) { +if (adev->jpeg.harvest_config & (1 << i)) +continue ; + +amdgpu_ring_fini (&adev->jpeg.inst[i].ring_dec); + } + +return 0 ; +} + +int amdgpu_jpeg_suspend (struct amdgpu_device *adev) +{ +cancel_delayed_work_sync (&adev->jpeg.idle_work); + +return 0 ; +} + +int amdgpu_jpeg_resume (struct amdgpu_device *adev) +{ +return 0 ; +} + +static void amdgpu_jpeg_idle_work_handler (struct work_struct *work) +{ +struct amdgpu_device *adev = + container_of(work, struct amdgpu_device, jpeg.idle_work.work); +unsigned int fences =0 ; +unsigned int i; + +for (i =0 ; i < adev->jpeg.num_jpeg_inst; ++i) { +if (adev->jpeg.harvest_config & (1 << i)) +continue ; + + fences +=amdgpu_fence_count_emitted (&adev->jpeg.inst[i].ring_dec); + } + +if (fences ==0 ) { +amdgpu_gfx_off_ctrl (adev, true); +amdgpu_device_ip_set_powergating_state (adev,AMD_IP_BLOCK_TYPE_JPEG , +AMD_PG_STATE_GATE ); + }else { +schedule_delayed_work (&adev->jpeg.idle_work,JPEG_IDLE_TIMEOUT ); + } +} + +void amdgpu_jpeg_ring_begin_use (struct amdgpu_ring *ring) +{ +struct amdgpu_device *adev = ring->adev; +bool set_clocks = !cancel_delayed_work_sync (&adev->jpeg.idle_work); + +if (set_clocks) { +amdgpu_gfx_off_ctrl (adev, false); +amdgpu_device_ip_set_powergating_state (adev,AMD_IP_BLOCK_TYPE_JPEG , +AMD_PG_STATE_UNGATE ); + } +} + +void amdgpu_jpeg_ring_end_use (struct amdgpu_ring *ring) +{ +schedule_delayed_work (&ring->adev->jpeg.idle_work,JPEG_IDLE_TIMEOUT ); +} +int amdgpu_jpeg_dec_ring_test_ring (struct amdgpu_ring *ring) {struct amdgpu_device *adev = ring->adev;
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h +10 -0
@@ -41,8 +41,18 @@ struct amdgpu_jpeg {struct amdgpu_jpeg_inst inst[AMDGPU_MAX_JPEG_INSTANCES ];struct amdgpu_jpeg_reg internal;unsigned harvest_config; +struct delayed_work idle_work; +enum amd_powergating_state cur_state; }; +int amdgpu_jpeg_sw_init (struct amdgpu_device *adev); +int amdgpu_jpeg_sw_fini (struct amdgpu_device *adev); +int amdgpu_jpeg_suspend (struct amdgpu_device *adev); +int amdgpu_jpeg_resume (struct amdgpu_device *adev); + +void amdgpu_jpeg_ring_begin_use (struct amdgpu_ring *ring); +void amdgpu_jpeg_ring_end_use (struct amdgpu_ring *ring); +int amdgpu_jpeg_dec_ring_test_ring (struct amdgpu_ring *ring);int amdgpu_jpeg_dec_ring_test_ib (struct amdgpu_ring *ring,long timeout);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/21 drm/amdgpu: add JPEG v2.0 function supports
In reply to a message not in the archiveIt got separated from VCN2.0 with a new jpeg_v2_0_ip_block
--- drivers/gpu/drm/amd/amdgpu/Makefile | 3 +- drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 809 +++++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.h | 42 ++ 3 files changed, 853 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.h
drivers/gpu/drm/amd/amdgpu/Makefile +2 -1
@@ -154,7 +154,8 @@ amdgpu-y += \ vcn_v2_0.o \ vcn_v2_5.o \ amdgpu_jpeg.o \ - jpeg_v1_0.o + jpeg_v1_0.o \ + jpeg_v2_0.o # add ATHUB block amdgpu-y += \
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c new file +809 -0
809 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.h new file +42 -0
42 lines not on this page · raw message
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/21 drm/amdgpu: remove unnecessary JPEG2.0 code from VCN2.0
In reply to a message not in the archiveThey are no longer needed, using from JPEG2.0 instead.
--- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 260 +------------------------- 1 file changed, 3 insertions(+), 257 deletions(-)
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +3 -257
@@ -74,7 +74,6 @@static void vcn_v2_0_set_dec_ring_funcs (struct amdgpu_device *adev);static void vcn_v2_0_set_enc_ring_funcs (struct amdgpu_device *adev); -static void vcn_v2_0_set_jpeg_ring_funcs (struct amdgpu_device *adev);static void vcn_v2_0_set_irq_funcs (struct amdgpu_device *adev);static int vcn_v2_0_set_powergating_state (void *handle,enum amd_powergating_state state);
@@ -97,7 +96,6 @@ static int vcn_v2_0_early_init(void *handle)vcn_v2_0_set_dec_ring_funcs (adev);vcn_v2_0_set_enc_ring_funcs (adev); -vcn_v2_0_set_jpeg_ring_funcs (adev);vcn_v2_0_set_irq_funcs (adev);return 0 ;
@@ -132,12 +130,6 @@ static int vcn_v2_0_sw_init(void *handle)return r; } -/* VCN JPEG TRAP */ - r =amdgpu_irq_add_id (adev,SOC15_IH_CLIENTID_VCN , -VCN_2_0__SRCID__JPEG_DECODE , &adev->vcn.inst->irq); -if (r) -return r; - r =amdgpu_vcn_sw_init (adev);if (r)return r;
@@ -194,19 +186,8 @@ static int vcn_v2_0_sw_init(void *handle)return r; } - ring = &adev->vcn.inst->ring_jpeg; - ring->use_doorbell = true; - ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 <<1 ) +1 ; -sprintf (ring->name,"vcn_jpeg" ); - r =amdgpu_ring_init (adev, ring,512 , &adev->vcn.inst->irq,0 ); -if (r) -return r; - adev->vcn.pause_dpg_mode = vcn_v2_0_pause_dpg_mode; - adev->vcn.internal.jpeg_pitch = mmUVD_JPEG_PITCH_INTERNAL_OFFSET; - adev->vcn.inst->external.jpeg_pitch =SOC15_REG_OFFSET (UVD ,0 , mmUVD_JPEG_PITCH); -return 0 ; }
@@ -258,11 +239,6 @@ static int vcn_v2_0_hw_init(void *handle) goto done; } - ring = &adev->vcn.inst->ring_jpeg; - r =amdgpu_ring_test_helper (ring); -if (r) - goto done; - done:if (!r) DRM_INFO("VCN decode and encode initialized successfully(under %s).\n",
@@ -296,9 +272,6 @@ static int vcn_v2_0_hw_fini(void *handle) ring->sched.ready = false; } - ring = &adev->vcn.inst->ring_jpeg; - ring->sched.ready = false; -return 0 ; }
@@ -393,7 +366,6 @@ static void vcn_v2_0_mc_resume(struct amdgpu_device *adev)WREG32_SOC15 (UVD ,0 , mmUVD_VCPU_CACHE_SIZE2,AMDGPU_VCN_CONTEXT_SIZE );WREG32_SOC15 (UVD ,0 , mmUVD_GFX10_ADDR_CONFIG, adev->gfx.config.gb_addr_config); -WREG32_SOC15 (UVD ,0 , mmJPEG_DEC_GFX10_ADDR_CONFIG, adev->gfx.config.gb_addr_config); }static void vcn_v2_0_mc_resume_dpg_mode (struct amdgpu_device *adev,bool indirect)
@@ -647,129 +619,6 @@ static void vcn_v2_0_clock_gating_dpg_mode(struct amdgpu_device *adev, UVD, 0, mmUVD_SUVD_CGC_CTRL), 0, sram_sel, indirect); } -/** -* jpeg_v2_0_start - start JPEG block -* -* @adev: amdgpu_device pointer -* -* Setup and start the JPEG block -*/ -static int jpeg_v2_0_start (struct amdgpu_device *adev) -{ -struct amdgpu_ring *ring = &adev->vcn.inst->ring_jpeg; -uint32_t tmp; -int r =0 ; - -/* disable power gating */ - tmp =1 <<UVD_PGFSM_CONFIG__UVDJ_PWR_CONFIG__SHIFT ; -WREG32 (SOC15_REG_OFFSET (UVD ,0 , mmUVD_PGFSM_CONFIG), tmp); - -SOC15_WAIT_ON_RREG (VCN ,0 , - mmUVD_PGFSM_STATUS,UVD_PGFSM_STATUS_UVDJ_PWR_ON , -UVD_PGFSM_STATUS__UVDJ_PWR_STATUS_MASK , r); - -if (r) { -DRM_ERROR ("amdgpu: JPEG disable power gating failed\n" ); -return r; - } - -/* Removing the anti hang mechanism to indicate the UVDJ tile is ON */ - tmp =RREG32 (SOC15_REG_OFFSET (UVD ,0 , mmUVD_JPEG_POWER_STATUS)) & ~0x1 ; -WREG32 (SOC15_REG_OFFSET (UVD ,0 , mmUVD_JPEG_POWER_STATUS), tmp); - -/* JPEG disable CGC */ - tmp =RREG32_SOC15 (VCN ,0 , mmJPEG_CGC_CTRL); - tmp |=1 <<JPEG_CGC_CTRL__DYN_CLOCK_MODE__SHIFT ; - tmp |=1 <<JPEG_CGC_CTRL__CLK_GATE_DLY_TIMER__SHIFT ; - tmp |=4 <<JPEG_CGC_CTRL__CLK_OFF_DELAY__SHIFT ; -WREG32_SOC15 (VCN ,0 , mmJPEG_CGC_CTRL, tmp); - - tmp =RREG32_SOC15 (VCN ,0 , mmJPEG_CGC_GATE); - tmp &= ~(JPEG_CGC_GATE__JPEG_DEC_MASK - |JPEG_CGC_GATE__JPEG2_DEC_MASK - |JPEG_CGC_GATE__JPEG_ENC_MASK - |JPEG_CGC_GATE__JMCIF_MASK - |JPEG_CGC_GATE__JRBBM_MASK ); -WREG32_SOC15 (VCN ,0 , mmJPEG_CGC_GATE, tmp); - -/* enable JMI channel */ -WREG32_P (SOC15_REG_OFFSET (UVD ,0 , mmUVD_JMI_CNTL),0 , - ~UVD_JMI_CNTL__SOFT_RESET_MASK ); - -/* enable System Interrupt for JRBC */ -WREG32_P (SOC15_REG_OFFSET (VCN ,0 , mmJPEG_SYS_INT_EN), -JPEG_SYS_INT_EN__DJRBC_MASK , - ~JPEG_SYS_INT_EN__DJRBC_MASK ); - -WREG32_SOC15 (UVD ,0 , mmUVD_LMI_JRBC_RB_VMID,0 ); -WREG32_SOC15 (UVD ,0 , mmUVD_JRBC_RB_CNTL, (0x00000001L |0x00000002L )); -WREG32_SOC15 (UVD ,0 , mmUVD_LMI_JRBC_RB_64BIT_BAR_LOW, -lower_32_bits (ring->gpu_addr)); -WREG32_SOC15 (UVD ,0 , mmUVD_LMI_JRBC_RB_64BIT_BAR_HIGH, -upper_32_bits (ring->gpu_addr)); -WREG32_SOC15 (UVD ,0 , mmUVD_JRBC_RB_RPTR,0 ); -WREG32_SOC15 (UVD ,0 , mmUVD_JRBC_RB_WPTR,0 ); -WREG32_SOC15 (UVD ,0 , mmUVD_JRBC_RB_CNTL,0x00000002L ); -WREG32_SOC15 (UVD ,0 , mmUVD_JRBC_RB_SIZE, ring->ring_size /4 ); - ring->wptr =RREG32_SOC15 (UVD ,0 , mmUVD_JRBC_RB_WPTR); - -return 0 ; -} - -/** -* jpeg_v2_0_stop - stop JPEG block -* -* @adev: amdgpu_device pointer -* -* stop the JPEG block -*/ -static int jpeg_v2_0_stop (struct amdgpu_device *adev) -{ -uint32_t tmp; -int r =0 ; - -/* reset JMI */ -WREG32_P (SOC15_REG_OFFSET (UVD ,0 , mmUVD_JMI_CNTL), -UVD_JMI_CNTL__SOFT_RESET_MASK , - ~UVD_JMI_CNTL__SOFT_RESET_MASK ); - -/* enable JPEG CGC */ - tmp =RREG32_SOC15 (VCN ,0 , mmJPEG_CGC_CTRL); - tmp |=1 <<JPEG_CGC_CTRL__DYN_CLOCK_MODE__SHIFT ; - tmp |=1 <<JPEG_CGC_CTRL__CLK_GATE_DLY_TIMER__SHIFT ; - tmp |=4 <<JPEG_CGC_CTRL__CLK_OFF_DELAY__SHIFT ; -WREG32_SOC15 (VCN ,0 , mmJPEG_CGC_CTRL, tmp); - - - tmp =RREG32_SOC15 (VCN ,0 , mmJPEG_CGC_GATE); - tmp |= (JPEG_CGC_GATE__JPEG_DEC_MASK - |JPEG_CGC_GATE__JPEG2_DEC_MASK - |JPEG_CGC_GATE__JPEG_ENC_MASK - |JPEG_CGC_GATE__JMCIF_MASK - |JPEG_CGC_GATE__JRBBM_MASK ); -WREG32_SOC15 (VCN ,0 , mmJPEG_CGC_GATE, tmp); - -/* enable power gating */ - tmp =RREG32 (SOC15_REG_OFFSET (UVD ,0 , mmUVD_JPEG_POWER_STATUS)); - tmp &= ~UVD_JPEG_POWER_STATUS__JPEG_POWER_STATUS_MASK ; - tmp |=0x1 ;//UVD_JPEG_POWER_STATUS__JPEG_POWER_STATUS_TILES_OFF; -WREG32 (SOC15_REG_OFFSET (UVD ,0 , mmUVD_JPEG_POWER_STATUS), tmp); - - tmp =2 <<UVD_PGFSM_CONFIG__UVDJ_PWR_CONFIG__SHIFT ; -WREG32 (SOC15_REG_OFFSET (UVD ,0 , mmUVD_PGFSM_CONFIG), tmp); - -SOC15_WAIT_ON_RREG (VCN ,0 , mmUVD_PGFSM_STATUS, - (2 <<UVD_PGFSM_STATUS__UVDJ_PWR_STATUS__SHIFT ), -UVD_PGFSM_STATUS__UVDJ_PWR_STATUS_MASK , r); - -if (r) { -DRM_ERROR ("amdgpu: JPEG enable power gating failed\n" ); -return r; - } - -return r; -} -/** * vcn_v2_0_enable_clock_gating - enable VCN clock gating *
@@ -1052,12 +901,8 @@ static int vcn_v2_0_start(struct amdgpu_device *adev)if (adev->pm.dpm_enabled)amdgpu_dpm_enable_uvd (adev, true); -if (adev->pg_flags &AMD_PG_SUPPORT_VCN_DPG ) { - r =vcn_v2_0_start_dpg_mode (adev, adev->vcn.indirect_sram); -if (r) -return r; - goto jpeg; - } +if (adev->pg_flags &AMD_PG_SUPPORT_VCN_DPG ) +return vcn_v2_0_start_dpg_mode (adev, adev->vcn.indirect_sram);vcn_v2_0_disable_static_power_gating (adev);
@@ -1209,10 +1054,7 @@ static int vcn_v2_0_start(struct amdgpu_device *adev)WREG32_SOC15 (UVD ,0 , mmUVD_RB_BASE_HI2,upper_32_bits (ring->gpu_addr));WREG32_SOC15 (UVD ,0 , mmUVD_RB_SIZE2, ring->ring_size /4 ); -jpeg: - r =jpeg_v2_0_start (adev); - -return r; +return 0 ; }static int vcn_v2_0_stop_dpg_mode (struct amdgpu_device *adev)
@@ -1231,9 +1073,6 @@ static int vcn_v2_0_stop_dpg_mode(struct amdgpu_device *adev) tmp =RREG32_SOC15 (UVD ,0 , mmUVD_RB_WPTR2);SOC15_WAIT_ON_RREG (UVD ,0 , mmUVD_RB_RPTR2, tmp,0xFFFFFFFF , ret_code); - tmp =RREG32_SOC15 (UVD ,0 , mmUVD_JRBC_RB_WPTR); -SOC15_WAIT_ON_RREG (UVD ,0 , mmUVD_JRBC_RB_RPTR, tmp,0xFFFFFFFF , ret_code); - tmp =RREG32_SOC15 (UVD ,0 , mmUVD_RBC_RB_WPTR) &0x7FFFFFFF ;SOC15_WAIT_ON_RREG (UVD ,0 , mmUVD_RBC_RB_RPTR, tmp,0xFFFFFFFF , ret_code);
@@ -1252,10 +1091,6 @@ static int vcn_v2_0_stop(struct amdgpu_device *adev)uint32_t tmp;int r; - r =jpeg_v2_0_stop (adev); -if (r) -return r; -if (adev->pg_flags &AMD_PG_SUPPORT_VCN_DPG ) { r =vcn_v2_0_stop_dpg_mode (adev);if (r)
@@ -1781,56 +1616,6 @@ void vcn_v2_0_enc_ring_emit_wreg(struct amdgpu_ring *ring, uint32_t reg, uint32_amdgpu_ring_write (ring, val); } -/** -* vcn_v2_0_jpeg_ring_get_rptr - get read pointer -* -* @ring: amdgpu_ring pointer -* -* Returns the current hardware read pointer -*/ -static uint64_t vcn_v2_0_jpeg_ring_get_rptr (struct amdgpu_ring *ring) -{ -struct amdgpu_device *adev = ring->adev; - -return RREG32_SOC15 (UVD ,0 , mmUVD_JRBC_RB_RPTR); -} - -/** -* vcn_v2_0_jpeg_ring_get_wptr - get write pointer -* -* @ring: amdgpu_ring pointer -* -* Returns the current hardware write pointer -*/ -static uint64_t vcn_v2_0_jpeg_ring_get_wptr (struct amdgpu_ring *ring) -{ -struct amdgpu_device *adev = ring->adev; - -if (ring->use_doorbell) -return adev->wb.wb[ring->wptr_offs]; -else -return RREG32_SOC15 (UVD ,0 , mmUVD_JRBC_RB_WPTR); -} - -/** -* vcn_v2_0_jpeg_ring_set_wptr - set write pointer -* -* @ring: amdgpu_ring pointer -* -* Commits the write pointer to the hardware -*/ -static void vcn_v2_0_jpeg_ring_set_wptr (struct amdgpu_ring *ring) -{ -struct amdgpu_device *adev = ring->adev; - -if (ring->use_doorbell) { - adev->wb.wb[ring->wptr_offs] =lower_32_bits (ring->wptr); -WDOORBELL32 (ring->doorbell_index,lower_32_bits (ring->wptr)); - }else { -WREG32_SOC15 (UVD ,0 , mmUVD_JRBC_RB_WPTR,lower_32_bits (ring->wptr)); - } -} -/** * vcn_v2_0_jpeg_ring_insert_start - insert a start command *
@@ -2071,9 +1856,6 @@ static int vcn_v2_0_process_interrupt(struct amdgpu_device *adev,case VCN_2_0__SRCID__UVD_ENC_LOW_LATENCY :amdgpu_fence_process (&adev->vcn.inst->ring_enc[1 ]);break ; -case VCN_2_0__SRCID__JPEG_DECODE : -amdgpu_fence_process (&adev->vcn.inst->ring_jpeg); -break ;default :DRM_ERROR ("Unhandled interrupt: %d %d\n" , entry->src_id, entry->src_data[0 ]);
@@ -2219,36 +2001,6 @@ static const struct amdgpu_ring_funcs vcn_v2_0_enc_ring_vm_funcs = { .emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper, }; -static const struct amdgpu_ring_funcs vcn_v2_0_jpeg_ring_vm_funcs = { - .type =AMDGPU_RING_TYPE_VCN_JPEG , - .align_mask =0xf , - .vmhub =AMDGPU_MMHUB_0 , - .get_rptr = vcn_v2_0_jpeg_ring_get_rptr, - .get_wptr = vcn_v2_0_jpeg_ring_get_wptr, - .set_wptr = vcn_v2_0_jpeg_ring_set_wptr, - .emit_frame_size = -SOC15_FLUSH_GPU_TLB_NUM_WREG *6 + -SOC15_FLUSH_GPU_TLB_NUM_REG_WAIT *8 + -8 +/* vcn_v2_0_jpeg_ring_emit_vm_flush */ -18 +18 +/* vcn_v2_0_jpeg_ring_emit_fence x2 vm fence */ -8 +16 , - .emit_ib_size =22 ,/* vcn_v2_0_jpeg_ring_emit_ib */ - .emit_ib = vcn_v2_0_jpeg_ring_emit_ib, - .emit_fence = vcn_v2_0_jpeg_ring_emit_fence, - .emit_vm_flush = vcn_v2_0_jpeg_ring_emit_vm_flush, - .test_ring = amdgpu_vcn_jpeg_ring_test_ring, - .test_ib = amdgpu_vcn_jpeg_ring_test_ib, - .insert_nop = vcn_v2_0_jpeg_ring_nop, - .insert_start = vcn_v2_0_jpeg_ring_insert_start, - .insert_end = vcn_v2_0_jpeg_ring_insert_end, - .pad_ib = amdgpu_ring_generic_pad_ib, - .begin_use = amdgpu_vcn_ring_begin_use, - .end_use = amdgpu_vcn_ring_end_use, - .emit_wreg = vcn_v2_0_jpeg_ring_emit_wreg, - .emit_reg_wait = vcn_v2_0_jpeg_ring_emit_reg_wait, - .emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper, -}; -static void vcn_v2_0_set_dec_ring_funcs (struct amdgpu_device *adev) { adev->vcn.inst->ring_dec.funcs = &vcn_v2_0_dec_ring_vm_funcs;
@@ -2265,12 +2017,6 @@ static void vcn_v2_0_set_enc_ring_funcs(struct amdgpu_device *adev)DRM_INFO ("VCN encode is enabled in VM mode\n" ); } -static void vcn_v2_0_set_jpeg_ring_funcs (struct amdgpu_device *adev) -{ - adev->vcn.inst->ring_jpeg.funcs = &vcn_v2_0_jpeg_ring_vm_funcs; -DRM_INFO ("VCN jpeg decode is enabled in VM mode\n" ); -} -static const struct amdgpu_irq_src_funcs vcn_v2_0_irq_funcs = { .set = vcn_v2_0_set_interrupt_state, .process = vcn_v2_0_process_interrupt,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/21 drm/amdgpu: add JPEG PG and CG interface
In reply to a message not in the archiveFrom JPEG2.0, it will use its own PG/CG
--- drivers/gpu/drm/amd/include/amd_shared.h | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/include/amd_shared.h +2 -0
@@ -100,6 +100,7 @@ enum amd_powergating_state {#define AMD_CG_SUPPORT_IH_CG (1 << 27)#define AMD_CG_SUPPORT_ATHUB_LS (1 << 28)#define AMD_CG_SUPPORT_ATHUB_MGCG (1 << 29) +#define AMD_CG_SUPPORT_JPEG_MGCG (1 << 30)/* PG flags */ #define AMD_PG_SUPPORT_GFX_PG (1 << 0)#define AMD_PG_SUPPORT_GFX_SMG (1 << 1)
@@ -118,6 +119,7 @@ enum amd_powergating_state {#define AMD_PG_SUPPORT_VCN (1 << 14)#define AMD_PG_SUPPORT_VCN_DPG (1 << 15)#define AMD_PG_SUPPORT_ATHUB (1 << 16) +#define AMD_PG_SUPPORT_JPEG (1 << 17)enum PP_FEATURE_MASK {PP_SCLK_DPM_MASK =0x1 ,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/21 drm/amdgpu: add PG and CG for JPEG2.0
In reply to a message not in the archiveAnd enable them for Navi1x and Renoir
--- drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 62 +++++++++++++++----------- drivers/gpu/drm/amd/amdgpu/nv.c | 8 +++- drivers/gpu/drm/amd/amdgpu/soc15.c | 2 + 3 files changed, 45 insertions(+), 27 deletions(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c +36 -26
@@ -227,16 +227,18 @@ static int jpeg_v2_0_disable_power_gating(struct amdgpu_device *adev)uint32_t data;int r =0 ; - data =1 <<UVD_PGFSM_CONFIG__UVDJ_PWR_CONFIG__SHIFT ; -WREG32 (SOC15_REG_OFFSET (JPEG ,0 , mmUVD_PGFSM_CONFIG), data); - -SOC15_WAIT_ON_RREG (JPEG ,0 , - mmUVD_PGFSM_STATUS,UVD_PGFSM_STATUS_UVDJ_PWR_ON , -UVD_PGFSM_STATUS__UVDJ_PWR_STATUS_MASK , r); - -if (r) { -DRM_ERROR ("amdgpu: JPEG disable power gating failed\n" ); -return r; +if (adev->pg_flags &AMD_PG_SUPPORT_JPEG ) { + data =1 <<UVD_PGFSM_CONFIG__UVDJ_PWR_CONFIG__SHIFT ; +WREG32 (SOC15_REG_OFFSET (JPEG ,0 , mmUVD_PGFSM_CONFIG), data); + +SOC15_WAIT_ON_RREG (JPEG ,0 , + mmUVD_PGFSM_STATUS,UVD_PGFSM_STATUS_UVDJ_PWR_ON , +UVD_PGFSM_STATUS__UVDJ_PWR_STATUS_MASK , r); + +if (r) { +DRM_ERROR ("amdgpu: JPEG disable power gating failed\n" ); +return r; + } }/* Removing the anti hang mechanism to indicate the UVDJ tile is ON */
@@ -248,24 +250,26 @@ static int jpeg_v2_0_disable_power_gating(struct amdgpu_device *adev)static int jpeg_v2_0_enable_power_gating (struct amdgpu_device * adev) { -uint32_t data; -int r =0 ; +if (adev->pg_flags &AMD_PG_SUPPORT_JPEG ) { +uint32_t data; +int r =0 ; - data =RREG32 (SOC15_REG_OFFSET (JPEG ,0 , mmUVD_JPEG_POWER_STATUS)); - data &= ~UVD_JPEG_POWER_STATUS__JPEG_POWER_STATUS_MASK ; - data |=0x1 ;//UVD_JPEG_POWER_STATUS__JPEG_POWER_STATUS_TILES_OFF; -WREG32 (SOC15_REG_OFFSET (JPEG ,0 , mmUVD_JPEG_POWER_STATUS), data); + data =RREG32 (SOC15_REG_OFFSET (JPEG ,0 , mmUVD_JPEG_POWER_STATUS)); + data &= ~UVD_JPEG_POWER_STATUS__JPEG_POWER_STATUS_MASK ; + data |=0x1 ;//UVD_JPEG_POWER_STATUS__JPEG_POWER_STATUS_TILES_OFF; +WREG32 (SOC15_REG_OFFSET (JPEG ,0 , mmUVD_JPEG_POWER_STATUS), data); - data =2 <<UVD_PGFSM_CONFIG__UVDJ_PWR_CONFIG__SHIFT ; -WREG32 (SOC15_REG_OFFSET (JPEG ,0 , mmUVD_PGFSM_CONFIG), data); + data =2 <<UVD_PGFSM_CONFIG__UVDJ_PWR_CONFIG__SHIFT ; +WREG32 (SOC15_REG_OFFSET (JPEG ,0 , mmUVD_PGFSM_CONFIG), data); -SOC15_WAIT_ON_RREG (JPEG ,0 , mmUVD_PGFSM_STATUS, - (2 <<UVD_PGFSM_STATUS__UVDJ_PWR_STATUS__SHIFT ), -UVD_PGFSM_STATUS__UVDJ_PWR_STATUS_MASK , r); +SOC15_WAIT_ON_RREG (JPEG ,0 , mmUVD_PGFSM_STATUS, + (2 <<UVD_PGFSM_STATUS__UVDJ_PWR_STATUS__SHIFT ), +UVD_PGFSM_STATUS__UVDJ_PWR_STATUS_MASK , r); -if (r) { -DRM_ERROR ("amdgpu: JPEG enable power gating failed\n" ); -return r; +if (r) { +DRM_ERROR ("amdgpu: JPEG enable power gating failed\n" ); +return r; + } }return 0 ;
@@ -276,7 +280,10 @@ static void jpeg_v2_0_disable_clock_gating(struct amdgpu_device* adev)uint32_t data; data =RREG32_SOC15 (JPEG ,0 , mmJPEG_CGC_CTRL); - data |=1 <<JPEG_CGC_CTRL__DYN_CLOCK_MODE__SHIFT ; +if (adev->cg_flags &AMD_CG_SUPPORT_JPEG_MGCG ) + data |=1 <<JPEG_CGC_CTRL__DYN_CLOCK_MODE__SHIFT ; +else + data &= ~JPEG_CGC_CTRL__DYN_CLOCK_MODE__SHIFT ; data |=1 <<JPEG_CGC_CTRL__CLK_GATE_DLY_TIMER__SHIFT ; data |=4 <<JPEG_CGC_CTRL__CLK_OFF_DELAY__SHIFT ;
@@ -296,7 +303,10 @@ static void jpeg_v2_0_enable_clock_gating(struct amdgpu_device* adev)uint32_t data; data =RREG32_SOC15 (JPEG ,0 , mmJPEG_CGC_CTRL); - data |=1 <<JPEG_CGC_CTRL__DYN_CLOCK_MODE__SHIFT ; +if (adev->cg_flags &AMD_CG_SUPPORT_JPEG_MGCG ) + data |=1 <<JPEG_CGC_CTRL__DYN_CLOCK_MODE__SHIFT ; +else + data |=0 <<JPEG_CGC_CTRL__DYN_CLOCK_MODE__SHIFT ; data |=1 <<JPEG_CGC_CTRL__CLK_GATE_DLY_TIMER__SHIFT ; data |=4 <<JPEG_CGC_CTRL__CLK_OFF_DELAY__SHIFT ;
drivers/gpu/drm/amd/amdgpu/nv.c +7 -1
@@ -636,10 +636,12 @@ static int nv_common_early_init(void *handle)AMD_CG_SUPPORT_ATHUB_MGCG |AMD_CG_SUPPORT_ATHUB_LS |AMD_CG_SUPPORT_VCN_MGCG | +AMD_CG_SUPPORT_JPEG_MGCG |AMD_CG_SUPPORT_BIF_MGCG |AMD_CG_SUPPORT_BIF_LS ; adev->pg_flags =AMD_PG_SUPPORT_VCN |AMD_PG_SUPPORT_VCN_DPG | +AMD_PG_SUPPORT_JPEG |AMD_PG_SUPPORT_ATHUB ; adev->external_rev_id = adev->rev_id +0x1 ;break ;
@@ -656,9 +658,11 @@ static int nv_common_early_init(void *handle)AMD_CG_SUPPORT_ATHUB_MGCG |AMD_CG_SUPPORT_ATHUB_LS |AMD_CG_SUPPORT_VCN_MGCG | +AMD_CG_SUPPORT_JPEG_MGCG |AMD_CG_SUPPORT_BIF_MGCG |AMD_CG_SUPPORT_BIF_LS ; adev->pg_flags =AMD_PG_SUPPORT_VCN | +AMD_PG_SUPPORT_JPEG |AMD_PG_SUPPORT_VCN_DPG ; adev->external_rev_id = adev->rev_id +20 ;break ;
@@ -677,9 +681,11 @@ static int nv_common_early_init(void *handle)AMD_CG_SUPPORT_MC_LS |AMD_CG_SUPPORT_ATHUB_MGCG |AMD_CG_SUPPORT_ATHUB_LS | -AMD_CG_SUPPORT_VCN_MGCG ; +AMD_CG_SUPPORT_VCN_MGCG | +AMD_CG_SUPPORT_JPEG_MGCG ; adev->pg_flags =AMD_PG_SUPPORT_VCN |AMD_PG_SUPPORT_VCN_DPG | +AMD_PG_SUPPORT_JPEG |AMD_PG_SUPPORT_ATHUB ; adev->external_rev_id = adev->rev_id +0xa ;break ;
drivers/gpu/drm/amd/amdgpu/soc15.c +2 -0
@@ -1229,12 +1229,14 @@ static int soc15_common_early_init(void *handle)AMD_CG_SUPPORT_HDP_LS |AMD_CG_SUPPORT_ROM_MGCG |AMD_CG_SUPPORT_VCN_MGCG | +AMD_CG_SUPPORT_JPEG_MGCG |AMD_CG_SUPPORT_IH_CG |AMD_CG_SUPPORT_ATHUB_LS |AMD_CG_SUPPORT_ATHUB_MGCG |AMD_CG_SUPPORT_DF_MGCG ; adev->pg_flags =AMD_PG_SUPPORT_SDMA |AMD_PG_SUPPORT_VCN | +AMD_PG_SUPPORT_JPEG |AMD_PG_SUPPORT_VCN_DPG ; adev->external_rev_id = adev->rev_id +0x91 ;break ;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/21 drm/amd/powerplay: add JPEG Powerplay interface
In reply to a message not in the archiveIt will be used for different SMU specific to HW
--- drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +3 -0
@@ -282,6 +282,7 @@ struct smu_power_gate {bool uvd_gated;bool vce_gated;bool vcn_gated; +bool jpeg_gated; };struct smu_power_context {
@@ -435,6 +436,7 @@ struct pptable_funcs {int (*set_power_profile_mode)(struct smu_context *smu,long *input,uint32_t size);int (*dpm_set_uvd_enable)(struct smu_context *smu,bool enable);int (*dpm_set_vce_enable)(struct smu_context *smu,bool enable); +int (*dpm_set_jpeg_enable)(struct smu_context *smu,bool enable);int (*read_sensor)(struct smu_context *smu,enum amd_pp_sensors sensor,void *data,uint32_t *size);int (*pre_display_config_changed)(struct smu_context *smu);
@@ -489,6 +491,7 @@ struct pptable_funcs {int (*check_fw_version)(struct smu_context *smu);int (*powergate_sdma)(struct smu_context *smu,bool gate);int (*powergate_vcn)(struct smu_context *smu,bool gate); +int (*powergate_jpeg)(struct smu_context *smu,bool gate);int (*set_gfx_cgpg)(struct smu_context *smu,bool enable);int (*write_pptable)(struct smu_context *smu);int (*set_min_dcef_deep_sleep)(struct smu_context *smu);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/21 drm/amd/powerplay: add JPEG power control for Navi1x
In reply to a message not in the archiveBy separating the JPEG power feature, and using its own PowerUp and PowerDown messages
--- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 32 ++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/navi10_ppt.c +30 -2
@@ -384,8 +384,10 @@ navi10_get_allowed_feature_mask(struct smu_context *smu, *(uint64_t *)feature_mask |=FEATURE_MASK (FEATURE_ATHUB_PG_BIT );if (smu->adev->pg_flags &AMD_PG_SUPPORT_VCN ) - *(uint64_t *)feature_mask |=FEATURE_MASK (FEATURE_VCN_PG_BIT ) - |FEATURE_MASK (FEATURE_JPEG_PG_BIT ); + *(uint64_t *)feature_mask |=FEATURE_MASK (FEATURE_VCN_PG_BIT ); + +if (smu->adev->pg_flags &AMD_PG_SUPPORT_JPEG ) + *(uint64_t *)feature_mask |=FEATURE_MASK (FEATURE_JPEG_PG_BIT );/* disable DPM UCLK and DS SOCCLK on navi10 A0 secure board */ if (is_asic_secure (smu)) {
@@ -665,6 +667,31 @@ static int navi10_dpm_set_uvd_enable(struct smu_context *smu, bool enable)return ret; } +static int navi10_dpm_set_jpeg_enable (struct smu_context *smu,bool enable) +{ +struct smu_power_context *smu_power = &smu->smu_power; +struct smu_power_gate *power_gate = &smu_power->power_gate; +int ret =0 ; + +if (enable) { +if (smu_feature_is_enabled (smu,SMU_FEATURE_JPEG_PG_BIT )) { + ret =smu_send_smc_msg_with_param (smu, SMU_MSG_PowerUpJpeg,1 ); +if (ret) +return ret; + } + power_gate->jpeg_gated = false; + }else { +if (smu_feature_is_enabled (smu,SMU_FEATURE_JPEG_PG_BIT )) { + ret =smu_send_smc_msg (smu, SMU_MSG_PowerDownJpeg); +if (ret) +return ret; + } + power_gate->jpeg_gated = true; + } + +return ret; +} +static int navi10_get_current_clk_freq_by_table (struct smu_context *smu,enum smu_clk_type clk_type,uint32_t *value)
@@ -1996,6 +2023,7 @@ static const struct pptable_funcs navi10_ppt_funcs = { .get_allowed_feature_mask = navi10_get_allowed_feature_mask, .set_default_dpm_table = navi10_set_default_dpm_table, .dpm_set_uvd_enable = navi10_dpm_set_uvd_enable, + .dpm_set_jpeg_enable = navi10_dpm_set_jpeg_enable, .get_current_clk_freq_by_table = navi10_get_current_clk_freq_by_table, .print_clk_levels = navi10_print_clk_levels, .force_clk_levels = navi10_force_clk_levels,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
RE: [PATCH 12/21] drm/amd/powerplay: add JPEG power control for Navi1x
For Navi10, SMU_MSG_PowerUpJpeg message does not need an argument.
Quoted 89 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Leo Liu
Sent: Wednesday, November 13, 2019 2:03 AM
To: [email protected]
Cc: Liu, Leo <[email protected]>
Subject: [PATCH 12/21] drm/amd/powerplay: add JPEG power control for Navi1xBy separating the JPEG power feature, and using its own PowerUp and PowerDown messages
Signed-off-by Leo Liu <[email protected]>--- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 32 ++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/powerplay/navi10_ppt.c +1
-2@@ -384,8 +384,10 @@ navi10_get_allowed_feature_mask(struct smu_context *smu, *(uint64_t *)feature_mask |=FEATURE_MASK (FEATURE_ATHUB_PG_BIT );if (smu->adev->pg_flags &AMD_PG_SUPPORT_VCN ) - *(uint64_t *)feature_mask |=FEATURE_MASK (FEATURE_VCN_PG_BIT ) - |FEATURE_MASK (FEATURE_JPEG_PG_BIT ); + *(uint64_t *)feature_mask |=
FEATURE_MASK(FEATURE_VCN_PG_BIT);drivers/gpu/drm/amd/powerplay/navi10_ppt.c +3
-0+ +if (smu->adev->pg_flags &AMD_PG_SUPPORT_JPEG ) + *(uint64_t *)feature_mask |=
FEATURE_MASK(FEATURE_JPEG_PG_BIT);drivers/gpu/drm/amd/powerplay/navi10_ppt.c +15
-0/* disable DPM UCLK and DS SOCCLK on navi10 A0 secure board */ if (is_asic_secure (smu)) {@@ -665,6 +667,31 @@ static int navi10_dpm_set_uvd_enable(struct smu_context *smu, bool enable) return ret; } +static int navi10_dpm_set_jpeg_enable (struct smu_context *smu,bool +enable) { +struct smu_power_context *smu_power = &smu->smu_power; +struct smu_power_gate *power_gate = &smu_power->power_gate; +int ret =0 ; + +if (enable) { +if (smu_feature_is_enabled (smu,SMU_FEATURE_JPEG_PG_BIT )) { + ret =smu_send_smc_msg_with_param (smu, SMU_MSG_PowerUpJpeg,1 ); +if (ret) +return ret; + } + power_gate->jpeg_gated = false; + }else { + if (smu_feature_is_enabled(smu,
SMU_FEATURE_JPEG_PG_BIT)) {drivers/gpu/drm/amd/powerplay/navi10_ppt.c +1
-0+ ret = smu_send_smc_msg(smu,
SMU_MSG_PowerDownJpeg);drivers/gpu/drm/amd/powerplay/navi10_ppt.c +10
-0+if (ret) +return ret; + } + power_gate->jpeg_gated = true; + } + +return ret; +} +static int navi10_get_current_clk_freq_by_table (struct smu_context *smu,enum smu_clk_type clk_type,uint32_t *value)@@ -1996,6 +2023,7 @@ static const struct pptable_funcs navi10_ppt_funcs = { .get_allowed_feature_mask = navi10_get_allowed_feature_mask, .set_default_dpm_table = navi10_set_default_dpm_table, .dpm_set_uvd_enable = navi10_dpm_set_uvd_enable, + .dpm_set_jpeg_enable = navi10_dpm_set_jpeg_enable, .get_current_clk_freq_by_table = navi10_get_current_clk_freq_by_table,drivers/gpu/drm/amd/powerplay/navi10_ppt.c +0
-1.print_clk_levels = navi10_print_clk_levels, .force_clk_levels = navi10_force_clk_levels, --2.17.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): MN2PR12MB334438FF2957ED7C7C8E226FE4760-rweVpJHSKToDMgCC8P//[email protected]
Re: [PATCH 12/21] drm/amd/powerplay: add JPEG power control for Navi1x
Quoted 1 line · Evan
For Navi10,
SMU_MSG_PowerUpJpegmessage does not need an argument.
The fixes for this and others will be in v2. Thanks for pointing this out.
Regards,
Leo
Quoted 90 lines
Quoted 90 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Leo Liu
Sent: Wednesday, November 13, 2019 2:03 AM
To: [email protected]
Cc: Liu, Leo <[email protected]>
Subject: [PATCH 12/21] drm/amd/powerplay: add JPEG power control for Navi1xBy separating the JPEG power feature, and using its own PowerUp and PowerDown messages
Signed-off-by Leo Liu <[email protected]>--- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 32 ++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/powerplay/navi10_ppt.c +1
-2@@ -384,8 +384,10 @@ navi10_get_allowed_feature_mask(struct smu_context *smu, *(uint64_t *)feature_mask |=FEATURE_MASK (FEATURE_ATHUB_PG_BIT );if (smu->adev->pg_flags &AMD_PG_SUPPORT_VCN ) - *(uint64_t *)feature_mask |=FEATURE_MASK (FEATURE_VCN_PG_BIT ) - |FEATURE_MASK (FEATURE_JPEG_PG_BIT ); + *(uint64_t *)feature_mask |=
FEATURE_MASK(FEATURE_VCN_PG_BIT);drivers/gpu/drm/amd/powerplay/navi10_ppt.c +3
-0+ +if (smu->adev->pg_flags &AMD_PG_SUPPORT_JPEG ) + *(uint64_t *)feature_mask |=
FEATURE_MASK(FEATURE_JPEG_PG_BIT);/* disable DPM UCLK and DS SOCCLK on navi10 A0 secure board */ if (
is_asic_secure(smu)) {drivers/gpu/drm/amd/powerplay/navi10_ppt.c +15
-0@@ -665,6 +667,31 @@ static int navi10_dpm_set_uvd_enable(struct smu_context *smu, bool enable) return ret; } +static int navi10_dpm_set_jpeg_enable (struct smu_context *smu,bool +enable) { +struct smu_power_context *smu_power = &smu->smu_power; +struct smu_power_gate *power_gate = &smu_power->power_gate; +int ret =0 ; + +if (enable) { +if (smu_feature_is_enabled (smu,SMU_FEATURE_JPEG_PG_BIT )) { + ret =smu_send_smc_msg_with_param (smu, SMU_MSG_PowerUpJpeg,1 ); +if (ret) +return ret; + } + power_gate->jpeg_gated = false; + }else { + if (smu_feature_is_enabled(smu,
SMU_FEATURE_JPEG_PG_BIT)) {drivers/gpu/drm/amd/powerplay/navi10_ppt.c +1
-0+ ret = smu_send_smc_msg(smu,
SMU_MSG_PowerDownJpeg);drivers/gpu/drm/amd/powerplay/navi10_ppt.c +10
-0+if (ret) +return ret; + } + power_gate->jpeg_gated = true; + } + +return ret; +} +static int navi10_get_current_clk_freq_by_table (struct smu_context *smu,enum smu_clk_type clk_type,uint32_t *value)@@ -1996,6 +2023,7 @@ static const struct pptable_funcs navi10_ppt_funcs = { .get_allowed_feature_mask = navi10_get_allowed_feature_mask, .set_default_dpm_table = navi10_set_default_dpm_table, .dpm_set_uvd_enable = navi10_dpm_set_uvd_enable, + .dpm_set_jpeg_enable = navi10_dpm_set_jpeg_enable, .get_current_clk_freq_by_table = navi10_get_current_clk_freq_by_table,.print_clk_levels =
navi10_print_clk_levels, .force_clk_levels =navi10_force_clk_levels,
--
2.17.1
Quoted 4 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/21 drm/amd/powerplay: add JPEG power control for Navi1x
In reply to a message not in the archiveBy separating the JPEG power feature, and using its own PowerUp and PowerDown messages
v2: remove PowerUpJpeg message argument
--- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 32 ++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/navi10_ppt.c +30 -2
@@ -384,8 +384,10 @@ navi10_get_allowed_feature_mask(struct smu_context *smu, *(uint64_t *)feature_mask |=FEATURE_MASK (FEATURE_ATHUB_PG_BIT );if (smu->adev->pg_flags &AMD_PG_SUPPORT_VCN ) - *(uint64_t *)feature_mask |=FEATURE_MASK (FEATURE_VCN_PG_BIT ) - |FEATURE_MASK (FEATURE_JPEG_PG_BIT ); + *(uint64_t *)feature_mask |=FEATURE_MASK (FEATURE_VCN_PG_BIT ); + +if (smu->adev->pg_flags &AMD_PG_SUPPORT_JPEG ) + *(uint64_t *)feature_mask |=FEATURE_MASK (FEATURE_JPEG_PG_BIT );/* disable DPM UCLK and DS SOCCLK on navi10 A0 secure board */ if (is_asic_secure (smu)) {
@@ -665,6 +667,31 @@ static int navi10_dpm_set_uvd_enable(struct smu_context *smu, bool enable)return ret; } +static int navi10_dpm_set_jpeg_enable (struct smu_context *smu,bool enable) +{ +struct smu_power_context *smu_power = &smu->smu_power; +struct smu_power_gate *power_gate = &smu_power->power_gate; +int ret =0 ; + +if (enable) { +if (smu_feature_is_enabled (smu,SMU_FEATURE_JPEG_PG_BIT )) { + ret =smu_send_smc_msg (smu, SMU_MSG_PowerUpJpeg); +if (ret) +return ret; + } + power_gate->jpeg_gated = false; + }else { +if (smu_feature_is_enabled (smu,SMU_FEATURE_JPEG_PG_BIT )) { + ret =smu_send_smc_msg (smu, SMU_MSG_PowerDownJpeg); +if (ret) +return ret; + } + power_gate->jpeg_gated = true; + } + +return ret; +} +static int navi10_get_current_clk_freq_by_table (struct smu_context *smu,enum smu_clk_type clk_type,uint32_t *value)
@@ -1996,6 +2023,7 @@ static const struct pptable_funcs navi10_ppt_funcs = { .get_allowed_feature_mask = navi10_get_allowed_feature_mask, .set_default_dpm_table = navi10_set_default_dpm_table, .dpm_set_uvd_enable = navi10_dpm_set_uvd_enable, + .dpm_set_jpeg_enable = navi10_dpm_set_jpeg_enable, .get_current_clk_freq_by_table = navi10_get_current_clk_freq_by_table, .print_clk_levels = navi10_print_clk_levels, .force_clk_levels = navi10_force_clk_levels,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/21 drm/amd/powerplay: add Powergate JPEG for Renoir
In reply to a message not in the archiveSimilar to SDMA, VCN etc.
--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 ++ drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h | 2 ++ drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 1 + drivers/gpu/drm/amd/powerplay/smu_internal.h | 2 ++ drivers/gpu/drm/amd/powerplay/smu_v12_0.c | 11 +++++++++++ 5 files changed, 18 insertions(+)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +2 -0
@@ -1229,6 +1229,7 @@ static int smu_hw_init(void *handle)if (adev->flags &AMD_IS_APU ) {smu_powergate_sdma (&adev->smu, false);smu_powergate_vcn (&adev->smu, false); +smu_powergate_jpeg (&adev->smu, false);smu_set_gfx_cgpg (&adev->smu, true); }
@@ -1287,6 +1288,7 @@ static int smu_hw_fini(void *handle)if (adev->flags &AMD_IS_APU ) {smu_powergate_sdma (&adev->smu, true);smu_powergate_vcn (&adev->smu, true); +smu_powergate_jpeg (&adev->smu, true); } ret =smu_stop_thermal_control (smu);
drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h +2 -0
@@ -58,6 +58,8 @@ int smu_v12_0_powergate_sdma(struct smu_context *smu, bool gate);int smu_v12_0_powergate_vcn (struct smu_context *smu,bool gate); +int smu_v12_0_powergate_jpeg (struct smu_context *smu,bool gate); +int smu_v12_0_set_gfx_cgpg (struct smu_context *smu,bool enable);uint32_t smu_v12_0_get_gfxoff_status (struct smu_context *smu);
drivers/gpu/drm/amd/powerplay/renoir_ppt.c +1 -0
@@ -697,6 +697,7 @@ static const struct pptable_funcs renoir_ppt_funcs = { .check_fw_version = smu_v12_0_check_fw_version, .powergate_sdma = smu_v12_0_powergate_sdma, .powergate_vcn = smu_v12_0_powergate_vcn, + .powergate_jpeg = smu_v12_0_powergate_jpeg, .send_smc_msg = smu_v12_0_send_msg, .send_smc_msg_with_param = smu_v12_0_send_msg_with_param, .read_smc_arg = smu_v12_0_read_arg,
drivers/gpu/drm/amd/powerplay/smu_internal.h +2 -0
@@ -42,6 +42,8 @@ ((smu)->ppt_funcs->powergate_sdma ? (smu)->ppt_funcs->powergate_sdma((smu), (gate)) : 0)#define smu_powergate_vcn (smu, gate) \ ((smu)->ppt_funcs->powergate_vcn ? (smu)->ppt_funcs->powergate_vcn((smu), (gate)) : 0) +#define smu_powergate_jpeg (smu, gate) \ + ((smu)->ppt_funcs->powergate_jpeg ? (smu)->ppt_funcs->powergate_jpeg((smu), (gate)) : 0)#define smu_get_vbios_bootup_values (smu) \ ((smu)->ppt_funcs->get_vbios_bootup_values ? (smu)->ppt_funcs->get_vbios_bootup_values((smu)) : 0)
drivers/gpu/drm/amd/powerplay/smu_v12_0.c +11 -0
@@ -203,6 +203,17 @@ int smu_v12_0_powergate_vcn(struct smu_context *smu, bool gate)return smu_send_smc_msg (smu, SMU_MSG_PowerUpVcn); } +int smu_v12_0_powergate_jpeg (struct smu_context *smu,bool gate) +{ +if (!(smu->adev->flags &AMD_IS_APU )) +return 0 ; + +if (gate) +return smu_send_smc_msg (smu, SMU_MSG_PowerDownJpeg); +else +return smu_send_smc_msg (smu, SMU_MSG_PowerUpJpeg); +} +int smu_v12_0_set_gfx_cgpg (struct smu_context *smu,bool enable) {if (!(smu->adev->pg_flags &AMD_PG_SUPPORT_GFX_PG ))
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
RE: [PATCH 13/21] drm/amd/powerplay: add Powergate JPEG for Renoir
On Renior, both SMU_MSG_PowerDownJpeg and SMU_MSG_PowerUpJpeg need an argument.
Quoted 108 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Leo Liu
Sent: Wednesday, November 13, 2019 2:03 AM
To: [email protected]
Cc: Liu, Leo <[email protected]>
Subject: [PATCH 13/21] drm/amd/powerplay: add Powergate JPEG for RenoirSimilar to SDMA, VCN etc.
Signed-off-by Leo Liu <[email protected]>--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 ++ drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h | 2 ++ drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 1 + drivers/gpu/drm/amd/powerplay/smu_internal.h | 2 ++ drivers/gpu/drm/amd/powerplay/smu_v12_0.c | 11 +++++++++++ 5 files changed, 18 insertions(+)drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +2
-0@@ -1229,6 +1229,7 @@ static int smu_hw_init(void *handle)if (adev->flags &AMD_IS_APU ) {smu_powergate_sdma (&adev->smu, false);smu_powergate_vcn (&adev->smu, false); +smu_powergate_jpeg (&adev->smu, false);smu_set_gfx_cgpg (&adev->smu, true); }@@ -1287,6 +1288,7 @@ static int smu_hw_fini(void *handle)if (adev->flags &AMD_IS_APU ) {smu_powergate_sdma (&adev->smu, true);smu_powergate_vcn (&adev->smu, true); +smu_powergate_jpeg (&adev->smu, true); } ret =smu_stop_thermal_control (smu);drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h +2
-0@@ -58,6 +58,8 @@ int smu_v12_0_powergate_sdma(struct smu_context *smu, bool gate);int smu_v12_0_powergate_vcn (struct smu_context *smu,bool gate); +int smu_v12_0_powergate_jpeg (struct smu_context *smu,bool gate); +int smu_v12_0_set_gfx_cgpg (struct smu_context *smu,bool enable);
uint32_tsmu_v12_0_get_gfxoff_status(struct smu_context *smu); diff --gita/drivers/gpu/drm/amd/powerplay/renoir_ppt.cb/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
index04daf7e9fe05..492a201554e8100644drivers/gpu/drm/amd/powerplay/renoir_ppt.c +1
-0@@ -697,6 +697,7 @@ static const struct pptable_funcs renoir_ppt_funcs = { .check_fw_version = smu_v12_0_check_fw_version, .powergate_sdma = smu_v12_0_powergate_sdma, .powergate_vcn = smu_v12_0_powergate_vcn, + .powergate_jpeg = smu_v12_0_powergate_jpeg, .send_smc_msg = smu_v12_0_send_msg, .send_smc_msg_with_param = smu_v12_0_send_msg_with_param, .read_smc_arg = smu_v12_0_read_arg,drivers/gpu/drm/amd/powerplay/smu_internal.h +3
-0@@ -42,6 +42,8 @@ ((smu)->ppt_funcs->powergate_sdma ? (smu)->ppt_funcs- >powergate_sdma((smu), (gate)) : 0) #define smu_powergate_vcn(smu, gate) \ ((smu)->ppt_funcs->powergate_vcn ? (smu)->ppt_funcs- >powergate_vcn((smu), (gate)) : 0) +#define smu_powergate_jpeg (smu, gate) \ + ((smu)->ppt_funcs->powergate_jpeg ? +(smu)->ppt_funcs->powergate_jpeg((smu), (gate)) : 0)#define smu_get_vbios_bootup_values (smu) \ ((smu)->ppt_funcs->get_vbios_bootup_values ? (smu)->ppt_funcs-Quoted 1 line
get_vbios_bootup_values((smu)) : 0) diff --git
a/drivers/gpu/drm/amd/powerplay/smu_v12_0.cb/drivers/gpu/drm/amd/powerplay/smu_v12_0.c
index139dd737eaa5..f5d87110ec34100644drivers/gpu/drm/amd/powerplay/smu_v12_0.c +9
-1@@ -203,6 +203,17 @@ int smu_v12_0_powergate_vcn(struct smu_context *smu, bool gate)return smu_send_smc_msg (smu, SMU_MSG_PowerUpVcn); } +int smu_v12_0_powergate_jpeg (struct smu_context *smu,bool gate) { +if (!(smu->adev->flags &AMD_IS_APU )) +return 0 ; + +if (gate) +return smu_send_smc_msg (smu, SMU_MSG_PowerDownJpeg); +else +return smu_send_smc_msg (smu, SMU_MSG_PowerUpJpeg); } +int smu_v12_0_set_gfx_cgpg (struct smu_context *smu,bool enable) {if (!(smu->adev->pg_flags &AMD_PG_SUPPORT_GFX_PG )) --2.17.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/21 drm/amd/powerplay: add Powergate JPEG for Renoir
In reply to a message not in the archiveSimilar to SDMA, VCN etc.
v2: add argument to both PowerUpJpeg and PowerDownJpeg messages
--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 ++ drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h | 2 ++ drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 1 + drivers/gpu/drm/amd/powerplay/smu_internal.h | 2 ++ drivers/gpu/drm/amd/powerplay/smu_v12_0.c | 11 +++++++++++ 5 files changed, 18 insertions(+)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +2 -0
@@ -1229,6 +1229,7 @@ static int smu_hw_init(void *handle)if (adev->flags &AMD_IS_APU ) {smu_powergate_sdma (&adev->smu, false);smu_powergate_vcn (&adev->smu, false); +smu_powergate_jpeg (&adev->smu, false);smu_set_gfx_cgpg (&adev->smu, true); }
@@ -1287,6 +1288,7 @@ static int smu_hw_fini(void *handle)if (adev->flags &AMD_IS_APU ) {smu_powergate_sdma (&adev->smu, true);smu_powergate_vcn (&adev->smu, true); +smu_powergate_jpeg (&adev->smu, true); } ret =smu_stop_thermal_control (smu);
drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h +2 -0
@@ -58,6 +58,8 @@ int smu_v12_0_powergate_sdma(struct smu_context *smu, bool gate);int smu_v12_0_powergate_vcn (struct smu_context *smu,bool gate); +int smu_v12_0_powergate_jpeg (struct smu_context *smu,bool gate); +int smu_v12_0_set_gfx_cgpg (struct smu_context *smu,bool enable);uint32_t smu_v12_0_get_gfxoff_status (struct smu_context *smu);
drivers/gpu/drm/amd/powerplay/renoir_ppt.c +1 -0
@@ -697,6 +697,7 @@ static const struct pptable_funcs renoir_ppt_funcs = { .check_fw_version = smu_v12_0_check_fw_version, .powergate_sdma = smu_v12_0_powergate_sdma, .powergate_vcn = smu_v12_0_powergate_vcn, + .powergate_jpeg = smu_v12_0_powergate_jpeg, .send_smc_msg = smu_v12_0_send_msg, .send_smc_msg_with_param = smu_v12_0_send_msg_with_param, .read_smc_arg = smu_v12_0_read_arg,
drivers/gpu/drm/amd/powerplay/smu_internal.h +2 -0
@@ -42,6 +42,8 @@ ((smu)->ppt_funcs->powergate_sdma ? (smu)->ppt_funcs->powergate_sdma((smu), (gate)) : 0)#define smu_powergate_vcn (smu, gate) \ ((smu)->ppt_funcs->powergate_vcn ? (smu)->ppt_funcs->powergate_vcn((smu), (gate)) : 0) +#define smu_powergate_jpeg (smu, gate) \ + ((smu)->ppt_funcs->powergate_jpeg ? (smu)->ppt_funcs->powergate_jpeg((smu), (gate)) : 0)#define smu_get_vbios_bootup_values (smu) \ ((smu)->ppt_funcs->get_vbios_bootup_values ? (smu)->ppt_funcs->get_vbios_bootup_values((smu)) : 0)
drivers/gpu/drm/amd/powerplay/smu_v12_0.c +11 -0
@@ -203,6 +203,17 @@ int smu_v12_0_powergate_vcn(struct smu_context *smu, bool gate)return smu_send_smc_msg (smu, SMU_MSG_PowerUpVcn); } +int smu_v12_0_powergate_jpeg (struct smu_context *smu,bool gate) +{ +if (!(smu->adev->flags &AMD_IS_APU )) +return 0 ; + +if (gate) +return smu_send_smc_msg_with_param (smu, SMU_MSG_PowerDownJpeg,0 ); +else +return smu_send_smc_msg_with_param (smu, SMU_MSG_PowerUpJpeg,0 ); +} +int smu_v12_0_set_gfx_cgpg (struct smu_context *smu,bool enable) {if (!(smu->adev->pg_flags &AMD_PG_SUPPORT_GFX_PG ))
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 14/21 drm/amd/powerplay: add JPEG power control for Renoir
In reply to a message not in the archiveBy using its own JPEG PowerUp and PowerDown messages
--- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+)
drivers/gpu/drm/amd/powerplay/renoir_ppt.c +26 -0
@@ -301,6 +301,31 @@ static int renoir_dpm_set_uvd_enable(struct smu_context *smu, bool enable)return ret; } +static int renoir_dpm_set_jpeg_enable (struct smu_context *smu,bool enable) +{ +struct smu_power_context *smu_power = &smu->smu_power; +struct smu_power_gate *power_gate = &smu_power->power_gate; +int ret =0 ; + +if (enable) { +if (smu_feature_is_enabled (smu,SMU_FEATURE_JPEG_PG_BIT )) { + ret =smu_send_smc_msg_with_param (smu, SMU_MSG_PowerUpJpeg,0 ); +if (ret) +return ret; + } + power_gate->jpeg_gated = false; + }else { +if (smu_feature_is_enabled (smu,SMU_FEATURE_JPEG_PG_BIT )) { + ret =smu_send_smc_msg (smu, SMU_MSG_PowerDownJpeg); +if (ret) +return ret; + } + power_gate->jpeg_gated = true; + } + +return ret; +} +static int renoir_force_dpm_limit_value (struct smu_context *smu,bool highest) {int ret =0 , i =0 ;
@@ -683,6 +708,7 @@ static const struct pptable_funcs renoir_ppt_funcs = { .print_clk_levels = renoir_print_clk_levels, .get_current_power_state = renoir_get_current_power_state, .dpm_set_uvd_enable = renoir_dpm_set_uvd_enable, + .dpm_set_jpeg_enable = renoir_dpm_set_jpeg_enable, .force_dpm_limit_value = renoir_force_dpm_limit_value, .unforce_dpm_levels = renoir_unforce_dpm_levels, .get_workload_type = renoir_get_workload_type,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
RE: [PATCH 14/21] drm/amd/powerplay: add JPEG power control for Renoir
On Renior, both SMU_MSG_PowerDownJpeg and SMU_MSG_PowerUpJpeg need an argument.
Quoted 68 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Leo Liu
Sent: Wednesday, November 13, 2019 2:03 AM
To: [email protected]
Cc: Liu, Leo <[email protected]>
Subject: [PATCH 14/21] drm/amd/powerplay: add JPEG power control for RenoirBy using its own JPEG PowerUp and PowerDown messages
Signed-off-by Leo Liu <[email protected]>--- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+)drivers/gpu/drm/amd/powerplay/renoir_ppt.c +15
-0@@ -301,6 +301,31 @@ static int renoir_dpm_set_uvd_enable(struct smu_context *smu, bool enable) return ret; } +static int renoir_dpm_set_jpeg_enable (struct smu_context *smu,bool +enable) { +struct smu_power_context *smu_power = &smu->smu_power; +struct smu_power_gate *power_gate = &smu_power->power_gate; +int ret =0 ; + +if (enable) { +if (smu_feature_is_enabled (smu,SMU_FEATURE_JPEG_PG_BIT )) { + ret =smu_send_smc_msg_with_param (smu, SMU_MSG_PowerUpJpeg,0 ); +if (ret) +return ret; + } + power_gate->jpeg_gated = false; + }else { + if (smu_feature_is_enabled(smu,
SMU_FEATURE_JPEG_PG_BIT)) {drivers/gpu/drm/amd/powerplay/renoir_ppt.c +1
-0+ ret = smu_send_smc_msg(smu,
SMU_MSG_PowerDownJpeg);drivers/gpu/drm/amd/powerplay/renoir_ppt.c +9
-0+if (ret) +return ret; + } + power_gate->jpeg_gated = true; + } + +return ret; +} +static int renoir_force_dpm_limit_value (struct smu_context *smu,bool highest){
drivers/gpu/drm/amd/powerplay/renoir_ppt.c +1
-1int ret =0 , i =0 ;@@ -683,6 +708,7 @@ static const struct pptable_funcs renoir_ppt_funcs = { .print_clk_levels = renoir_print_clk_levels, .get_current_power_state = renoir_get_current_power_state, .dpm_set_uvd_enable = renoir_dpm_set_uvd_enable, + .dpm_set_jpeg_enable = renoir_dpm_set_jpeg_enable, .force_dpm_limit_value = renoir_force_dpm_limit_value, .unforce_dpm_levels = renoir_unforce_dpm_levels, .get_workload_type = renoir_get_workload_type, --2.17.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 14/21 drm/amd/powerplay: add JPEG power control for Renoir
In reply to a message not in the archiveBy using its own JPEG PowerUp and PowerDown messages
v2: add argument to PowerDownJpeg message
--- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+)
drivers/gpu/drm/amd/powerplay/renoir_ppt.c +26 -0
@@ -301,6 +301,31 @@ static int renoir_dpm_set_uvd_enable(struct smu_context *smu, bool enable)return ret; } +static int renoir_dpm_set_jpeg_enable (struct smu_context *smu,bool enable) +{ +struct smu_power_context *smu_power = &smu->smu_power; +struct smu_power_gate *power_gate = &smu_power->power_gate; +int ret =0 ; + +if (enable) { +if (smu_feature_is_enabled (smu,SMU_FEATURE_JPEG_PG_BIT )) { + ret =smu_send_smc_msg_with_param (smu, SMU_MSG_PowerUpJpeg,0 ); +if (ret) +return ret; + } + power_gate->jpeg_gated = false; + }else { +if (smu_feature_is_enabled (smu,SMU_FEATURE_JPEG_PG_BIT )) { + ret =smu_send_smc_msg_with_param (smu, SMU_MSG_PowerDownJpeg,0 ); +if (ret) +return ret; + } + power_gate->jpeg_gated = true; + } + +return ret; +} +static int renoir_force_dpm_limit_value (struct smu_context *smu,bool highest) {int ret =0 , i =0 ;
@@ -683,6 +708,7 @@ static const struct pptable_funcs renoir_ppt_funcs = { .print_clk_levels = renoir_print_clk_levels, .get_current_power_state = renoir_get_current_power_state, .dpm_set_uvd_enable = renoir_dpm_set_uvd_enable, + .dpm_set_jpeg_enable = renoir_dpm_set_jpeg_enable, .force_dpm_limit_value = renoir_force_dpm_limit_value, .unforce_dpm_levels = renoir_unforce_dpm_levels, .get_workload_type = renoir_get_workload_type,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 15/21 drm/amd/powerplay: set JPEG to SMU dpm
In reply to a message not in the archiveBy using its own IP block type.
--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 3 +++ drivers/gpu/drm/amd/powerplay/smu_internal.h | 2 ++ 2 files changed, 5 insertions(+)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +3 -0
@@ -415,6 +415,9 @@ int smu_dpm_set_power_gate(struct smu_context *smu, uint32_t block_type,case AMD_IP_BLOCK_TYPE_SDMA : ret =smu_powergate_sdma (smu, gate);break ; +case AMD_IP_BLOCK_TYPE_JPEG : + ret =smu_dpm_set_jpeg_enable (smu, gate); +break ;default :break ; }
drivers/gpu/drm/amd/powerplay/smu_internal.h +2 -0
@@ -172,6 +172,8 @@ ((smu)->ppt_funcs->dpm_set_uvd_enable ? (smu)->ppt_funcs->dpm_set_uvd_enable((smu), (enable)) : 0)#define smu_dpm_set_vce_enable (smu, enable) \ ((smu)->ppt_funcs->dpm_set_vce_enable ? (smu)->ppt_funcs->dpm_set_vce_enable((smu), (enable)) : 0) +#define smu_dpm_set_jpeg_enable (smu, enable) \ + ((smu)->ppt_funcs->dpm_set_jpeg_enable ? (smu)->ppt_funcs->dpm_set_jpeg_enable((smu), (enable)) : 0)#define smu_set_watermarks_table (smu, tab, clock_ranges) \ ((smu)->ppt_funcs->set_watermarks_table ? (smu)->ppt_funcs->set_watermarks_table((smu), (tab), (clock_ranges)) : 0)
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 16/21 drm/amdgpu: enable JPEG2.0 dpm
In reply to a message not in the archiveBy using its own enabling function
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 8 ++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 1 + drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 10 +++++++++- 3 files changed, 18 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +8 -0
@@ -2718,6 +2718,14 @@ void amdgpu_pm_print_power_states(struct amdgpu_device *adev) } +void amdgpu_dpm_enable_jpeg (struct amdgpu_device *adev,bool enable) +{ +int ret =smu_dpm_set_power_gate (&adev->smu,AMD_IP_BLOCK_TYPE_JPEG , enable); +if (ret) +DRM_ERROR ("[SW SMU]: dpm enable jpeg failed, state = %s, ret = %d. \n" , + enable ?"true" :"false" , ret); +} +int amdgpu_pm_virt_sysfs_init (struct amdgpu_device *adev) {int ret =0 ;
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h +1 -0
@@ -41,5 +41,6 @@ void amdgpu_pm_compute_clocks(struct amdgpu_device *adev);void amdgpu_dpm_thermal_work_handler (struct work_struct *work);void amdgpu_dpm_enable_uvd (struct amdgpu_device *adev,bool enable);void amdgpu_dpm_enable_vce (struct amdgpu_device *adev,bool enable); +void amdgpu_dpm_enable_jpeg (struct amdgpu_device *adev,bool enable);#endif
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c +9 -1
@@ -333,6 +333,9 @@ static int jpeg_v2_0_start(struct amdgpu_device *adev)struct amdgpu_ring *ring = &adev->jpeg.inst->ring_dec;int r; +if (adev->pm.dpm_enabled) +amdgpu_dpm_enable_jpeg (adev, true); +/* disable power gating */ r =jpeg_v2_0_disable_power_gating (adev);if (r)
@@ -388,8 +391,13 @@ static int jpeg_v2_0_stop(struct amdgpu_device *adev)/* enable power gating */ r =jpeg_v2_0_enable_power_gating (adev); +if (r) +return r; -return r; +if (adev->pm.dpm_enabled) +amdgpu_dpm_enable_jpeg (adev, false); + +return 0 ; }/**
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
Alex Deucher
Reviewed-byRe: [PATCH 16/21] drm/amdgpu: enable JPEG2.0 dpm
Quoted 15 lines · Leo Liu
By using its own enabling function
Signed-off-by Leo Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 8 ++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 1 + drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 10 +++++++++- 3 files changed, 18 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c void amdgpu_pm_print_power_states(struct amdgpu_device *adev) · line 2722
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +2
-0@@ -2718,6 +2718,14 @@ void amdgpu_pm_print_power_states(struct amdgpu_device *adev) } +void amdgpu_dpm_enable_jpeg (struct amdgpu_device *adev,bool enable) +{
I would add an "if (is_support_sw_smu(adev))" check here in case this ever gets called on older asics. Other than that, the series (with the v2 patches) is:
Quoted 52 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +6
-0+int ret =smu_dpm_set_power_gate (&adev->smu,AMD_IP_BLOCK_TYPE_JPEG , enable); +if (ret) +DRM_ERROR ("[SW SMU]: dpm enable jpeg failed, state = %s, ret = %d. \n" , + enable ?"true" :"false" , ret); +} +int amdgpu_pm_virt_sysfs_init (struct amdgpu_device *adev) {int ret =0 ;drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h +1
-0@@ -41,5 +41,6 @@ void amdgpu_pm_compute_clocks(struct amdgpu_device *adev);void amdgpu_dpm_thermal_work_handler (struct work_struct *work);void amdgpu_dpm_enable_uvd (struct amdgpu_device *adev,bool enable);void amdgpu_dpm_enable_vce (struct amdgpu_device *adev,bool enable); +void amdgpu_dpm_enable_jpeg (struct amdgpu_device *adev,bool enable);#endif drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c +9
-2@@ -333,6 +333,9 @@ static int jpeg_v2_0_start(struct amdgpu_device *adev)struct amdgpu_ring *ring = &adev->jpeg.inst->ring_dec;int r; +if (adev->pm.dpm_enabled) +amdgpu_dpm_enable_jpeg (adev, true); +/* disable power gating */ r =jpeg_v2_0_disable_power_gating (adev);if (r)@@ -388,8 +391,13 @@ static int jpeg_v2_0_stop(struct amdgpu_device *adev)/* enable power gating */ r =jpeg_v2_0_enable_power_gating (adev); +if (r) +return r; -return r; +if (adev->pm.dpm_enabled) +amdgpu_dpm_enable_jpeg (adev, false); + +return 0 ; }/** -- 2.17.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): CADnq5_PTs-1fU3o3rpQ1hhAdbiicwixWMHuOxSbZ7bshMSBVxA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH 16/21] drm/amdgpu: enable JPEG2.0 dpm
Quoted 16 lines · Alex Deucher
Quoted 15 lines · Leo Liu
By using its own enabling function
Signed-off-by Leo Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 8 ++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 1 + drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 10 +++++++++- 3 files changed, 18 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +0
-0@@ -2718,6 +2718,14 @@ void amdgpu_pm_print_power_states(struct amdgpu_device *adev)
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c void amdgpu_pm_print_power_states(struct amdgpu_device *adev) · line 2722
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +2
-0} +void amdgpu_dpm_enable_jpeg (struct amdgpu_device *adev,bool enable) +{I would add an "if (
is_support_sw_smu(adev))" check here in case this ever gets called on older asics.
Thanks Alex for the reviews.
I got "is_support_sw_smu()" in place in the beginning, and later has it removed.
because from "is_support_sw_smu",
"if (adev->asic_type == CHIP_VEGA20)
return (amdgpu_dpm == 2) ? true : false;
else if (adev->asic_type >= CHIP_ARCTURUS)
return true;
else
return false;"
JPEG2.0 and above, fits >=CHIP_ARCTURUS, so always return true.
But I will add it back as you suggested, since it has no harm, also in case when condition changed.
Thanks again.
Leo
Quoted 52 lines
Other than that, the series (with
the v2 patches) is:Reviewed-by Alex Deucher <[email protected]>Quoted 48 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +6
-0+int ret =smu_dpm_set_power_gate (&adev->smu,AMD_IP_BLOCK_TYPE_JPEG , enable); +if (ret) +DRM_ERROR ("[SW SMU]: dpm enable jpeg failed, state = %s, ret = %d. \n" , + enable ?"true" :"false" , ret); +} +int amdgpu_pm_virt_sysfs_init (struct amdgpu_device *adev) {int ret =0 ;drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h +1
-0@@ -41,5 +41,6 @@ void amdgpu_pm_compute_clocks(struct amdgpu_device *adev);void amdgpu_dpm_thermal_work_handler (struct work_struct *work);void amdgpu_dpm_enable_uvd (struct amdgpu_device *adev,bool enable);void amdgpu_dpm_enable_vce (struct amdgpu_device *adev,bool enable); +void amdgpu_dpm_enable_jpeg (struct amdgpu_device *adev,bool enable);#endif drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c +9
-1@@ -333,6 +333,9 @@ static int jpeg_v2_0_start(struct amdgpu_device *adev)struct amdgpu_ring *ring = &adev->jpeg.inst->ring_dec;int r; +if (adev->pm.dpm_enabled) +amdgpu_dpm_enable_jpeg (adev, true); +/* disable power gating */ r =jpeg_v2_0_disable_power_gating (adev);if (r)@@ -388,8 +391,13 @@ static int jpeg_v2_0_stop(struct amdgpu_device *adev)/* enable power gating */ r =jpeg_v2_0_enable_power_gating (adev); +if (r) +return r; -return r; +if (adev->pm.dpm_enabled) +amdgpu_dpm_enable_jpeg (adev, false); + +return 0 ; }
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c +0
-1/** -- 2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 17/21 drm/amdgpu: add driver support for JPEG2.0 and above
In reply to a message not in the archiveBy using JPEG IP block type
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -0
@@ -1964,6 +1964,7 @@ static int amdgpu_device_set_cg_state(struct amdgpu_device *adev,if (adev->ip_blocks[i].version->type !=AMD_IP_BLOCK_TYPE_UVD && adev->ip_blocks[i].version->type !=AMD_IP_BLOCK_TYPE_VCE && adev->ip_blocks[i].version->type !=AMD_IP_BLOCK_TYPE_VCN && + adev->ip_blocks[i].version->type !=AMD_IP_BLOCK_TYPE_JPEG && adev->ip_blocks[i].version->funcs->set_clockgating_state) {/* enable clockgating to save power */ r = adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev,
@@ -1994,6 +1995,7 @@ static int amdgpu_device_set_pg_state(struct amdgpu_device *adev, enum amd_powerif (adev->ip_blocks[i].version->type !=AMD_IP_BLOCK_TYPE_UVD && adev->ip_blocks[i].version->type !=AMD_IP_BLOCK_TYPE_VCE && adev->ip_blocks[i].version->type !=AMD_IP_BLOCK_TYPE_VCN && + adev->ip_blocks[i].version->type !=AMD_IP_BLOCK_TYPE_JPEG && adev->ip_blocks[i].version->funcs->set_powergating_state) {/* enable powergating to save power */ r = adev->ip_blocks[i].version->funcs->set_powergating_state((void *)adev,
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +7 -2
@@ -400,7 +400,9 @@ static int amdgpu_hw_ip_info(struct amdgpu_device *adev, ib_size_alignment =1 ;break ;case AMDGPU_HW_IP_VCN_JPEG : - type =AMD_IP_BLOCK_TYPE_VCN ; + type = (amdgpu_device_ip_get_ip_block (adev,AMD_IP_BLOCK_TYPE_JPEG )) ? +AMD_IP_BLOCK_TYPE_JPEG :AMD_IP_BLOCK_TYPE_VCN ; +for (i =0 ; i < adev->jpeg.num_jpeg_inst; i++) {if (adev->jpeg.harvest_config & (1 << i))continue ;
@@ -521,9 +523,12 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_filebreak ;case AMDGPU_HW_IP_VCN_DEC :case AMDGPU_HW_IP_VCN_ENC : -case AMDGPU_HW_IP_VCN_JPEG : type =AMD_IP_BLOCK_TYPE_VCN ;break ; +case AMDGPU_HW_IP_VCN_JPEG : + type = (amdgpu_device_ip_get_ip_block (adev,AMD_IP_BLOCK_TYPE_JPEG )) ? +AMD_IP_BLOCK_TYPE_JPEG :AMD_IP_BLOCK_TYPE_VCN ; +break ;default :return -EINVAL ; }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 18/21 drm/amdgpu: enable JPEG2.0 for Navi1x and Renoir
In reply to a message not in the archiveBy adding JPEG IP block to the family
--- drivers/gpu/drm/amd/amdgpu/nv.c | 3 +++ drivers/gpu/drm/amd/amdgpu/soc15.c | 2 ++ 2 files changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/nv.c +3 -0
@@ -52,6 +52,7 @@#include "gfx_v10_0.h" #include "sdma_v5_0.h" #include "vcn_v2_0.h" +#include "jpeg_v2_0.h" #include "dce_virtual.h" #include "mes_v10_1.h" #include "mxgpu_nv.h"
@@ -456,6 +457,7 @@ int nv_set_ip_blocks(struct amdgpu_device *adev) is_support_sw_smu(adev) && !amdgpu_sriov_vf(adev))amdgpu_device_ip_block_add (adev, &smu_v11_0_ip_block);amdgpu_device_ip_block_add (adev, &vcn_v2_0_ip_block); +amdgpu_device_ip_block_add (adev, &jpeg_v2_0_ip_block);if (adev->enable_mes)amdgpu_device_ip_block_add (adev, &mes_v10_1_ip_block);break ;
@@ -479,6 +481,7 @@ int nv_set_ip_blocks(struct amdgpu_device *adev) is_support_sw_smu(adev) && !amdgpu_sriov_vf(adev))amdgpu_device_ip_block_add (adev, &smu_v11_0_ip_block);amdgpu_device_ip_block_add (adev, &vcn_v2_0_ip_block); +amdgpu_device_ip_block_add (adev, &jpeg_v2_0_ip_block);break ;default :return -EINVAL ;
drivers/gpu/drm/amd/amdgpu/soc15.c +2 -0
@@ -67,6 +67,7 @@#include "vce_v4_0.h" #include "vcn_v1_0.h" #include "vcn_v2_0.h" +#include "jpeg_v2_0.h" #include "vcn_v2_5.h" #include "dce_virtual.h" #include "mxgpu_ai.h"
@@ -821,6 +822,7 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)amdgpu_device_ip_block_add (adev, &dm_ip_block);#endif amdgpu_device_ip_block_add (adev, &vcn_v2_0_ip_block); +amdgpu_device_ip_block_add (adev, &jpeg_v2_0_ip_block);break ;default :return -EINVAL ;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 19/21 drm/amdgpu: move JPEG2.5 out from VCN2.5
In reply to a message not in the archiveAnd clean up the duplicated stuff
--- drivers/gpu/drm/amd/amdgpu/Makefile | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h | 3 + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 105 ---- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 5 - drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 641 +++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h | 29 + drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 236 --------- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.h | 13 - drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 246 +-------- 9 files changed, 679 insertions(+), 602 deletions(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h
drivers/gpu/drm/amd/amdgpu/Makefile +2 -1
@@ -155,7 +155,8 @@ amdgpu-y += \ vcn_v2_5.o \ amdgpu_jpeg.o \ jpeg_v1_0.o \ - jpeg_v2_0.o + jpeg_v2_0.o \ + jpeg_v2_5.o # add ATHUB block amdgpu-y += \
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h +3 -0
@@ -26,6 +26,9 @@#define AMDGPU_MAX_JPEG_INSTANCES 2 +#define AMDGPU_JPEG_HARVEST_JPEG0 (1 << 0) +#define AMDGPU_JPEG_HARVEST_JPEG1 (1 << 1) +struct amdgpu_jpeg_reg {unsigned jpeg_pitch; };
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +0 -105
108 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0 -5
@@ -158,7 +158,6 @@ struct amdgpu_vcn_reg{unsigned ib_size;unsigned gp_scratch8;unsigned scratch9; -unsigned jpeg_pitch; };struct amdgpu_vcn_inst {
@@ -168,7 +167,6 @@ struct amdgpu_vcn_inst {void *saved_bo;struct amdgpu_ring ring_dec;struct amdgpu_ring ring_enc[AMDGPU_VCN_MAX_ENC_RINGS ]; -struct amdgpu_ring ring_jpeg;struct amdgpu_irq_src irq;struct amdgpu_vcn_reg external; };
@@ -209,7 +207,4 @@ int amdgpu_vcn_dec_ring_test_ib(struct amdgpu_ring *ring, long timeout);int amdgpu_vcn_enc_ring_test_ring (struct amdgpu_ring *ring);int amdgpu_vcn_enc_ring_test_ib (struct amdgpu_ring *ring,long timeout); -int amdgpu_vcn_jpeg_ring_test_ring (struct amdgpu_ring *ring); -int amdgpu_vcn_jpeg_ring_test_ib (struct amdgpu_ring *ring,long timeout); -#endif
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c new file +641 -0
641 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h new file +29 -0
@@ -0,0 +1,29 @@ +/* +* Copyright 2019 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +*/ + +#ifndef __JPEG_V2_5_H__ +#define __JPEG_V2_5_H__ + +extern const struct amdgpu_ip_block_version jpeg_v2_5_ip_block; + +#endif /* __JPEG_V2_5_H__ */
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +0 -236
248 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.h +0 -13
@@ -49,19 +49,6 @@ extern void vcn_v2_0_enc_ring_emit_vm_flush(struct amdgpu_ring *ring, unsigned int vmid, uint64_t pd_addr);extern void vcn_v2_0_enc_ring_emit_wreg (struct amdgpu_ring *ring,uint32_t reg,uint32_t val); -extern void vcn_v2_0_jpeg_ring_insert_start (struct amdgpu_ring *ring); -extern void vcn_v2_0_jpeg_ring_insert_end (struct amdgpu_ring *ring); -extern void vcn_v2_0_jpeg_ring_emit_fence (struct amdgpu_ring *ring,u64 addr,u64 seq, -unsigned flags); -extern void vcn_v2_0_jpeg_ring_emit_ib (struct amdgpu_ring *ring,struct amdgpu_job *job, -struct amdgpu_ib *ib,uint32_t flags); -extern void vcn_v2_0_jpeg_ring_emit_reg_wait (struct amdgpu_ring *ring,uint32_t reg, -uint32_t val,uint32_t mask); -extern void vcn_v2_0_jpeg_ring_emit_vm_flush (struct amdgpu_ring *ring, -unsigned vmid,uint64_t pd_addr); -extern void vcn_v2_0_jpeg_ring_emit_wreg (struct amdgpu_ring *ring,uint32_t reg,uint32_t val); -extern void vcn_v2_0_jpeg_ring_nop (struct amdgpu_ring *ring,uint32_t count); -extern const struct amdgpu_ip_block_version vcn_v2_0_ip_block;#endif /* __VCN_V2_0_H__ */
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +4 -242
328 lines not on this page · raw message
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 20/21 drm/amdgpu: enable Arcturus CG for VCN and JPEG blocks
In reply to a message not in the archiveArcturus VCN and JPEG only got CG support, and no PG support
--- drivers/gpu/drm/amd/amdgpu/soc15.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +3 -1
@@ -1210,7 +1210,9 @@ static int soc15_common_early_init(void *handle)AMD_CG_SUPPORT_SDMA_LS |AMD_CG_SUPPORT_MC_MGCG |AMD_CG_SUPPORT_MC_LS | -AMD_CG_SUPPORT_IH_CG ; +AMD_CG_SUPPORT_IH_CG | +AMD_CG_SUPPORT_VCN_MGCG | +AMD_CG_SUPPORT_JPEG_MGCG ; adev->pg_flags =0 ; adev->external_rev_id = adev->rev_id +0x32 ;break ;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 21/21 drm/amdgpu: enable Arcturus JPEG2.5 block
In reply to a message not in the archiveIt also doen't care about FW loading type, so enabling it directly.
--- drivers/gpu/drm/amd/amdgpu/soc15.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/soc15.c +2 -0
@@ -69,6 +69,7 @@#include "vcn_v2_0.h" #include "jpeg_v2_0.h" #include "vcn_v2_5.h" +#include "jpeg_v2_5.h" #include "dce_virtual.h" #include "mxgpu_ai.h" #include "amdgpu_smu.h"
@@ -804,6 +805,7 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)if (unlikely (adev->firmware.load_type ==AMDGPU_FW_LOAD_DIRECT ))amdgpu_device_ip_block_add (adev, &vcn_v2_5_ip_block); +amdgpu_device_ip_block_add (adev, &jpeg_v2_5_ip_block);break ;case CHIP_RENOIR :amdgpu_device_ip_block_add (adev, &vega10_common_ip_block);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
cover Separate JPEG from VCN
In reply to a message not in the archiveFrom JPEG2.0, JPEG is a separated IP block, and has it own PG/CG, and power management. It doesn't require FW, so indepedent from FW loading as well.
Patch 1-4: Separate JPEG1.0 from SW wise, since JPEG1.0 is still combined with VCN1.0 esp. in power management;
Patch 5-8: Separate JPEG2.0 as an independent IP; Patch 9-10: Add JPEG2.0 with PG and CG;
Patch 11-15: Add power management for JPEG of Navi1x and Renoir; Patch 16: Enable JPEG2.0 DPM;
Patch 17-18: Enable JPEG2.0;
Patch 19: Separate JPEG2.5 from VCN2.5;
Patch 20: Add CG for VCN2.5 and JPEG2.5;
Patch 21: Enable JPEG2.5
Leo Liu (21):
drm/amdgpu: add JPEG HW IP and SW structures drm/amdgpu: add amdgpu_jpeg and JPEG tests drm/amdgpu: separate JPEG1.0 code out from VCN1.0 drm/amdgpu: use the JPEG structure for general driver support drm/amdgpu: add JPEG IP block type
drm/amdgpu: add JPEG common functions to amdgpu_jpeg drm/amdgpu: add JPEG v2.0 function supports drm/amdgpu: remove unnecessary JPEG2.0 code from VCN2.0 drm/amdgpu: add JPEG PG and CG interface drm/amdgpu: add PG and CG for JPEG2.0 drm/amd/powerplay: add JPEG Powerplay interface drm/amd/powerplay: add JPEG power control for Navi1x drm/amd/powerplay: add Powergate JPEG for Renoir drm/amd/powerplay: add JPEG power control for Renoir drm/amd/powerplay: set JPEG to SMU dpm
drm/amdgpu: enable JPEG2.0 dpm
drm/amdgpu: add driver support for JPEG2.0 and above drm/amdgpu: enable JPEG2.0 for Navi1x and Renoir drm/amdgpu: move JPEG2.5 out from VCN2.5 drm/amdgpu: enable Arcturus CG for VCN and JPEG blocks drm/amdgpu: enable Arcturus JPEG2.5 block
drivers/gpu/drm/amd/amdgpu/Makefile | 8 +- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 5 + drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 215 +++++ drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h | 62 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 15 +- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 8 + drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 113 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 5 - drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c | 584 +++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.h | 32 + drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 827 ++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.h | 42 + drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 641 ++++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h | 29 + drivers/gpu/drm/amd/amdgpu/nv.c | 11 +- drivers/gpu/drm/amd/amdgpu/soc15.c | 10 +- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 481 +--------- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 496 +---------- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.h | 13 - drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 246 +----- drivers/gpu/drm/amd/include/amd_shared.h | 5 +- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 5 + .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 3 + drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h | 2 + drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 32 +- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 27 + drivers/gpu/drm/amd/powerplay/smu_internal.h | 4 + drivers/gpu/drm/amd/powerplay/smu_v12_0.c | 11 + 31 files changed, 2593 insertions(+), 1346 deletions(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.h create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.h create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 5 lines · Leo Liu
From JPEG2.0, JPEG is a separated IP block, and has it own PG/CG, and power management. It doesn't require FW, so indepedent from FW loading as well.
Quoted 8 lines
Patch 1-4: Separate JPEG1.0 from SW wise, since JPEG1.0 is still combined with VCN1.0 esp. in power management;
Patch 5-10: Separate JPEG2.0 as an independent IP with PG/CG; Patch 11-15: Add power management for JPEG of Navi1x and Renoir; Patch 16: Enable JPEG2.0;
Patch 17-20: Separate JPEG2.5 from VCN2.5;
Patch 21: Enable JPEG2.5
Is the jpeg powergating dynamic or do we need a idle work thread to turn it off like we do for vcn?
Alex
Quoted 64 lines
Leo Liu (21):
drm/amdgpu: add JPEG HW IP and SW structures drm/amdgpu: addamdgpu_jpegand JPEG tests drm/amdgpu: separate JPEG1.0 code out from VCN1.0 drm/amdgpu: use the JPEG structure for general driver support drm/amdgpu: add JPEG IP block type
drm/amdgpu: add JPEG common functions toamdgpu_jpegdrm/amdgpu: add JPEG v2.0 function supports drm/amdgpu: remove unnecessary JPEG2.0 code from VCN2.0 drm/amdgpu: add JPEG PG and CG interface drm/amdgpu: add PG and CG for JPEG2.0 drm/amd/powerplay: add JPEG Powerplay interface drm/amd/powerplay: add JPEG power control for Navi1x drm/amd/powerplay: add Powergate JPEG for Renoir drm/amd/powerplay: add JPEG power control for Renoir drm/amd/powerplay: set JPEG to SMU dpm
drm/amdgpu: enable JPEG2.0 dpm
drm/amdgpu: add driver support for JPEG2.0 and above drm/amdgpu: enable JPEG2.0 for Navi1x and Renoir drm/amdgpu: move JPEG2.5 out from VCN2.5 drm/amdgpu: enable Arcturus CG for VCN and JPEG blocks drm/amdgpu: enable Arcturus JPEG2.5 blockdrivers/gpu/drm/amd/amdgpu/Makefile | 8 +- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 5 + drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 215 +++++ drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h | 62 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 15 +- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 8 + drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 113 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 5 - drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c | 584 +++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.h | 32 + drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 827 ++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.h | 42 + drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 641 ++++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h | 29 + drivers/gpu/drm/amd/amdgpu/nv.c | 11 +- drivers/gpu/drm/amd/amdgpu/soc15.c | 10 +- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 481 +--------- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 496 +---------- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.h | 13 - drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 246 +----- drivers/gpu/drm/amd/include/amd_shared.h | 5 +- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 5 + .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 3 + drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h | 2 + drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 32 +- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 27 + drivers/gpu/drm/amd/powerplay/smu_internal.h | 4 + drivers/gpu/drm/amd/powerplay/smu_v12_0.c | 11 + 31 files changed, 2593 insertions(+), 1346 deletions(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.h create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.h create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h
Quoted 7 lines
--
2.17.1_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): CADnq5_NVBemrfE5OB=NBeb5XM5HPWdnhjaWM0KjdDyb6+pm9zA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 13 lines · Alex Deucher
Quoted 4 lines · Leo Liu
From JPEG2.0, JPEG is a separated IP block, and has it own PG/CG,
and power management. It doesn't require FW, so indepedent from FW loading as well.Quoted 8 lines
Patch 1-4: Separate JPEG1.0 from SW wise, since JPEG1.0 is still combined with VCN1.0 esp. in power management;
Patch 5-10: Separate JPEG2.0 as an independent IP with PG/CG; Patch 11-15: Add power management for JPEG of Navi1x and Renoir; Patch 16: Enable JPEG2.0;
Patch 17-20: Separate JPEG2.5 from VCN2.5;
Patch 21: Enable JPEG2.5
Quoted 2 lines
Is the jpeg powergating dynamic or do we need a idle work thread to turn it off like we do for vcn?
It has static PG/CG for JPEG2.0 and static CG for JPEG2.5.
It also has DPM for JPEG2.0. So we need idle work thread and begin_use like VCN to init/deinit JPEG and turn on/off JPEG power through SMU messages such as PowerUPJpeg and PowerDownJpeg.
Thanks,
Leo
Quoted 74 lines
Alex
Quoted 71 lines
Leo Liu (21):
drm/amdgpu: add JPEG HW IP and SW structures drm/amdgpu: addamdgpu_jpegand JPEG tests drm/amdgpu: separate JPEG1.0 code out from VCN1.0 drm/amdgpu: use the JPEG structure for general driver support drm/amdgpu: add JPEG IP block type
drm/amdgpu: add JPEG common functions toamdgpu_jpegdrm/amdgpu: add JPEG v2.0 function supports drm/amdgpu: remove unnecessary JPEG2.0 code from VCN2.0 drm/amdgpu: add JPEG PG and CG interface drm/amdgpu: add PG and CG for JPEG2.0 drm/amd/powerplay: add JPEG Powerplay interface drm/amd/powerplay: add JPEG power control for Navi1x drm/amd/powerplay: add Powergate JPEG for Renoir drm/amd/powerplay: add JPEG power control for Renoir drm/amd/powerplay: set JPEG to SMU dpm
drm/amdgpu: enable JPEG2.0 dpm
drm/amdgpu: add driver support for JPEG2.0 and above drm/amdgpu: enable JPEG2.0 for Navi1x and Renoir drm/amdgpu: move JPEG2.5 out from VCN2.5 drm/amdgpu: enable Arcturus CG for VCN and JPEG blocks drm/amdgpu: enable Arcturus JPEG2.5 blockdrivers/gpu/drm/amd/amdgpu/Makefile | 8 +- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 5 + drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 215 +++++ drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h | 62 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 15 +- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 8 + drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 113 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 5 - drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c | 584 +++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.h | 32 + drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 827 ++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.h | 42 + drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 641 ++++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h | 29 + drivers/gpu/drm/amd/amdgpu/nv.c | 11 +- drivers/gpu/drm/amd/amdgpu/soc15.c | 10 +- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 481 +--------- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 496 +---------- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.h | 13 - drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 246 +----- drivers/gpu/drm/amd/include/amd_shared.h | 5 +- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 5 + .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 3 + drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h | 2 + drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 32 +- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 27 + drivers/gpu/drm/amd/powerplay/smu_internal.h | 4 + drivers/gpu/drm/amd/powerplay/smu_v12_0.c | 11 + 31 files changed, 2593 insertions(+), 1346 deletions(-)create mode 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.hcreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.hcreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.hcreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h--
2.17.1_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 171a5818-a2b5-6e91-ac35-050b43963988-5C7GfCeVMHo@public.gmane.org
Quoted 16 lines · Leo Liu
Quoted 13 lines · Alex Deucher
Quoted 12 lines · Leo Liu
From JPEG2.0, JPEG is a separated IP block, and has it own PG/CG,
and power management. It doesn't require FW, so indepedent from FW loading as well.Patch 1-4: Separate JPEG1.0 from SW wise, since JPEG1.0 is still combined with VCN1.0 esp. in power management;
Patch 5-10: Separate JPEG2.0 as an independent IP with PG/CG; Patch 11-15: Add power management for JPEG of Navi1x and Renoir; Patch 16: Enable JPEG2.0;
Patch 17-20: Separate JPEG2.5 from VCN2.5;
Patch 21: Enable JPEG2.5
Quoted 8 lines
Quoted 2 lines
Is the jpeg powergating dynamic or do we need a idle work thread to turn it off like we do for vcn?
It has static PG/CG for JPEG2.0 and static CG for JPEG2.5.
It also has DPM for JPEG2.0. So we need idle work thread and
begin_uselike VCN to init/deinit JPEG and turn on/off JPEG power through SMU messages such as PowerUPJpeg and PowerDownJpeg.
Ok, so that still has to be implemented then. I didn't see that in the patch set.
Thanks,
Alex
Quoted 80 lines
Thanks,
LeoQuoted 74 lines
Alex
Quoted 71 lines
Leo Liu (21):
drm/amdgpu: add JPEG HW IP and SW structures drm/amdgpu: addamdgpu_jpegand JPEG tests drm/amdgpu: separate JPEG1.0 code out from VCN1.0 drm/amdgpu: use the JPEG structure for general driver support drm/amdgpu: add JPEG IP block type
drm/amdgpu: add JPEG common functions toamdgpu_jpegdrm/amdgpu: add JPEG v2.0 function supports drm/amdgpu: remove unnecessary JPEG2.0 code from VCN2.0 drm/amdgpu: add JPEG PG and CG interface drm/amdgpu: add PG and CG for JPEG2.0 drm/amd/powerplay: add JPEG Powerplay interface drm/amd/powerplay: add JPEG power control for Navi1x drm/amd/powerplay: add Powergate JPEG for Renoir drm/amd/powerplay: add JPEG power control for Renoir drm/amd/powerplay: set JPEG to SMU dpm
drm/amdgpu: enable JPEG2.0 dpm
drm/amdgpu: add driver support for JPEG2.0 and above drm/amdgpu: enable JPEG2.0 for Navi1x and Renoir drm/amdgpu: move JPEG2.5 out from VCN2.5 drm/amdgpu: enable Arcturus CG for VCN and JPEG blocks drm/amdgpu: enable Arcturus JPEG2.5 blockdrivers/gpu/drm/amd/amdgpu/Makefile | 8 +- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 5 + drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 215 +++++ drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h | 62 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 15 +- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 8 + drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 113 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 5 - drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c | 584 +++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.h | 32 + drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 827 ++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.h | 42 + drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 641 ++++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h | 29 + drivers/gpu/drm/amd/amdgpu/nv.c | 11 +- drivers/gpu/drm/amd/amdgpu/soc15.c | 10 +- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 481 +--------- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 496 +---------- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.h | 13 - drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 246 +----- drivers/gpu/drm/amd/include/amd_shared.h | 5 +- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 5 + .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 3 + drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h | 2 + drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 32 +- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 27 + drivers/gpu/drm/amd/powerplay/smu_internal.h | 4 + drivers/gpu/drm/amd/powerplay/smu_v12_0.c | 11 + 31 files changed, 2593 insertions(+), 1346 deletions(-)create mode 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.hcreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.hcreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.hcreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h--
2.17.1_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): CADnq5_MRfvfE1D5SPOWTyWZFnLZezZ3N61QXvrwnLFssM++LrA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 18 lines · Alex Deucher
Quoted 17 lines · Leo Liu
Quoted 15 lines · Alex Deucher
Quoted 4 lines · Leo Liu
From JPEG2.0, JPEG is a separated IP block, and has it own PG/CG,
and power management. It doesn't require FW, so indepedent from FW loading as well.Quoted 8 lines
Patch 1-4: Separate JPEG1.0 from SW wise, since JPEG1.0 is still combined with VCN1.0 esp. in power management;
Patch 5-10: Separate JPEG2.0 as an independent IP with PG/CG; Patch 11-15: Add power management for JPEG of Navi1x and Renoir; Patch 16: Enable JPEG2.0;
Patch 17-20: Separate JPEG2.5 from VCN2.5;
Patch 21: Enable JPEG2.5Is the jpeg powergating dynamic or do we need a idle work thread to turn it off like we do for vcn?
Quoted 7 lines
Quoted 5 lines
It has static PG/CG for JPEG2.0 and static CG for JPEG2.5.
It also has DPM for JPEG2.0. So we need idle work thread and
begin_uselike VCN to init/deinit JPEG and turn on/off JPEG power through SMU messages such as PowerUPJpeg and PowerDownJpeg.Ok, so that still has to be implemented then. I didn't see that in the patch set.
"amdgpu_jpeg_idle_work_handler" is in patch 6, and calling those SMU messages are in those powerplay patches.
The set is complete for all JPEGs
Thanks,
Leo
Quoted 82 lines
Thanks,
Alex
Quoted 78 lines
Thanks,
LeoQuoted 73 lines
Alex
Quoted 71 lines
Leo Liu (21):
drm/amdgpu: add JPEG HW IP and SW structures drm/amdgpu: addamdgpu_jpegand JPEG tests drm/amdgpu: separate JPEG1.0 code out from VCN1.0 drm/amdgpu: use the JPEG structure for general driver support drm/amdgpu: add JPEG IP block type
drm/amdgpu: add JPEG common functions toamdgpu_jpegdrm/amdgpu: add JPEG v2.0 function supports drm/amdgpu: remove unnecessary JPEG2.0 code from VCN2.0 drm/amdgpu: add JPEG PG and CG interface drm/amdgpu: add PG and CG for JPEG2.0 drm/amd/powerplay: add JPEG Powerplay interface drm/amd/powerplay: add JPEG power control for Navi1x drm/amd/powerplay: add Powergate JPEG for Renoir drm/amd/powerplay: add JPEG power control for Renoir drm/amd/powerplay: set JPEG to SMU dpm
drm/amdgpu: enable JPEG2.0 dpm
drm/amdgpu: add driver support for JPEG2.0 and above drm/amdgpu: enable JPEG2.0 for Navi1x and Renoir drm/amdgpu: move JPEG2.5 out from VCN2.5 drm/amdgpu: enable Arcturus CG for VCN and JPEG blocks drm/amdgpu: enable Arcturus JPEG2.5 blockdrivers/gpu/drm/amd/amdgpu/Makefile | 8 +- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 5 + drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 215 +++++ drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h | 62 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 15 +- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 8 + drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 113 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 5 - drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c | 584 +++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.h | 32 + drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 827 ++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.h | 42 + drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 641 ++++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h | 29 + drivers/gpu/drm/amd/amdgpu/nv.c | 11 +- drivers/gpu/drm/amd/amdgpu/soc15.c | 10 +- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 481 +--------- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 496 +---------- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.h | 13 - drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 246 +----- drivers/gpu/drm/amd/include/amd_shared.h | 5 +- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 5 + .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 3 + drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h | 2 + drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 32 +- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 27 + drivers/gpu/drm/amd/powerplay/smu_internal.h | 4 + drivers/gpu/drm/amd/powerplay/smu_v12_0.c | 11 + 31 files changed, 2593 insertions(+), 1346 deletions(-)create mode 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.hcreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.hcreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.hcreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h--
2.17.1_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): bf523547-408a-536d-5f61-226691058a7b-5C7GfCeVMHo@public.gmane.org
Quoted 26 lines · Leo Liu
Quoted 23 lines · Alex Deucher
Quoted 22 lines · Leo Liu
Quoted 13 lines · Alex Deucher
Quoted 4 lines · Leo Liu
From JPEG2.0, JPEG is a separated IP block, and has it own PG/CG,
and power management. It doesn't require FW, so indepedent from FW loading as well.Quoted 8 lines
Patch 1-4: Separate JPEG1.0 from SW wise, since JPEG1.0 is still combined with VCN1.0 esp. in power management;
Patch 5-10: Separate JPEG2.0 as an independent IP with PG/CG; Patch 11-15: Add power management for JPEG of Navi1x and Renoir; Patch 16: Enable JPEG2.0;
Patch 17-20: Separate JPEG2.5 from VCN2.5;
Patch 21: Enable JPEG2.5Quoted 2 lines
Is the jpeg powergating dynamic or do we need a idle work thread to turn it off like we do for vcn?
It has static PG/CG for JPEG2.0 and static CG for JPEG2.5.
It also has DPM for JPEG2.0. So we need idle work thread and
begin_uselike VCN to init/deinit JPEG and turn on/off JPEG power through SMU messages such as PowerUPJpeg and PowerDownJpeg.
Quoted 6 lines
Quoted 2 lines
Ok, so that still has to be implemented then. I didn't see that in the patch set.
"
amdgpu_jpeg_idle_work_handler" is in patch 6, and calling those SMU messages are in those powerplay patches.The set is complete for all JPEGs
Ah, yeah, I missed that patch the first time around. Thanks!
Alex
Quoted 87 lines
Thanks,
LeoQuoted 82 lines
Thanks,
Alex
Quoted 78 lines
Thanks,
LeoQuoted 73 lines
Alex
Quoted 71 lines
Leo Liu (21):
drm/amdgpu: add JPEG HW IP and SW structures drm/amdgpu: addamdgpu_jpegand JPEG tests drm/amdgpu: separate JPEG1.0 code out from VCN1.0 drm/amdgpu: use the JPEG structure for general driver support drm/amdgpu: add JPEG IP block type
drm/amdgpu: add JPEG common functions toamdgpu_jpegdrm/amdgpu: add JPEG v2.0 function supports drm/amdgpu: remove unnecessary JPEG2.0 code from VCN2.0 drm/amdgpu: add JPEG PG and CG interface drm/amdgpu: add PG and CG for JPEG2.0 drm/amd/powerplay: add JPEG Powerplay interface drm/amd/powerplay: add JPEG power control for Navi1x drm/amd/powerplay: add Powergate JPEG for Renoir drm/amd/powerplay: add JPEG power control for Renoir drm/amd/powerplay: set JPEG to SMU dpm
drm/amdgpu: enable JPEG2.0 dpm
drm/amdgpu: add driver support for JPEG2.0 and above drm/amdgpu: enable JPEG2.0 for Navi1x and Renoir drm/amdgpu: move JPEG2.5 out from VCN2.5 drm/amdgpu: enable Arcturus CG for VCN and JPEG blocks drm/amdgpu: enable Arcturus JPEG2.5 blockdrivers/gpu/drm/amd/amdgpu/Makefile | 8 +- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 5 + drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 215 +++++ drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h | 62 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 15 +- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 8 + drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 113 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 5 - drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c | 584 +++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.h | 32 + drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 827 ++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.h | 42 + drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 641 ++++++++++++++ drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h | 29 + drivers/gpu/drm/amd/amdgpu/nv.c | 11 +- drivers/gpu/drm/amd/amdgpu/soc15.c | 10 +- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 481 +--------- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 496 +---------- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.h | 13 - drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 246 +----- drivers/gpu/drm/amd/include/amd_shared.h | 5 +- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 5 + .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 3 + drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h | 2 + drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 32 +- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 27 + drivers/gpu/drm/amd/powerplay/smu_internal.h | 4 + drivers/gpu/drm/amd/powerplay/smu_v12_0.c | 11 + 31 files changed, 2593 insertions(+), 1346 deletions(-)create mode 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.hcreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.hcreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.hcreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h--
2.17.1_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): CADnq5_NjNPZC=2xt5Qft6_jiZnbdtR+LqogTWdfty_N_zWR_uA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 25 lines · Alex Deucher
Quoted 24 lines · Leo Liu
Quoted 22 lines · Alex Deucher
Quoted 21 lines · Leo Liu
Quoted 13 lines · Alex Deucher
Quoted 4 lines · Leo Liu
From JPEG2.0, JPEG is a separated IP block, and has it own PG/CG,
and power management. It doesn't require FW, so indepedent from FW loading as well.Quoted 8 lines
Patch 1-4: Separate JPEG1.0 from SW wise, since JPEG1.0 is still combined with VCN1.0 esp. in power management;
Patch 5-10: Separate JPEG2.0 as an independent IP with PG/CG; Patch 11-15: Add power management for JPEG of Navi1x and Renoir; Patch 16: Enable JPEG2.0;
Patch 17-20: Separate JPEG2.5 from VCN2.5;
Patch 21: Enable JPEG2.5Quoted 2 lines
Is the jpeg powergating dynamic or do we need a idle work thread to turn it off like we do for vcn?
It has static PG/CG for JPEG2.0 and static CG for JPEG2.5.
It also has DPM for JPEG2.0. So we need idle work thread and
begin_uselike VCN to init/deinit JPEG and turn on/off JPEG power through SMU messages such as PowerUPJpeg and PowerDownJpeg.
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines
Ok, so that still has to be implemented then. I didn't see that in the patch set.
"
amdgpu_jpeg_idle_work_handler" is in patch 6, and calling those SMU messages are in those powerplay patches.The set is complete for all JPEGs
Ah, yeah, I missed that patch the first time around. Thanks!
Yeah, the set is too big. Sorry about that. Should do this changes earlier, but just get around to it:-)
Leo
Quoted 88 lines
Alex
Quoted 85 lines
Thanks,
LeoQuoted 81 lines
Thanks,
Alex
Quoted 77 lines
Thanks,
LeoQuoted 73 lines
Alex
Quoted 71 lines
Leo Liu (21):
drm/amdgpu: add JPEG HW IP and SW structures drm/amdgpu: addamdgpu_jpegand JPEG tests drm/amdgpu: separate JPEG1.0 code out from VCN1.0 drm/amdgpu: use the JPEG structure for general driver support drm/amdgpu: add JPEG IP block type
drm/amdgpu: add JPEG common functions toamdgpu_jpegdrm/amdgpu: add JPEG v2.0 function supports drm/amdgpu: remove unnecessary JPEG2.0 code from VCN2.0 drm/amdgpu: add JPEG PG and CG interface drm/amdgpu: add PG and CG for JPEG2.0 drm/amd/powerplay: add JPEG Powerplay interface drm/amd/powerplay: add JPEG power control for Navi1x drm/amd/powerplay: add Powergate JPEG for Renoir drm/amd/powerplay: add JPEG power control for Renoir drm/amd/powerplay: set JPEG to SMU dpm
drm/amdgpu: enable JPEG2.0 dpm
drm/amdgpu: add driver support for JPEG2.0 and above drm/amdgpu: enable JPEG2.0 for Navi1x and Renoir drm/amdgpu: move JPEG2.5 out from VCN2.5 drm/amdgpu: enable Arcturus CG for VCN and JPEG blocks drm/amdgpu: enable Arcturus JPEG2.5 block
drivers/gpu/drm/amd/amdgpu/Makefile| 8 +-
drivers/gpu/drm/amd/amdgpu/amdgpu.h| 5 +
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c| 4 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 2 +
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c| 215 +++++
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h| 62 ++
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c| 15 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c| 8 +
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h| 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c| 113 +--
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h| 5 -
drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c| 584 +++++++++++++
drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.h| 32 +
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c| 827 ++++++++++++++++++
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.h| 42 +
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c| 641 ++++++++++++++
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h| 29 +
drivers/gpu/drm/amd/amdgpu/nv.c| 11 +-
drivers/gpu/drm/amd/amdgpu/soc15.c| 10 +-
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c| 481 +---------
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c| 496 +----------
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.h| 13 -
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c| 246 +-----
drivers/gpu/drm/amd/include/amd_shared.h| 5 +-
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c| 5 +
.../gpu/drm/amd/powerplay/inc/amdgpu_smu.h| 3 +
drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h| 2 +
drivers/gpu/drm/amd/powerplay/navi10_ppt.c| 32 +-
drivers/gpu/drm/amd/powerplay/renoir_ppt.c| 27 +
drivers/gpu/drm/amd/powerplay/smu_internal.h| 4 +
drivers/gpu/drm/amd/powerplay/smu_v12_0.c| 11 +
31 files changed, 2593 insertions(+), 1346 deletions(-) create mode 100644drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.hcreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.hcreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.hcreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.ccreate mode 100644drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.h--
2.17.1_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx