Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Michel Dänzer
xf86-video-amdgpu
Commits
442efe73
Commit
442efe73
authored
Apr 22, 2020
by
Michel Dänzer
Committed by
Michel Dänzer
May 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make drmmode_crtc_scanout_create/destroy static
And the latter inline.
parent
99f3c82e
Pipeline
#152209
passed with stages
in 1 minute and 37 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
35 deletions
+28
-35
src/amdgpu_kms.c
src/amdgpu_kms.c
+8
-5
src/drmmode_display.c
src/drmmode_display.c
+9
-26
src/drmmode_display.h
src/drmmode_display.h
+11
-4
No files found.
src/amdgpu_kms.c
View file @
442efe73
...
...
@@ -1231,8 +1231,7 @@ amdgpu_scanout_flip(ScreenPtr pScreen, AMDGPUInfoPtr info,
&
drmmode_crtc
->
scanout_last_region
);
RegionEmpty
(
&
drmmode_crtc
->
scanout_last_region
);
amdgpu_scanout_update
(
xf86_crtc
);
drmmode_crtc_scanout_destroy
(
drmmode_crtc
->
drmmode
,
&
drmmode_crtc
->
scanout
[
scanout_id
]);
drmmode_crtc_scanout_destroy
(
&
drmmode_crtc
->
scanout
[
scanout_id
]);
drmmode_crtc
->
tear_free
=
FALSE
;
return
;
}
...
...
@@ -2269,7 +2268,6 @@ void AMDGPULeaveVT_KMS(ScrnInfoPtr pScrn)
if
(
!
info
->
shadow_fb
)
{
AMDGPUEntPtr
pAMDGPUEnt
=
AMDGPUEntPriv
(
pScrn
);
xf86CrtcConfigPtr
xf86_config
=
XF86_CRTC_CONFIG_PTR
(
pScrn
);
PixmapPtr
black_scanout
=
NULL
;
xf86CrtcPtr
crtc
;
drmmode_crtc_private_ptr
drmmode_crtc
;
unsigned
w
=
0
,
h
=
0
;
...
...
@@ -2295,7 +2293,11 @@ void AMDGPULeaveVT_KMS(ScrnInfoPtr pScrn)
/* Make all active CRTCs scan out from an all-black framebuffer */
if
(
w
>
0
&&
h
>
0
)
{
if
(
drmmode_crtc_scanout_create
(
crtc
,
&
black_scanout
,
w
,
h
))
{
PixmapPtr
black_scanout
=
pScreen
->
CreatePixmap
(
pScreen
,
w
,
h
,
pScrn
->
depth
,
AMDGPU_CREATE_PIXMAP_SCANOUT
);
if
(
black_scanout
)
{
struct
drmmode_fb
*
black_fb
=
amdgpu_pixmap_get_fb
(
black_scanout
);
...
...
@@ -2327,11 +2329,12 @@ void AMDGPULeaveVT_KMS(ScrnInfoPtr pScrn)
}
}
}
pScreen
->
DestroyPixmap
(
black_scanout
);
}
}
xf86RotateFreeShadow
(
pScrn
);
drmmode_crtc_scanout_destroy
(
&
info
->
drmmode
,
&
black_scanout
);
/* Unreference FBs of all pixmaps. After this, the only FB remaining
* should be the all-black one being scanned out by active CRTCs
...
...
src/drmmode_display.c
View file @
442efe73
...
...
@@ -468,16 +468,6 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
return
;
}
void
drmmode_crtc_scanout_destroy
(
drmmode_ptr
drmmode
,
PixmapPtr
*
scanout
)
{
if
(
!*
scanout
)
return
;
(
*
scanout
)
->
drawable
.
pScreen
->
DestroyPixmap
(
*
scanout
);
(
*
scanout
)
=
NULL
;
}
void
drmmode_crtc_scanout_free
(
xf86CrtcPtr
crtc
)
{
...
...
@@ -490,30 +480,26 @@ drmmode_crtc_scanout_free(xf86CrtcPtr crtc)
amdgpu_drm_queue_handle_deferred
(
crtc
);
}
drmmode_crtc_scanout_destroy
(
drmmode_crtc
->
drmmode
,
&
drmmode_crtc
->
scanout
[
0
]);
drmmode_crtc_scanout_destroy
(
drmmode_crtc
->
drmmode
,
&
drmmode_crtc
->
scanout
[
1
]);
drmmode_crtc_scanout_destroy
(
&
drmmode_crtc
->
scanout
[
0
]);
drmmode_crtc_scanout_destroy
(
&
drmmode_crtc
->
scanout
[
1
]);
if
(
drmmode_crtc
->
scanout_damage
)
DamageDestroy
(
drmmode_crtc
->
scanout_damage
);
}
PixmapPtr
static
Bool
drmmode_crtc_scanout_create
(
xf86CrtcPtr
crtc
,
PixmapPtr
*
scanout
,
int
width
,
int
height
)
{
ScrnInfoPtr
pScrn
=
crtc
->
scrn
;
drmmode_crtc_private_ptr
drmmode_crtc
=
crtc
->
driver_private
;
drmmode_ptr
drmmode
=
drmmode_crtc
->
drmmode
;
ScreenPtr
screen
=
pScrn
->
pScreen
;
if
(
*
scanout
)
{
if
((
*
scanout
)
->
drawable
.
width
==
width
&&
(
*
scanout
)
->
drawable
.
height
==
height
)
return
*
scanout
;
return
TRUE
;
drmmode_crtc_scanout_destroy
(
drmmode
,
scanout
);
drmmode_crtc_scanout_destroy
(
scanout
);
}
*
scanout
=
screen
->
CreatePixmap
(
screen
,
width
,
height
,
pScrn
->
depth
,
...
...
@@ -526,10 +512,10 @@ drmmode_crtc_scanout_create(xf86CrtcPtr crtc, PixmapPtr *scanout,
if
(
!
amdgpu_pixmap_get_fb
(
*
scanout
))
{
ErrorF
(
"failed to create CRTC scanout FB
\n
"
);
error:
drmmode_crtc_scanout_destroy
(
drmmode
,
scanout
);
drmmode_crtc_scanout_destroy
(
scanout
);
}
return
*
scanout
;
return
FALSE
;
}
static
void
...
...
@@ -1313,7 +1299,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
drmmode_crtc_private_ptr
drmmode_crtc
=
crtc
->
driver_private
;
Bool
handle_deferred
=
FALSE
;
unsigned
scanout_id
=
0
;
drmmode_ptr
drmmode
=
drmmode_crtc
->
drmmode
;
int
saved_x
,
saved_y
;
Rotation
saved_rotation
;
DisplayModeRec
saved_mode
;
...
...
@@ -1436,8 +1421,7 @@ done:
fb
!=
amdgpu_pixmap_get_fb
(
drmmode_crtc
->
scanout
[
scanout_id
]))
{
drmmode_crtc_scanout_free
(
crtc
);
}
else
if
(
!
drmmode_crtc
->
tear_free
)
{
drmmode_crtc_scanout_destroy
(
drmmode
,
&
drmmode_crtc
->
scanout
[
1
]);
drmmode_crtc_scanout_destroy
(
&
drmmode_crtc
->
scanout
[
1
]);
}
}
...
...
@@ -1769,9 +1753,8 @@ drmmode_crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap,
void
*
data
)
{
drmmode_crtc_private_ptr
drmmode_crtc
=
crtc
->
driver_private
;
drmmode_ptr
drmmode
=
drmmode_crtc
->
drmmode
;
drmmode_crtc_scanout_destroy
(
drmmode
,
&
drmmode_crtc
->
rotate
);
drmmode_crtc_scanout_destroy
(
&
drmmode_crtc
->
rotate
);
}
static
void
...
...
src/drmmode_display.h
View file @
442efe73
...
...
@@ -234,6 +234,17 @@ drmmode_fb_reference_loc(int drm_fd, struct drmmode_fb **old, struct drmmode_fb
drmmode_fb_reference_loc(fd, old, new, __func__, __LINE__)
static
inline
void
drmmode_crtc_scanout_destroy
(
PixmapPtr
*
scanout
)
{
if
(
!*
scanout
)
return
;
(
*
scanout
)
->
drawable
.
pScreen
->
DestroyPixmap
(
*
scanout
);
(
*
scanout
)
=
NULL
;
}
extern
int
drmmode_page_flip_target_absolute
(
AMDGPUEntPtr
pAMDGPUEnt
,
drmmode_crtc_private_ptr
drmmode_crtc
,
int
fb_id
,
uint32_t
flags
,
...
...
@@ -253,11 +264,7 @@ extern Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode,
extern
void
drmmode_copy_fb
(
ScrnInfoPtr
pScrn
,
drmmode_ptr
drmmode
);
extern
Bool
drmmode_setup_colormap
(
ScreenPtr
pScreen
,
ScrnInfoPtr
pScrn
);
extern
void
drmmode_crtc_scanout_destroy
(
drmmode_ptr
drmmode
,
PixmapPtr
*
scanout
);
void
drmmode_crtc_scanout_free
(
xf86CrtcPtr
crtc
);
PixmapPtr
drmmode_crtc_scanout_create
(
xf86CrtcPtr
crtc
,
PixmapPtr
*
scanout
,
int
width
,
int
height
);
extern
void
drmmode_uevent_init
(
ScrnInfoPtr
scrn
,
drmmode_ptr
drmmode
);
extern
void
drmmode_uevent_fini
(
ScrnInfoPtr
scrn
,
drmmode_ptr
drmmode
);
...
...
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