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
4b5098f3
Commit
4b5098f3
authored
Jun 28, 2014
by
Ben Skeggs
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/kms: take more care when pulling down accelerated fbcon
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
7238eca4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
39 deletions
+61
-39
drivers/gpu/drm/nouveau/dispnv04/crtc.c
drivers/gpu/drm/nouveau/dispnv04/crtc.c
+2
-2
drivers/gpu/drm/nouveau/nouveau_fbcon.c
drivers/gpu/drm/nouveau/nouveau_fbcon.c
+57
-35
drivers/gpu/drm/nouveau/nouveau_fbcon.h
drivers/gpu/drm/nouveau/nouveau_fbcon.h
+2
-2
No files found.
drivers/gpu/drm/nouveau/dispnv04/crtc.c
View file @
4b5098f3
...
@@ -915,9 +915,9 @@ nv04_crtc_mode_set_base_atomic(struct drm_crtc *crtc,
...
@@ -915,9 +915,9 @@ nv04_crtc_mode_set_base_atomic(struct drm_crtc *crtc,
struct
drm_device
*
dev
=
drm
->
dev
;
struct
drm_device
*
dev
=
drm
->
dev
;
if
(
state
==
ENTER_ATOMIC_MODE_SET
)
if
(
state
==
ENTER_ATOMIC_MODE_SET
)
nouveau_fbcon_
save_disable_accel
(
dev
);
nouveau_fbcon_
accel_save_disable
(
dev
);
else
else
nouveau_fbcon_
restore_accel
(
dev
);
nouveau_fbcon_
accel_restore
(
dev
);
return
nv04_crtc_do_mode_set_base
(
crtc
,
fb
,
x
,
y
,
true
);
return
nv04_crtc_do_mode_set_base
(
crtc
,
fb
,
x
,
y
,
true
);
}
}
...
...
drivers/gpu/drm/nouveau/nouveau_fbcon.c
View file @
4b5098f3
...
@@ -212,6 +212,58 @@ static struct fb_ops nouveau_fbcon_sw_ops = {
...
@@ -212,6 +212,58 @@ static struct fb_ops nouveau_fbcon_sw_ops = {
.
fb_debug_leave
=
drm_fb_helper_debug_leave
,
.
fb_debug_leave
=
drm_fb_helper_debug_leave
,
};
};
void
nouveau_fbcon_accel_save_disable
(
struct
drm_device
*
dev
)
{
struct
nouveau_drm
*
drm
=
nouveau_drm
(
dev
);
if
(
drm
->
fbcon
)
{
drm
->
fbcon
->
saved_flags
=
drm
->
fbcon
->
helper
.
fbdev
->
flags
;
drm
->
fbcon
->
helper
.
fbdev
->
flags
|=
FBINFO_HWACCEL_DISABLED
;
}
}
void
nouveau_fbcon_accel_restore
(
struct
drm_device
*
dev
)
{
struct
nouveau_drm
*
drm
=
nouveau_drm
(
dev
);
if
(
drm
->
fbcon
)
{
drm
->
fbcon
->
helper
.
fbdev
->
flags
=
drm
->
fbcon
->
saved_flags
;
}
}
void
nouveau_fbcon_accel_fini
(
struct
drm_device
*
dev
)
{
struct
nouveau_drm
*
drm
=
nouveau_drm
(
dev
);
struct
nouveau_fbdev
*
fbcon
=
drm
->
fbcon
;
if
(
fbcon
&&
drm
->
channel
)
{
console_lock
();
fbcon
->
helper
.
fbdev
->
flags
|=
FBINFO_HWACCEL_DISABLED
;
console_unlock
();
nouveau_channel_idle
(
drm
->
channel
);
}
}
void
nouveau_fbcon_accel_init
(
struct
drm_device
*
dev
)
{
struct
nouveau_drm
*
drm
=
nouveau_drm
(
dev
);
struct
nouveau_fbdev
*
fbcon
=
drm
->
fbcon
;
struct
fb_info
*
info
=
fbcon
->
helper
.
fbdev
;
int
ret
;
if
(
nv_device
(
drm
->
device
)
->
card_type
<
NV_50
)
ret
=
nv04_fbcon_accel_init
(
info
);
else
if
(
nv_device
(
drm
->
device
)
->
card_type
<
NV_C0
)
ret
=
nv50_fbcon_accel_init
(
info
);
else
ret
=
nvc0_fbcon_accel_init
(
info
);
if
(
ret
==
0
)
info
->
fbops
=
&
nouveau_fbcon_ops
;
}
static
void
nouveau_fbcon_gamma_set
(
struct
drm_crtc
*
crtc
,
u16
red
,
u16
green
,
static
void
nouveau_fbcon_gamma_set
(
struct
drm_crtc
*
crtc
,
u16
red
,
u16
green
,
u16
blue
,
int
regno
)
u16
blue
,
int
regno
)
{
{
...
@@ -357,20 +409,8 @@ nouveau_fbcon_create(struct drm_fb_helper *helper,
...
@@ -357,20 +409,8 @@ nouveau_fbcon_create(struct drm_fb_helper *helper,
mutex_unlock
(
&
dev
->
struct_mutex
);
mutex_unlock
(
&
dev
->
struct_mutex
);
if
(
chan
)
{
if
(
chan
)
ret
=
-
ENODEV
;
nouveau_fbcon_accel_init
(
dev
);
if
(
device
->
card_type
<
NV_50
)
ret
=
nv04_fbcon_accel_init
(
info
);
else
if
(
device
->
card_type
<
NV_C0
)
ret
=
nv50_fbcon_accel_init
(
info
);
else
ret
=
nvc0_fbcon_accel_init
(
info
);
if
(
ret
==
0
)
info
->
fbops
=
&
nouveau_fbcon_ops
;
}
nouveau_fbcon_zfill
(
dev
,
fbcon
);
nouveau_fbcon_zfill
(
dev
,
fbcon
);
/* To allow resizeing without swapping buffers */
/* To allow resizeing without swapping buffers */
...
@@ -499,30 +539,12 @@ nouveau_fbcon_fini(struct drm_device *dev)
...
@@ -499,30 +539,12 @@ nouveau_fbcon_fini(struct drm_device *dev)
if
(
!
drm
->
fbcon
)
if
(
!
drm
->
fbcon
)
return
;
return
;
nouveau_fbcon_accel_fini
(
dev
);
nouveau_fbcon_destroy
(
dev
,
drm
->
fbcon
);
nouveau_fbcon_destroy
(
dev
,
drm
->
fbcon
);
kfree
(
drm
->
fbcon
);
kfree
(
drm
->
fbcon
);
drm
->
fbcon
=
NULL
;
drm
->
fbcon
=
NULL
;
}
}
void
nouveau_fbcon_save_disable_accel
(
struct
drm_device
*
dev
)
{
struct
nouveau_drm
*
drm
=
nouveau_drm
(
dev
);
if
(
drm
->
fbcon
)
{
drm
->
fbcon
->
saved_flags
=
drm
->
fbcon
->
helper
.
fbdev
->
flags
;
drm
->
fbcon
->
helper
.
fbdev
->
flags
|=
FBINFO_HWACCEL_DISABLED
;
}
}
void
nouveau_fbcon_restore_accel
(
struct
drm_device
*
dev
)
{
struct
nouveau_drm
*
drm
=
nouveau_drm
(
dev
);
if
(
drm
->
fbcon
)
{
drm
->
fbcon
->
helper
.
fbdev
->
flags
=
drm
->
fbcon
->
saved_flags
;
}
}
void
void
nouveau_fbcon_set_suspend
(
struct
drm_device
*
dev
,
int
state
)
nouveau_fbcon_set_suspend
(
struct
drm_device
*
dev
,
int
state
)
{
{
...
@@ -530,10 +552,10 @@ nouveau_fbcon_set_suspend(struct drm_device *dev, int state)
...
@@ -530,10 +552,10 @@ nouveau_fbcon_set_suspend(struct drm_device *dev, int state)
if
(
drm
->
fbcon
)
{
if
(
drm
->
fbcon
)
{
console_lock
();
console_lock
();
if
(
state
==
1
)
if
(
state
==
1
)
nouveau_fbcon_
save_disable_accel
(
dev
);
nouveau_fbcon_
accel_save_disable
(
dev
);
fb_set_suspend
(
drm
->
fbcon
->
helper
.
fbdev
,
state
);
fb_set_suspend
(
drm
->
fbcon
->
helper
.
fbdev
,
state
);
if
(
state
==
0
)
{
if
(
state
==
0
)
{
nouveau_fbcon_
restore_accel
(
dev
);
nouveau_fbcon_
accel_restore
(
dev
);
nouveau_fbcon_zfill
(
dev
,
drm
->
fbcon
);
nouveau_fbcon_zfill
(
dev
,
drm
->
fbcon
);
}
}
console_unlock
();
console_unlock
();
...
...
drivers/gpu/drm/nouveau/nouveau_fbcon.h
View file @
4b5098f3
...
@@ -61,8 +61,8 @@ void nouveau_fbcon_gpu_lockup(struct fb_info *info);
...
@@ -61,8 +61,8 @@ void nouveau_fbcon_gpu_lockup(struct fb_info *info);
int
nouveau_fbcon_init
(
struct
drm_device
*
dev
);
int
nouveau_fbcon_init
(
struct
drm_device
*
dev
);
void
nouveau_fbcon_fini
(
struct
drm_device
*
dev
);
void
nouveau_fbcon_fini
(
struct
drm_device
*
dev
);
void
nouveau_fbcon_set_suspend
(
struct
drm_device
*
dev
,
int
state
);
void
nouveau_fbcon_set_suspend
(
struct
drm_device
*
dev
,
int
state
);
void
nouveau_fbcon_
save_disable_accel
(
struct
drm_device
*
dev
);
void
nouveau_fbcon_
accel_save_disable
(
struct
drm_device
*
dev
);
void
nouveau_fbcon_
restore_accel
(
struct
drm_device
*
dev
);
void
nouveau_fbcon_
accel_restore
(
struct
drm_device
*
dev
);
void
nouveau_fbcon_output_poll_changed
(
struct
drm_device
*
dev
);
void
nouveau_fbcon_output_poll_changed
(
struct
drm_device
*
dev
);
#endif
/* __NV50_FBCON_H__ */
#endif
/* __NV50_FBCON_H__ */
...
...
Kirill Smelkov
@kirr
mentioned in commit
b14617aa
·
Jun 08, 2016
mentioned in commit
b14617aa
mentioned in commit b14617aac938fb3ed3d7ead8d69d01b79be3cdb9
Toggle commit list
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