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
bc5289ee
Commit
bc5289ee
authored
Oct 26, 2016
by
Rob Clark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/msm/mdp5: add debugfs to show smp block status
Signed-off-by:
Rob Clark
<
robdclark@gmail.com
>
parent
49ec5b2e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
116 additions
and
3 deletions
+116
-3
drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
+52
-0
drivers/gpu/drm/msm/mdp/mdp5/mdp5_smp.c
drivers/gpu/drm/msm/mdp/mdp5/mdp5_smp.c
+40
-0
drivers/gpu/drm/msm/mdp/mdp5/mdp5_smp.h
drivers/gpu/drm/msm/mdp/mdp5/mdp5_smp.h
+4
-0
drivers/gpu/drm/msm/msm_debugfs.c
drivers/gpu/drm/msm/msm_debugfs.c
+14
-2
drivers/gpu/drm/msm/msm_drv.h
drivers/gpu/drm/msm/msm_drv.h
+1
-1
drivers/gpu/drm/msm/msm_kms.h
drivers/gpu/drm/msm/msm_kms.h
+5
-0
No files found.
drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
View file @
bc5289ee
...
@@ -173,6 +173,53 @@ static void mdp5_kms_destroy(struct msm_kms *kms)
...
@@ -173,6 +173,53 @@ static void mdp5_kms_destroy(struct msm_kms *kms)
}
}
}
}
#ifdef CONFIG_DEBUG_FS
static
int
smp_show
(
struct
seq_file
*
m
,
void
*
arg
)
{
struct
drm_info_node
*
node
=
(
struct
drm_info_node
*
)
m
->
private
;
struct
drm_device
*
dev
=
node
->
minor
->
dev
;
struct
msm_drm_private
*
priv
=
dev
->
dev_private
;
struct
mdp5_kms
*
mdp5_kms
=
to_mdp5_kms
(
to_mdp_kms
(
priv
->
kms
));
struct
drm_printer
p
=
drm_seq_file_printer
(
m
);
if
(
!
mdp5_kms
->
smp
)
{
drm_printf
(
&
p
,
"no SMP pool
\n
"
);
return
0
;
}
mdp5_smp_dump
(
mdp5_kms
->
smp
,
&
p
);
return
0
;
}
static
struct
drm_info_list
mdp5_debugfs_list
[]
=
{
{
"smp"
,
smp_show
},
};
static
int
mdp5_kms_debugfs_init
(
struct
msm_kms
*
kms
,
struct
drm_minor
*
minor
)
{
struct
drm_device
*
dev
=
minor
->
dev
;
int
ret
;
ret
=
drm_debugfs_create_files
(
mdp5_debugfs_list
,
ARRAY_SIZE
(
mdp5_debugfs_list
),
minor
->
debugfs_root
,
minor
);
if
(
ret
)
{
dev_err
(
dev
->
dev
,
"could not install mdp5_debugfs_list
\n
"
);
return
ret
;
}
return
0
;
}
static
void
mdp5_kms_debugfs_cleanup
(
struct
msm_kms
*
kms
,
struct
drm_minor
*
minor
)
{
drm_debugfs_remove_files
(
mdp5_debugfs_list
,
ARRAY_SIZE
(
mdp5_debugfs_list
),
minor
);
}
#endif
static
const
struct
mdp_kms_funcs
kms_funcs
=
{
static
const
struct
mdp_kms_funcs
kms_funcs
=
{
.
base
=
{
.
base
=
{
.
hw_init
=
mdp5_hw_init
,
.
hw_init
=
mdp5_hw_init
,
...
@@ -190,6 +237,10 @@ static const struct mdp_kms_funcs kms_funcs = {
...
@@ -190,6 +237,10 @@ static const struct mdp_kms_funcs kms_funcs = {
.
round_pixclk
=
mdp5_round_pixclk
,
.
round_pixclk
=
mdp5_round_pixclk
,
.
set_split_display
=
mdp5_set_split_display
,
.
set_split_display
=
mdp5_set_split_display
,
.
destroy
=
mdp5_kms_destroy
,
.
destroy
=
mdp5_kms_destroy
,
#ifdef CONFIG_DEBUG_FS
.
debugfs_init
=
mdp5_kms_debugfs_init
,
.
debugfs_cleanup
=
mdp5_kms_debugfs_cleanup
,
#endif
},
},
.
set_irqmask
=
mdp5_set_irqmask
,
.
set_irqmask
=
mdp5_set_irqmask
,
};
};
...
@@ -392,6 +443,7 @@ static int modeset_init(struct mdp5_kms *mdp5_kms)
...
@@ -392,6 +443,7 @@ static int modeset_init(struct mdp5_kms *mdp5_kms)
dev_err
(
dev
->
dev
,
"failed to construct plane %d (%d)
\n
"
,
i
,
ret
);
dev_err
(
dev
->
dev
,
"failed to construct plane %d (%d)
\n
"
,
i
,
ret
);
goto
fail
;
goto
fail
;
}
}
priv
->
planes
[
priv
->
num_planes
++
]
=
plane
;
if
(
!
primary
)
if
(
!
primary
)
continue
;
continue
;
...
...
drivers/gpu/drm/msm/mdp/mdp5/mdp5_smp.c
View file @
bc5289ee
...
@@ -292,6 +292,46 @@ void mdp5_smp_complete_commit(struct mdp5_smp *smp, struct mdp5_smp_state *state
...
@@ -292,6 +292,46 @@ void mdp5_smp_complete_commit(struct mdp5_smp *smp, struct mdp5_smp_state *state
state
->
released
=
0
;
state
->
released
=
0
;
}
}
void
mdp5_smp_dump
(
struct
mdp5_smp
*
smp
,
struct
drm_printer
*
p
)
{
struct
mdp5_kms
*
mdp5_kms
=
get_kms
(
smp
);
struct
mdp5_hw_pipe_state
*
hwpstate
;
struct
mdp5_smp_state
*
state
;
int
total
=
0
,
i
,
j
;
drm_printf
(
p
,
"name
\t
inuse
\t
plane
\n
"
);
drm_printf
(
p
,
"----
\t
-----
\t
-----
\n
"
);
drm_modeset_lock
(
&
mdp5_kms
->
state_lock
,
NULL
);
/* grab these *after* we hold the state_lock */
hwpstate
=
&
mdp5_kms
->
state
->
hwpipe
;
state
=
&
mdp5_kms
->
state
->
smp
;
for
(
i
=
0
;
i
<
mdp5_kms
->
num_hwpipes
;
i
++
)
{
struct
mdp5_hw_pipe
*
hwpipe
=
mdp5_kms
->
hwpipes
[
i
];
struct
drm_plane
*
plane
=
hwpstate
->
hwpipe_to_plane
[
hwpipe
->
idx
];
enum
mdp5_pipe
pipe
=
hwpipe
->
pipe
;
for
(
j
=
0
;
j
<
pipe2nclients
(
pipe
);
j
++
)
{
u32
cid
=
pipe2client
(
pipe
,
j
);
void
*
cs
=
state
->
client_state
[
cid
];
int
inuse
=
bitmap_weight
(
cs
,
smp
->
blk_cnt
);
drm_printf
(
p
,
"%s:%d
\t
%d
\t
%s
\n
"
,
pipe2name
(
pipe
),
j
,
inuse
,
plane
?
plane
->
name
:
NULL
);
total
+=
inuse
;
}
}
drm_printf
(
p
,
"TOTAL:
\t
%d
\t
(of %d)
\n
"
,
total
,
smp
->
blk_cnt
);
drm_printf
(
p
,
"AVAIL:
\t
%d
\n
"
,
smp
->
blk_cnt
-
bitmap_weight
(
state
->
state
,
smp
->
blk_cnt
));
drm_modeset_unlock
(
&
mdp5_kms
->
state_lock
);
}
void
mdp5_smp_destroy
(
struct
mdp5_smp
*
smp
)
void
mdp5_smp_destroy
(
struct
mdp5_smp
*
smp
)
{
{
kfree
(
smp
);
kfree
(
smp
);
...
...
drivers/gpu/drm/msm/mdp/mdp5/mdp5_smp.h
View file @
bc5289ee
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
#ifndef __MDP5_SMP_H__
#ifndef __MDP5_SMP_H__
#define __MDP5_SMP_H__
#define __MDP5_SMP_H__
#include <drm/drm_print.h>
#include "msm_drv.h"
#include "msm_drv.h"
/*
/*
...
@@ -79,6 +81,8 @@ struct mdp5_smp *mdp5_smp_init(struct mdp5_kms *mdp5_kms,
...
@@ -79,6 +81,8 @@ struct mdp5_smp *mdp5_smp_init(struct mdp5_kms *mdp5_kms,
const
struct
mdp5_smp_block
*
cfg
);
const
struct
mdp5_smp_block
*
cfg
);
void
mdp5_smp_destroy
(
struct
mdp5_smp
*
smp
);
void
mdp5_smp_destroy
(
struct
mdp5_smp
*
smp
);
void
mdp5_smp_dump
(
struct
mdp5_smp
*
smp
,
struct
drm_printer
*
p
);
uint32_t
mdp5_smp_calculate
(
struct
mdp5_smp
*
smp
,
uint32_t
mdp5_smp_calculate
(
struct
mdp5_smp
*
smp
,
const
struct
mdp_format
*
format
,
const
struct
mdp_format
*
format
,
u32
width
,
bool
hdecim
);
u32
width
,
bool
hdecim
);
...
...
drivers/gpu/drm/msm/msm_debugfs.c
View file @
bc5289ee
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
#ifdef CONFIG_DEBUG_FS
#ifdef CONFIG_DEBUG_FS
#include "msm_drv.h"
#include "msm_drv.h"
#include "msm_gpu.h"
#include "msm_gpu.h"
#include "msm_kms.h"
#include "msm_debugfs.h"
#include "msm_debugfs.h"
static
int
msm_gpu_show
(
struct
drm_device
*
dev
,
struct
seq_file
*
m
)
static
int
msm_gpu_show
(
struct
drm_device
*
dev
,
struct
seq_file
*
m
)
...
@@ -142,6 +143,7 @@ int msm_debugfs_late_init(struct drm_device *dev)
...
@@ -142,6 +143,7 @@ int msm_debugfs_late_init(struct drm_device *dev)
int
msm_debugfs_init
(
struct
drm_minor
*
minor
)
int
msm_debugfs_init
(
struct
drm_minor
*
minor
)
{
{
struct
drm_device
*
dev
=
minor
->
dev
;
struct
drm_device
*
dev
=
minor
->
dev
;
struct
msm_drm_private
*
priv
=
dev
->
dev_private
;
int
ret
;
int
ret
;
ret
=
drm_debugfs_create_files
(
msm_debugfs_list
,
ret
=
drm_debugfs_create_files
(
msm_debugfs_list
,
...
@@ -153,15 +155,25 @@ int msm_debugfs_init(struct drm_minor *minor)
...
@@ -153,15 +155,25 @@ int msm_debugfs_init(struct drm_minor *minor)
return
ret
;
return
ret
;
}
}
return
0
;
if
(
priv
->
kms
->
funcs
->
debugfs_init
)
ret
=
priv
->
kms
->
funcs
->
debugfs_init
(
priv
->
kms
,
minor
);
return
ret
;
}
}
void
msm_debugfs_cleanup
(
struct
drm_minor
*
minor
)
void
msm_debugfs_cleanup
(
struct
drm_minor
*
minor
)
{
{
struct
drm_device
*
dev
=
minor
->
dev
;
struct
msm_drm_private
*
priv
=
dev
->
dev_private
;
drm_debugfs_remove_files
(
msm_debugfs_list
,
drm_debugfs_remove_files
(
msm_debugfs_list
,
ARRAY_SIZE
(
msm_debugfs_list
),
minor
);
ARRAY_SIZE
(
msm_debugfs_list
),
minor
);
if
(
!
minor
->
dev
->
dev_private
)
if
(
!
priv
)
return
;
return
;
if
(
priv
->
kms
->
funcs
->
debugfs_cleanup
)
priv
->
kms
->
funcs
->
debugfs_cleanup
(
priv
->
kms
,
minor
);
msm_rd_debugfs_cleanup
(
minor
);
msm_rd_debugfs_cleanup
(
minor
);
msm_perf_debugfs_cleanup
(
minor
);
msm_perf_debugfs_cleanup
(
minor
);
}
}
...
...
drivers/gpu/drm/msm/msm_drv.h
View file @
bc5289ee
...
@@ -132,7 +132,7 @@ struct msm_drm_private {
...
@@ -132,7 +132,7 @@ struct msm_drm_private {
struct
msm_gem_address_space
*
aspace
[
NUM_DOMAINS
];
struct
msm_gem_address_space
*
aspace
[
NUM_DOMAINS
];
unsigned
int
num_planes
;
unsigned
int
num_planes
;
struct
drm_plane
*
planes
[
8
];
struct
drm_plane
*
planes
[
16
];
unsigned
int
num_crtcs
;
unsigned
int
num_crtcs
;
struct
drm_crtc
*
crtcs
[
8
];
struct
drm_crtc
*
crtcs
[
8
];
...
...
drivers/gpu/drm/msm/msm_kms.h
View file @
bc5289ee
...
@@ -58,6 +58,11 @@ struct msm_kms_funcs {
...
@@ -58,6 +58,11 @@ struct msm_kms_funcs {
bool
is_cmd_mode
);
bool
is_cmd_mode
);
/* cleanup: */
/* cleanup: */
void
(
*
destroy
)(
struct
msm_kms
*
kms
);
void
(
*
destroy
)(
struct
msm_kms
*
kms
);
#ifdef CONFIG_DEBUG_FS
/* debugfs: */
int
(
*
debugfs_init
)(
struct
msm_kms
*
kms
,
struct
drm_minor
*
minor
);
void
(
*
debugfs_cleanup
)(
struct
msm_kms
*
kms
,
struct
drm_minor
*
minor
);
#endif
};
};
struct
msm_kms
{
struct
msm_kms
{
...
...
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