Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
d55a43a3
Commit
d55a43a3
authored
May 11, 2015
by
Alex Deucher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/radeon: add support for vce 1.0 clock gating
Signed-off-by:
Alex Deucher
<
alexander.deucher@amd.com
>
parent
a918efab
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
0 deletions
+60
-0
drivers/gpu/drm/radeon/radeon_asic.c
drivers/gpu/drm/radeon/radeon_asic.c
+2
-0
drivers/gpu/drm/radeon/sid.h
drivers/gpu/drm/radeon/sid.h
+1
-0
drivers/gpu/drm/radeon/vce_v1_0.c
drivers/gpu/drm/radeon/vce_v1_0.c
+57
-0
No files found.
drivers/gpu/drm/radeon/radeon_asic.c
View file @
d55a43a3
...
...
@@ -2455,6 +2455,8 @@ int radeon_asic_init(struct radeon_device *rdev)
/* set num crtcs */
rdev
->
num_crtc
=
4
;
rdev
->
has_uvd
=
true
;
rdev
->
cg_flags
=
RADEON_CG_SUPPORT_VCE_MGCG
;
break
;
case
CHIP_TAHITI
:
case
CHIP_PITCAIRN
:
...
...
drivers/gpu/drm/radeon/sid.h
View file @
d55a43a3
...
...
@@ -1894,6 +1894,7 @@
#define VCE_RB_RPTR 0x2018c
#define VCE_RB_WPTR 0x20190
#define VCE_CLOCK_GATING_A 0x202f8
# define CGC_DYN_CLOCK_MODE (1 << 16)
#define VCE_CLOCK_GATING_B 0x202fc
#define VCE_UENC_CLOCK_GATING 0x205bc
#define VCE_UENC_REG_CLOCK_GATING 0x205c0
...
...
drivers/gpu/drm/radeon/vce_v1_0.c
View file @
d55a43a3
...
...
@@ -99,6 +99,61 @@ void vce_v1_0_set_wptr(struct radeon_device *rdev,
WREG32
(
VCE_RB_WPTR2
,
ring
->
wptr
);
}
void
vce_v1_0_enable_mgcg
(
struct
radeon_device
*
rdev
,
bool
enable
)
{
u32
tmp
;
if
(
enable
&&
(
rdev
->
cg_flags
&
RADEON_CG_SUPPORT_VCE_MGCG
))
{
tmp
=
RREG32
(
VCE_CLOCK_GATING_A
);
tmp
|=
CGC_DYN_CLOCK_MODE
;
WREG32
(
VCE_CLOCK_GATING_A
,
tmp
);
tmp
=
RREG32
(
VCE_UENC_CLOCK_GATING
);
tmp
&=
~
0x1ff000
;
tmp
|=
0xff800000
;
WREG32
(
VCE_UENC_CLOCK_GATING
,
tmp
);
tmp
=
RREG32
(
VCE_UENC_REG_CLOCK_GATING
);
tmp
&=
~
0x3ff
;
WREG32
(
VCE_UENC_REG_CLOCK_GATING
,
tmp
);
}
else
{
tmp
=
RREG32
(
VCE_CLOCK_GATING_A
);
tmp
&=
~
CGC_DYN_CLOCK_MODE
;
WREG32
(
VCE_CLOCK_GATING_A
,
tmp
);
tmp
=
RREG32
(
VCE_UENC_CLOCK_GATING
);
tmp
|=
0x1ff000
;
tmp
&=
~
0xff800000
;
WREG32
(
VCE_UENC_CLOCK_GATING
,
tmp
);
tmp
=
RREG32
(
VCE_UENC_REG_CLOCK_GATING
);
tmp
|=
0x3ff
;
WREG32
(
VCE_UENC_REG_CLOCK_GATING
,
tmp
);
}
}
static
void
vce_v1_0_init_cg
(
struct
radeon_device
*
rdev
)
{
u32
tmp
;
tmp
=
RREG32
(
VCE_CLOCK_GATING_A
);
tmp
|=
CGC_DYN_CLOCK_MODE
;
WREG32
(
VCE_CLOCK_GATING_A
,
tmp
);
tmp
=
RREG32
(
VCE_CLOCK_GATING_B
);
tmp
|=
0x1e
;
tmp
&=
~
0xe100e1
;
WREG32
(
VCE_CLOCK_GATING_B
,
tmp
);
tmp
=
RREG32
(
VCE_UENC_CLOCK_GATING
);
tmp
&=
~
0xff9ff000
;
WREG32
(
VCE_UENC_CLOCK_GATING
,
tmp
);
tmp
=
RREG32
(
VCE_UENC_REG_CLOCK_GATING
);
tmp
&=
~
0x3ff
;
WREG32
(
VCE_UENC_REG_CLOCK_GATING
,
tmp
);
}
int
vce_v1_0_load_fw
(
struct
radeon_device
*
rdev
,
uint32_t
*
data
)
{
struct
vce_v1_0_fw_signature
*
sign
=
(
void
*
)
rdev
->
vce_fw
->
data
;
...
...
@@ -219,6 +274,8 @@ int vce_v1_0_resume(struct radeon_device *rdev)
if
(
i
==
10
)
return
-
ETIMEDOUT
;
vce_v1_0_init_cg
(
rdev
);
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment