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
1575b364
Commit
1575b364
authored
Jul 04, 2011
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau: fixup init/fini sequence to deal with no CRTCs
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
048a8859
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
38 deletions
+30
-38
drivers/gpu/drm/nouveau/nouveau_object.c
drivers/gpu/drm/nouveau/nouveau_object.c
+2
-2
drivers/gpu/drm/nouveau/nouveau_state.c
drivers/gpu/drm/nouveau/nouveau_state.c
+28
-36
No files found.
drivers/gpu/drm/nouveau/nouveau_object.c
View file @
1575b364
...
@@ -793,7 +793,7 @@ nouveau_gpuobj_channel_init(struct nouveau_channel *chan,
...
@@ -793,7 +793,7 @@ nouveau_gpuobj_channel_init(struct nouveau_channel *chan,
return
ret
;
return
ret
;
/* dma objects for display sync channel semaphore blocks */
/* dma objects for display sync channel semaphore blocks */
for
(
i
=
0
;
i
<
2
;
i
++
)
{
for
(
i
=
0
;
i
<
dev
->
mode_config
.
num_crtc
;
i
++
)
{
struct
nouveau_gpuobj
*
sem
=
NULL
;
struct
nouveau_gpuobj
*
sem
=
NULL
;
struct
nv50_display_crtc
*
dispc
=
struct
nv50_display_crtc
*
dispc
=
&
nv50_display
(
dev
)
->
crtc
[
i
];
&
nv50_display
(
dev
)
->
crtc
[
i
];
...
@@ -878,7 +878,7 @@ nouveau_gpuobj_channel_takedown(struct nouveau_channel *chan)
...
@@ -878,7 +878,7 @@ nouveau_gpuobj_channel_takedown(struct nouveau_channel *chan)
if
(
dev_priv
->
card_type
>=
NV_50
)
{
if
(
dev_priv
->
card_type
>=
NV_50
)
{
struct
nv50_display
*
disp
=
nv50_display
(
dev
);
struct
nv50_display
*
disp
=
nv50_display
(
dev
);
for
(
i
=
0
;
i
<
2
;
i
++
)
{
for
(
i
=
0
;
i
<
dev
->
mode_config
.
num_crtc
;
i
++
)
{
struct
nv50_display_crtc
*
dispc
=
&
disp
->
crtc
[
i
];
struct
nv50_display_crtc
*
dispc
=
&
disp
->
crtc
[
i
];
nouveau_bo_vma_del
(
dispc
->
sem
.
bo
,
&
chan
->
dispc_vma
[
i
]);
nouveau_bo_vma_del
(
dispc
->
sem
.
bo
,
&
chan
->
dispc_vma
[
i
]);
}
}
...
...
drivers/gpu/drm/nouveau/nouveau_state.c
View file @
1575b364
...
@@ -452,21 +452,6 @@ nouveau_vga_set_decode(void *priv, bool state)
...
@@ -452,21 +452,6 @@ nouveau_vga_set_decode(void *priv, bool state)
return
VGA_RSRC_NORMAL_IO
|
VGA_RSRC_NORMAL_MEM
;
return
VGA_RSRC_NORMAL_IO
|
VGA_RSRC_NORMAL_MEM
;
}
}
static
int
nouveau_card_init_channel
(
struct
drm_device
*
dev
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
int
ret
;
ret
=
nouveau_channel_alloc
(
dev
,
&
dev_priv
->
channel
,
NULL
,
NvDmaFB
,
NvDmaTT
);
if
(
ret
)
return
ret
;
mutex_unlock
(
&
dev_priv
->
channel
->
mutex
);
return
0
;
}
static
void
nouveau_switcheroo_set_state
(
struct
pci_dev
*
pdev
,
static
void
nouveau_switcheroo_set_state
(
struct
pci_dev
*
pdev
,
enum
vga_switcheroo_state
state
)
enum
vga_switcheroo_state
state
)
{
{
...
@@ -657,6 +642,10 @@ nouveau_card_init(struct drm_device *dev)
...
@@ -657,6 +642,10 @@ nouveau_card_init(struct drm_device *dev)
goto
out_engine
;
goto
out_engine
;
}
}
ret
=
nouveau_irq_init
(
dev
);
if
(
ret
)
goto
out_fifo
;
/* initialise general modesetting */
/* initialise general modesetting */
drm_mode_config_init
(
dev
);
drm_mode_config_init
(
dev
);
drm_mode_create_scaling_mode_property
(
dev
);
drm_mode_create_scaling_mode_property
(
dev
);
...
@@ -679,39 +668,40 @@ nouveau_card_init(struct drm_device *dev)
...
@@ -679,39 +668,40 @@ nouveau_card_init(struct drm_device *dev)
ret
=
engine
->
display
.
create
(
dev
);
ret
=
engine
->
display
.
create
(
dev
);
if
(
ret
)
if
(
ret
)
goto
out_fifo
;
goto
out_irq
;
ret
=
drm_vblank_init
(
dev
,
nv_two_heads
(
dev
)
?
2
:
1
);
if
(
ret
)
goto
out_vblank
;
ret
=
nouveau_irq_init
(
dev
);
if
(
ret
)
goto
out_vblank
;
/* what about PVIDEO/PCRTC/PRAMDAC etc? */
if
(
dev_priv
->
eng
[
NVOBJ_ENGINE_GR
])
{
if
(
dev_priv
->
eng
[
NVOBJ_ENGINE_GR
])
{
ret
=
nouveau_fence_init
(
dev
);
ret
=
nouveau_fence_init
(
dev
);
if
(
ret
)
if
(
ret
)
goto
out_
irq
;
goto
out_
disp
;
ret
=
nouveau_card_init_channel
(
dev
);
ret
=
nouveau_channel_alloc
(
dev
,
&
dev_priv
->
channel
,
NULL
,
NvDmaFB
,
NvDmaTT
);
if
(
ret
)
if
(
ret
)
goto
out_fence
;
goto
out_fence
;
mutex_unlock
(
&
dev_priv
->
channel
->
mutex
);
}
if
(
dev
->
mode_config
.
num_crtc
)
{
ret
=
drm_vblank_init
(
dev
,
dev
->
mode_config
.
num_crtc
);
if
(
ret
)
goto
out_chan
;
nouveau_fbcon_init
(
dev
);
drm_kms_helper_poll_init
(
dev
);
}
}
nouveau_fbcon_init
(
dev
);
drm_kms_helper_poll_init
(
dev
);
return
0
;
return
0
;
out_chan:
nouveau_channel_put_unlocked
(
&
dev_priv
->
channel
);
out_fence:
out_fence:
nouveau_fence_fini
(
dev
);
nouveau_fence_fini
(
dev
);
out_disp:
engine
->
display
.
destroy
(
dev
);
out_irq:
out_irq:
nouveau_irq_fini
(
dev
);
nouveau_irq_fini
(
dev
);
out_vblank:
drm_vblank_cleanup
(
dev
);
engine
->
display
.
destroy
(
dev
);
out_fifo:
out_fifo:
if
(
!
dev_priv
->
noaccel
)
if
(
!
dev_priv
->
noaccel
)
engine
->
fifo
.
takedown
(
dev
);
engine
->
fifo
.
takedown
(
dev
);
...
@@ -758,8 +748,11 @@ static void nouveau_card_takedown(struct drm_device *dev)
...
@@ -758,8 +748,11 @@ static void nouveau_card_takedown(struct drm_device *dev)
struct
nouveau_engine
*
engine
=
&
dev_priv
->
engine
;
struct
nouveau_engine
*
engine
=
&
dev_priv
->
engine
;
int
e
;
int
e
;
drm_kms_helper_poll_fini
(
dev
);
if
(
dev
->
mode_config
.
num_crtc
)
{
nouveau_fbcon_fini
(
dev
);
drm_kms_helper_poll_fini
(
dev
);
nouveau_fbcon_fini
(
dev
);
drm_vblank_cleanup
(
dev
);
}
if
(
dev_priv
->
channel
)
{
if
(
dev_priv
->
channel
)
{
nouveau_channel_put_unlocked
(
&
dev_priv
->
channel
);
nouveau_channel_put_unlocked
(
&
dev_priv
->
channel
);
...
@@ -801,7 +794,6 @@ static void nouveau_card_takedown(struct drm_device *dev)
...
@@ -801,7 +794,6 @@ static void nouveau_card_takedown(struct drm_device *dev)
engine
->
vram
.
takedown
(
dev
);
engine
->
vram
.
takedown
(
dev
);
nouveau_irq_fini
(
dev
);
nouveau_irq_fini
(
dev
);
drm_vblank_cleanup
(
dev
);
nouveau_pm_fini
(
dev
);
nouveau_pm_fini
(
dev
);
nouveau_bios_takedown
(
dev
);
nouveau_bios_takedown
(
dev
);
...
...
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