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
e225f446
Commit
e225f446
authored
Nov 21, 2012
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau: rename nvd0_display to nv50_display to reflect reality since merge
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
4f6029da
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
268 additions
and
279 deletions
+268
-279
drivers/gpu/drm/nouveau/Makefile
drivers/gpu/drm/nouveau/Makefile
+1
-1
drivers/gpu/drm/nouveau/nouveau_crtc.h
drivers/gpu/drm/nouveau/nouveau_crtc.h
+0
-7
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/nouveau/nouveau_display.c
+2
-2
drivers/gpu/drm/nouveau/nouveau_encoder.h
drivers/gpu/drm/nouveau/nouveau_encoder.h
+0
-4
drivers/gpu/drm/nouveau/nv50_display.c
drivers/gpu/drm/nouveau/nv50_display.c
+254
-254
drivers/gpu/drm/nouveau/nv50_display.h
drivers/gpu/drm/nouveau/nv50_display.h
+7
-7
drivers/gpu/drm/nouveau/nv50_fence.c
drivers/gpu/drm/nouveau/nv50_fence.c
+1
-1
drivers/gpu/drm/nouveau/nv84_fence.c
drivers/gpu/drm/nouveau/nv84_fence.c
+1
-1
drivers/gpu/drm/nouveau/nvc0_fence.c
drivers/gpu/drm/nouveau/nvc0_fence.c
+2
-2
No files found.
drivers/gpu/drm/nouveau/Makefile
View file @
e225f446
...
...
@@ -201,7 +201,7 @@ nouveau-y += nv04_dac.o nv04_dfp.o nv04_tv.o nv17_tv.o nv17_tv_modes.o
nouveau-y
+=
nv04_crtc.o nv04_display.o nv04_cursor.o
# drm/kms/nv50-
nouveau-y
+=
nv
d
0_display.o
nouveau-y
+=
nv
5
0_display.o
# drm/pm
nouveau-y
+=
nouveau_pm.o nouveau_volt.o nouveau_perf.o
...
...
drivers/gpu/drm/nouveau/nouveau_crtc.h
View file @
e225f446
...
...
@@ -82,13 +82,6 @@ static inline struct drm_crtc *to_drm_crtc(struct nouveau_crtc *crtc)
return
&
crtc
->
base
;
}
int
nv50_crtc_create
(
struct
drm_device
*
dev
,
int
index
);
int
nv50_crtc_cursor_set
(
struct
drm_crtc
*
drm_crtc
,
struct
drm_file
*
file_priv
,
uint32_t
buffer_handle
,
uint32_t
width
,
uint32_t
height
);
int
nv50_crtc_cursor_move
(
struct
drm_crtc
*
drm_crtc
,
int
x
,
int
y
);
int
nv04_cursor_init
(
struct
nouveau_crtc
*
);
int
nv50_cursor_init
(
struct
nouveau_crtc
*
);
#endif
/* __NOUVEAU_CRTC_H__ */
drivers/gpu/drm/nouveau/nouveau_display.c
View file @
e225f446
...
...
@@ -366,7 +366,7 @@ nouveau_display_create(struct drm_device *dev)
if
(
nv_device
(
drm
->
device
)
->
card_type
<
NV_50
)
ret
=
nv04_display_create
(
dev
);
else
ret
=
nv
d
0_display_create
(
dev
);
ret
=
nv
5
0_display_create
(
dev
);
if
(
ret
)
goto
disp_create_err
;
...
...
@@ -657,7 +657,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
/* Emit a page flip */
if
(
nv_device
(
drm
->
device
)
->
card_type
>=
NV_50
)
{
ret
=
nv
d
0_display_flip_next
(
crtc
,
fb
,
chan
,
0
);
ret
=
nv
5
0_display_flip_next
(
crtc
,
fb
,
chan
,
0
);
if
(
ret
)
{
mutex_unlock
(
&
chan
->
cli
->
mutex
);
goto
fail_unreserve
;
...
...
drivers/gpu/drm/nouveau/nouveau_encoder.h
View file @
e225f446
...
...
@@ -97,9 +97,5 @@ void nouveau_dp_dpms(struct drm_encoder *, int mode, u32 datarate,
struct
nouveau_connector
*
nouveau_encoder_connector_get
(
struct
nouveau_encoder
*
encoder
);
int
nv50_sor_create
(
struct
drm_connector
*
,
struct
dcb_output
*
);
void
nv50_sor_dp_calc_tu
(
struct
drm_device
*
,
int
,
int
,
u32
,
u32
);
int
nv50_dac_create
(
struct
drm_connector
*
,
struct
dcb_output
*
);
#endif
/* __NOUVEAU_ENCODER_H__ */
drivers/gpu/drm/nouveau/nv
d
0_display.c
→
drivers/gpu/drm/nouveau/nv
5
0_display.c
View file @
e225f446
/*
/*
* Copyright 2011 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
...
...
@@ -68,14 +68,14 @@
* EVO channel
*****************************************************************************/
struct
nv
d
0_chan
{
struct
nv
5
0_chan
{
struct
nouveau_object
*
user
;
u32
handle
;
};
static
int
nv
d
0_chan_create
(
struct
nouveau_object
*
core
,
u32
bclass
,
u8
head
,
void
*
data
,
u32
size
,
struct
nv
d
0_chan
*
chan
)
nv
5
0_chan_create
(
struct
nouveau_object
*
core
,
u32
bclass
,
u8
head
,
void
*
data
,
u32
size
,
struct
nv
5
0_chan
*
chan
)
{
struct
nouveau_object
*
client
=
nv_pclass
(
core
,
NV_CLIENT_CLASS
);
const
u32
oclass
=
EVO_CHAN_OCLASS
(
bclass
,
core
);
...
...
@@ -92,7 +92,7 @@ nvd0_chan_create(struct nouveau_object *core, u32 bclass, u8 head,
}
static
void
nv
d0_chan_destroy
(
struct
nouveau_object
*
core
,
struct
nvd
0_chan
*
chan
)
nv
50_chan_destroy
(
struct
nouveau_object
*
core
,
struct
nv5
0_chan
*
chan
)
{
struct
nouveau_object
*
client
=
nv_pclass
(
core
,
NV_CLIENT_CLASS
);
if
(
chan
->
handle
)
...
...
@@ -103,42 +103,42 @@ nvd0_chan_destroy(struct nouveau_object *core, struct nvd0_chan *chan)
* PIO EVO channel
*****************************************************************************/
struct
nv
d
0_pioc
{
struct
nv
d
0_chan
base
;
struct
nv
5
0_pioc
{
struct
nv
5
0_chan
base
;
};
static
void
nv
d0_pioc_destroy
(
struct
nouveau_object
*
core
,
struct
nvd
0_pioc
*
pioc
)
nv
50_pioc_destroy
(
struct
nouveau_object
*
core
,
struct
nv5
0_pioc
*
pioc
)
{
nv
d
0_chan_destroy
(
core
,
&
pioc
->
base
);
nv
5
0_chan_destroy
(
core
,
&
pioc
->
base
);
}
static
int
nv
d
0_pioc_create
(
struct
nouveau_object
*
core
,
u32
bclass
,
u8
head
,
void
*
data
,
u32
size
,
struct
nv
d
0_pioc
*
pioc
)
nv
5
0_pioc_create
(
struct
nouveau_object
*
core
,
u32
bclass
,
u8
head
,
void
*
data
,
u32
size
,
struct
nv
5
0_pioc
*
pioc
)
{
return
nv
d
0_chan_create
(
core
,
bclass
,
head
,
data
,
size
,
&
pioc
->
base
);
return
nv
5
0_chan_create
(
core
,
bclass
,
head
,
data
,
size
,
&
pioc
->
base
);
}
/******************************************************************************
* DMA EVO channel
*****************************************************************************/
struct
nv
d
0_dmac
{
struct
nv
d
0_chan
base
;
struct
nv
5
0_dmac
{
struct
nv
5
0_chan
base
;
dma_addr_t
handle
;
u32
*
ptr
;
};
static
void
nv
d0_dmac_destroy
(
struct
nouveau_object
*
core
,
struct
nvd
0_dmac
*
dmac
)
nv
50_dmac_destroy
(
struct
nouveau_object
*
core
,
struct
nv5
0_dmac
*
dmac
)
{
if
(
dmac
->
ptr
)
{
struct
pci_dev
*
pdev
=
nv_device
(
core
)
->
pdev
;
pci_free_consistent
(
pdev
,
PAGE_SIZE
,
dmac
->
ptr
,
dmac
->
handle
);
}
nv
d
0_chan_destroy
(
core
,
&
dmac
->
base
);
nv
5
0_chan_destroy
(
core
,
&
dmac
->
base
);
}
static
int
...
...
@@ -261,9 +261,9 @@ nvd0_dmac_create_fbdma(struct nouveau_object *core, u32 parent)
}
static
int
nv
d
0_dmac_create
(
struct
nouveau_object
*
core
,
u32
bclass
,
u8
head
,
nv
5
0_dmac_create
(
struct
nouveau_object
*
core
,
u32
bclass
,
u8
head
,
void
*
data
,
u32
size
,
u64
syncbuf
,
struct
nv
d
0_dmac
*
dmac
)
struct
nv
5
0_dmac
*
dmac
)
{
struct
nouveau_fb
*
pfb
=
nouveau_fb
(
core
);
struct
nouveau_object
*
client
=
nv_pclass
(
core
,
NV_CLIENT_CLASS
);
...
...
@@ -287,7 +287,7 @@ nvd0_dmac_create(struct nouveau_object *core, u32 bclass, u8 head,
if
(
ret
)
return
ret
;
ret
=
nv
d
0_chan_create
(
core
,
bclass
,
head
,
data
,
size
,
&
dmac
->
base
);
ret
=
nv
5
0_chan_create
(
core
,
bclass
,
head
,
data
,
size
,
&
dmac
->
base
);
if
(
ret
)
return
ret
;
...
...
@@ -323,65 +323,65 @@ nvd0_dmac_create(struct nouveau_object *core, u32 bclass, u8 head,
return
ret
;
}
struct
nv
d
0_mast
{
struct
nv
d
0_dmac
base
;
struct
nv
5
0_mast
{
struct
nv
5
0_dmac
base
;
};
struct
nv
d
0_curs
{
struct
nv
d
0_pioc
base
;
struct
nv
5
0_curs
{
struct
nv
5
0_pioc
base
;
};
struct
nv
d
0_sync
{
struct
nv
d
0_dmac
base
;
struct
nv
5
0_sync
{
struct
nv
5
0_dmac
base
;
struct
{
u32
offset
;
u16
value
;
}
sem
;
};
struct
nv
d
0_ovly
{
struct
nv
d
0_dmac
base
;
struct
nv
5
0_ovly
{
struct
nv
5
0_dmac
base
;
};
struct
nv
d
0_oimm
{
struct
nv
d
0_pioc
base
;
struct
nv
5
0_oimm
{
struct
nv
5
0_pioc
base
;
};
struct
nv
d
0_head
{
struct
nv
5
0_head
{
struct
nouveau_crtc
base
;
struct
nv
d
0_curs
curs
;
struct
nv
d
0_sync
sync
;
struct
nv
d
0_ovly
ovly
;
struct
nv
d
0_oimm
oimm
;
struct
nv
5
0_curs
curs
;
struct
nv
5
0_sync
sync
;
struct
nv
5
0_ovly
ovly
;
struct
nv
5
0_oimm
oimm
;
};
#define nv
d0_head(c) ((struct nvd
0_head *)nouveau_crtc(c))
#define nv
d0_curs(c) (&nvd
0_head(c)->curs)
#define nv
d0_sync(c) (&nvd
0_head(c)->sync)
#define nv
d0_ovly(c) (&nvd
0_head(c)->ovly)
#define nv
d0_oimm(c) (&nvd
0_head(c)->oimm)
#define nv
d
0_chan(c) (&(c)->base.base)
#define nv
d0_vers(c) nv_mclass(nvd
0_chan(c)->user)
#define nv
50_head(c) ((struct nv5
0_head *)nouveau_crtc(c))
#define nv
50_curs(c) (&nv5
0_head(c)->curs)
#define nv
50_sync(c) (&nv5
0_head(c)->sync)
#define nv
50_ovly(c) (&nv5
0_head(c)->ovly)
#define nv
50_oimm(c) (&nv5
0_head(c)->oimm)
#define nv
5
0_chan(c) (&(c)->base.base)
#define nv
50_vers(c) nv_mclass(nv5
0_chan(c)->user)
struct
nv
d
0_disp
{
struct
nv
5
0_disp
{
struct
nouveau_object
*
core
;
struct
nv
d
0_mast
mast
;
struct
nv
5
0_mast
mast
;
u32
modeset
;
struct
nouveau_bo
*
sync
;
};
static
struct
nv
d
0_disp
*
nv
d
0_disp
(
struct
drm_device
*
dev
)
static
struct
nv
5
0_disp
*
nv
5
0_disp
(
struct
drm_device
*
dev
)
{
return
nouveau_display
(
dev
)
->
priv
;
}
#define nv
d0_mast(d) (&nvd
0_disp(d)->mast)
#define nv
50_mast(d) (&nv5
0_disp(d)->mast)
static
struct
drm_crtc
*
nv
d
0_display_crtc_get
(
struct
drm_encoder
*
encoder
)
nv
5
0_display_crtc_get
(
struct
drm_encoder
*
encoder
)
{
return
nouveau_encoder
(
encoder
)
->
crtc
;
}
...
...
@@ -392,7 +392,7 @@ nvd0_display_crtc_get(struct drm_encoder *encoder)
static
u32
*
evo_wait
(
void
*
evoc
,
int
nr
)
{
struct
nv
d
0_dmac
*
dmac
=
evoc
;
struct
nv
5
0_dmac
*
dmac
=
evoc
;
u32
put
=
nv_ro32
(
dmac
->
base
.
user
,
0x0000
)
/
4
;
if
(
put
+
nr
>=
(
PAGE_SIZE
/
4
)
-
8
)
{
...
...
@@ -413,7 +413,7 @@ evo_wait(void *evoc, int nr)
static
void
evo_kick
(
u32
*
push
,
void
*
evoc
)
{
struct
nv
d
0_dmac
*
dmac
=
evoc
;
struct
nv
5
0_dmac
*
dmac
=
evoc
;
nv_wo32
(
dmac
->
base
.
user
,
0x0000
,
(
push
-
dmac
->
ptr
)
<<
2
);
}
...
...
@@ -430,8 +430,8 @@ static int
evo_sync
(
struct
drm_device
*
dev
)
{
struct
nouveau_device
*
device
=
nouveau_dev
(
dev
);
struct
nv
d0_disp
*
disp
=
nvd
0_disp
(
dev
);
struct
nv
d0_mast
*
mast
=
nvd
0_mast
(
dev
);
struct
nv
50_disp
*
disp
=
nv5
0_disp
(
dev
);
struct
nv
50_mast
*
mast
=
nv5
0_mast
(
dev
);
u32
*
push
=
evo_wait
(
mast
,
8
);
if
(
push
)
{
nouveau_bo_wr32
(
disp
->
sync
,
EVO_MAST_NTFY
,
0x00000000
);
...
...
@@ -452,15 +452,15 @@ evo_sync(struct drm_device *dev)
* Page flipping channel
*****************************************************************************/
struct
nouveau_bo
*
nv
d
0_display_crtc_sema
(
struct
drm_device
*
dev
,
int
crtc
)
nv
5
0_display_crtc_sema
(
struct
drm_device
*
dev
,
int
crtc
)
{
return
nv
d
0_disp
(
dev
)
->
sync
;
return
nv
5
0_disp
(
dev
)
->
sync
;
}
void
nv
d
0_display_flip_stop
(
struct
drm_crtc
*
crtc
)
nv
5
0_display_flip_stop
(
struct
drm_crtc
*
crtc
)
{
struct
nv
d0_sync
*
sync
=
nvd
0_sync
(
crtc
);
struct
nv
50_sync
*
sync
=
nv5
0_sync
(
crtc
);
u32
*
push
;
push
=
evo_wait
(
sync
,
8
);
...
...
@@ -478,13 +478,13 @@ nvd0_display_flip_stop(struct drm_crtc *crtc)
}
int
nv
d
0_display_flip_next
(
struct
drm_crtc
*
crtc
,
struct
drm_framebuffer
*
fb
,
nv
5
0_display_flip_next
(
struct
drm_crtc
*
crtc
,
struct
drm_framebuffer
*
fb
,
struct
nouveau_channel
*
chan
,
u32
swap_interval
)
{
struct
nouveau_framebuffer
*
nv_fb
=
nouveau_framebuffer
(
fb
);
struct
nv
d0_disp
*
disp
=
nvd
0_disp
(
crtc
->
dev
);
struct
nv
50_disp
*
disp
=
nv5
0_disp
(
crtc
->
dev
);
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
struct
nv
d0_sync
*
sync
=
nvd
0_sync
(
crtc
);
struct
nv
50_sync
*
sync
=
nv5
0_sync
(
crtc
);
u32
*
push
;
int
ret
;
...
...
@@ -561,7 +561,7 @@ nvd0_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb,
evo_mthd
(
push
,
0x0110
,
2
);
evo_data
(
push
,
0x00000000
);
evo_data
(
push
,
0x00000000
);
if
(
nv
d
0_vers
(
sync
)
<
NVD0_DISP_SYNC_CLASS
)
{
if
(
nv
5
0_vers
(
sync
)
<
NVD0_DISP_SYNC_CLASS
)
{
evo_mthd
(
push
,
0x0800
,
5
);
evo_data
(
push
,
nv_fb
->
nvbo
->
bo
.
offset
>>
8
);
evo_data
(
push
,
0
);
...
...
@@ -589,9 +589,9 @@ nvd0_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb,
* CRTC
*****************************************************************************/
static
int
nv
d
0_crtc_set_dither
(
struct
nouveau_crtc
*
nv_crtc
,
bool
update
)
nv
5
0_crtc_set_dither
(
struct
nouveau_crtc
*
nv_crtc
,
bool
update
)
{
struct
nv
d0_mast
*
mast
=
nvd
0_mast
(
nv_crtc
->
base
.
dev
);
struct
nv
50_mast
*
mast
=
nv5
0_mast
(
nv_crtc
->
base
.
dev
);
struct
nouveau_connector
*
nv_connector
;
struct
drm_connector
*
connector
;
u32
*
push
,
mode
=
0x00
;
...
...
@@ -614,11 +614,11 @@ nvd0_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool update)
push
=
evo_wait
(
mast
,
4
);
if
(
push
)
{
if
(
nv
d
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
evo_mthd
(
push
,
0x08a0
+
(
nv_crtc
->
index
*
0x0400
),
1
);
evo_data
(
push
,
mode
);
}
else
if
(
nv
d
0_vers
(
mast
)
<
NVE0_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NVE0_DISP_MAST_CLASS
)
{
evo_mthd
(
push
,
0x0490
+
(
nv_crtc
->
index
*
0x0300
),
1
);
evo_data
(
push
,
mode
);
}
else
{
...
...
@@ -637,9 +637,9 @@ nvd0_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool update)
}
static
int
nv
d
0_crtc_set_scale
(
struct
nouveau_crtc
*
nv_crtc
,
bool
update
)
nv
5
0_crtc_set_scale
(
struct
nouveau_crtc
*
nv_crtc
,
bool
update
)
{
struct
nv
d0_mast
*
mast
=
nvd
0_mast
(
nv_crtc
->
base
.
dev
);
struct
nv
50_mast
*
mast
=
nv5
0_mast
(
nv_crtc
->
base
.
dev
);
struct
drm_display_mode
*
omode
,
*
umode
=
&
nv_crtc
->
base
.
mode
;
struct
drm_crtc
*
crtc
=
&
nv_crtc
->
base
;
struct
nouveau_connector
*
nv_connector
;
...
...
@@ -709,7 +709,7 @@ nvd0_crtc_set_scale(struct nouveau_crtc *nv_crtc, bool update)
push
=
evo_wait
(
mast
,
8
);
if
(
push
)
{
if
(
nv
d
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
/*XXX: SCALE_CTRL_ACTIVE??? */
evo_mthd
(
push
,
0x08d8
+
(
nv_crtc
->
index
*
0x400
),
2
);
evo_data
(
push
,
(
oY
<<
16
)
|
oX
);
...
...
@@ -732,8 +732,8 @@ nvd0_crtc_set_scale(struct nouveau_crtc *nv_crtc, bool update)
evo_kick
(
push
,
mast
);
if
(
update
)
{
nv
d
0_display_flip_stop
(
crtc
);
nv
d
0_display_flip_next
(
crtc
,
crtc
->
fb
,
NULL
,
1
);
nv
5
0_display_flip_stop
(
crtc
);
nv
5
0_display_flip_next
(
crtc
,
crtc
->
fb
,
NULL
,
1
);
}
}
...
...
@@ -741,9 +741,9 @@ nvd0_crtc_set_scale(struct nouveau_crtc *nv_crtc, bool update)
}
static
int
nv
d
0_crtc_set_color_vibrance
(
struct
nouveau_crtc
*
nv_crtc
,
bool
update
)
nv
5
0_crtc_set_color_vibrance
(
struct
nouveau_crtc
*
nv_crtc
,
bool
update
)
{
struct
nv
d0_mast
*
mast
=
nvd
0_mast
(
nv_crtc
->
base
.
dev
);
struct
nv
50_mast
*
mast
=
nv5
0_mast
(
nv_crtc
->
base
.
dev
);
u32
*
push
,
hue
,
vib
;
int
adj
;
...
...
@@ -753,7 +753,7 @@ nvd0_crtc_set_color_vibrance(struct nouveau_crtc *nv_crtc, bool update)
push
=
evo_wait
(
mast
,
16
);
if
(
push
)
{
if
(
nv
d
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
evo_mthd
(
push
,
0x08a8
+
(
nv_crtc
->
index
*
0x400
),
1
);
evo_data
(
push
,
(
hue
<<
20
)
|
(
vib
<<
8
));
}
else
{
...
...
@@ -772,16 +772,16 @@ nvd0_crtc_set_color_vibrance(struct nouveau_crtc *nv_crtc, bool update)
}
static
int
nv
d
0_crtc_set_image
(
struct
nouveau_crtc
*
nv_crtc
,
struct
drm_framebuffer
*
fb
,
nv
5
0_crtc_set_image
(
struct
nouveau_crtc
*
nv_crtc
,
struct
drm_framebuffer
*
fb
,
int
x
,
int
y
,
bool
update
)
{
struct
nouveau_framebuffer
*
nvfb
=
nouveau_framebuffer
(
fb
);
struct
nv
d0_mast
*
mast
=
nvd
0_mast
(
nv_crtc
->
base
.
dev
);
struct
nv
50_mast
*
mast
=
nv5
0_mast
(
nv_crtc
->
base
.
dev
);
u32
*
push
;
push
=
evo_wait
(
mast
,
16
);
if
(
push
)
{
if
(
nv
d
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
evo_mthd
(
push
,
0x0860
+
(
nv_crtc
->
index
*
0x400
),
1
);
evo_data
(
push
,
nvfb
->
nvbo
->
bo
.
offset
>>
8
);
evo_mthd
(
push
,
0x0868
+
(
nv_crtc
->
index
*
0x400
),
3
);
...
...
@@ -790,7 +790,7 @@ nvd0_crtc_set_image(struct nouveau_crtc *nv_crtc, struct drm_framebuffer *fb,
evo_data
(
push
,
nvfb
->
r_format
);
evo_mthd
(
push
,
0x08c0
+
(
nv_crtc
->
index
*
0x400
),
1
);
evo_data
(
push
,
(
y
<<
16
)
|
x
);
if
(
nv
d
0_vers
(
mast
)
>
NV50_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
>
NV50_DISP_MAST_CLASS
)
{
evo_mthd
(
push
,
0x0874
+
(
nv_crtc
->
index
*
0x400
),
1
);
evo_data
(
push
,
nvfb
->
r_dma
);
}
...
...
@@ -818,17 +818,17 @@ nvd0_crtc_set_image(struct nouveau_crtc *nv_crtc, struct drm_framebuffer *fb,
}
static
void
nv
d
0_crtc_cursor_show
(
struct
nouveau_crtc
*
nv_crtc
)
nv
5
0_crtc_cursor_show
(
struct
nouveau_crtc
*
nv_crtc
)
{
struct
nv
d0_mast
*
mast
=
nvd
0_mast
(
nv_crtc
->
base
.
dev
);
struct
nv
50_mast
*
mast
=
nv5
0_mast
(
nv_crtc
->
base
.
dev
);
u32
*
push
=
evo_wait
(
mast
,
16
);
if
(
push
)
{
if
(
nv
d
0_vers
(
mast
)
<
NV84_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NV84_DISP_MAST_CLASS
)
{
evo_mthd
(
push
,
0x0880
+
(
nv_crtc
->
index
*
0x400
),
2
);
evo_data
(
push
,
0x85000000
);
evo_data
(
push
,
nv_crtc
->
cursor
.
nvbo
->
bo
.
offset
>>
8
);
}
else
if
(
nv
d
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
evo_mthd
(
push
,
0x0880
+
(
nv_crtc
->
index
*
0x400
),
2
);
evo_data
(
push
,
0x85000000
);
evo_data
(
push
,
nv_crtc
->
cursor
.
nvbo
->
bo
.
offset
>>
8
);
...
...
@@ -846,16 +846,16 @@ nvd0_crtc_cursor_show(struct nouveau_crtc *nv_crtc)
}
static
void
nv
d
0_crtc_cursor_hide
(
struct
nouveau_crtc
*
nv_crtc
)
nv
5
0_crtc_cursor_hide
(
struct
nouveau_crtc
*
nv_crtc
)
{
struct
nv
d0_mast
*
mast
=
nvd
0_mast
(
nv_crtc
->
base
.
dev
);
struct
nv
50_mast
*
mast
=
nv5
0_mast
(
nv_crtc
->
base
.
dev
);
u32
*
push
=
evo_wait
(
mast
,
16
);
if
(
push
)
{
if
(
nv
d
0_vers
(
mast
)
<
NV84_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NV84_DISP_MAST_CLASS
)
{
evo_mthd
(
push
,
0x0880
+
(
nv_crtc
->
index
*
0x400
),
1
);
evo_data
(
push
,
0x05000000
);
}
else
if
(
nv
d
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
evo_mthd
(
push
,
0x0880
+
(
nv_crtc
->
index
*
0x400
),
1
);
evo_data
(
push
,
0x05000000
);
evo_mthd
(
push
,
0x089c
+
(
nv_crtc
->
index
*
0x400
),
1
);
...
...
@@ -871,14 +871,14 @@ nvd0_crtc_cursor_hide(struct nouveau_crtc *nv_crtc)
}
static
void
nv
d
0_crtc_cursor_show_hide
(
struct
nouveau_crtc
*
nv_crtc
,
bool
show
,
bool
update
)
nv
5
0_crtc_cursor_show_hide
(
struct
nouveau_crtc
*
nv_crtc
,
bool
show
,
bool
update
)
{
struct
nv
d0_mast
*
mast
=
nvd
0_mast
(
nv_crtc
->
base
.
dev
);
struct
nv
50_mast
*
mast
=
nv5
0_mast
(
nv_crtc
->
base
.
dev
);
if
(
show
)
nv
d
0_crtc_cursor_show
(
nv_crtc
);
nv
5
0_crtc_cursor_show
(
nv_crtc
);
else
nv
d
0_crtc_cursor_hide
(
nv_crtc
);
nv
5
0_crtc_cursor_hide
(
nv_crtc
);
if
(
update
)
{
u32
*
push
=
evo_wait
(
mast
,
2
);
...
...
@@ -891,28 +891,28 @@ nvd0_crtc_cursor_show_hide(struct nouveau_crtc *nv_crtc, bool show, bool update)
}
static
void
nv
d
0_crtc_dpms
(
struct
drm_crtc
*
crtc
,
int
mode
)
nv
5
0_crtc_dpms
(
struct
drm_crtc
*
crtc
,
int
mode
)
{
}
static
void
nv
d
0_crtc_prepare
(
struct
drm_crtc
*
crtc
)
nv
5
0_crtc_prepare
(
struct
drm_crtc
*
crtc
)
{
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
struct
nv
d0_mast
*
mast
=
nvd
0_mast
(
crtc
->
dev
);
struct
nv
50_mast
*
mast
=
nv5
0_mast
(
crtc
->
dev
);
u32
*
push
;
nv
d
0_display_flip_stop
(
crtc
);
nv
5
0_display_flip_stop
(
crtc
);
push
=
evo_wait
(
mast
,
2
);
if
(
push
)
{
if
(
nv
d
0_vers
(
mast
)
<
NV84_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NV84_DISP_MAST_CLASS
)
{
evo_mthd
(
push
,
0x0874
+
(
nv_crtc
->
index
*
0x400
),
1
);
evo_data
(
push
,
0x00000000
);
evo_mthd
(
push
,
0x0840
+
(
nv_crtc
->
index
*
0x400
),
1
);
evo_data
(
push
,
0x40000000
);
}
else
if
(
nv
d
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
evo_mthd
(
push
,
0x0874
+
(
nv_crtc
->
index
*
0x400
),
1
);
evo_data
(
push
,
0x00000000
);
evo_mthd
(
push
,
0x0840
+
(
nv_crtc
->
index
*
0x400
),
1
);
...
...
@@ -931,26 +931,26 @@ nvd0_crtc_prepare(struct drm_crtc *crtc)
evo_kick
(
push
,
mast
);
}
nv
d
0_crtc_cursor_show_hide
(
nv_crtc
,
false
,
false
);
nv
5
0_crtc_cursor_show_hide
(
nv_crtc
,
false
,
false
);
}
static
void
nv
d
0_crtc_commit
(
struct
drm_crtc
*
crtc
)
nv
5
0_crtc_commit
(
struct
drm_crtc
*
crtc
)
{
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
struct
nv
d0_mast
*
mast
=
nvd
0_mast
(
crtc
->
dev
);
struct
nv
50_mast
*
mast
=
nv5
0_mast
(
crtc
->
dev
);
u32
*
push
;
push
=
evo_wait
(
mast
,
32
);
if
(
push
)
{
if
(
nv
d
0_vers
(
mast
)
<
NV84_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NV84_DISP_MAST_CLASS
)
{
evo_mthd
(
push
,
0x0874
+
(
nv_crtc
->
index
*
0x400
),
1
);
evo_data
(
push
,
NvEvoVRAM_LP
);
evo_mthd
(
push
,
0x0840
+
(
nv_crtc
->
index
*
0x400
),
2
);
evo_data
(
push
,
0xc0000000
);
evo_data
(
push
,
nv_crtc
->
lut
.
nvbo
->
bo
.
offset
>>
8
);
}
else
if
(
nv
d
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
evo_mthd
(
push
,
0x0874
+
(
nv_crtc
->
index
*
0x400
),
1
);
evo_data
(
push
,
nv_crtc
->
fb
.
tile_flags
);
evo_mthd
(
push
,
0x0840
+
(
nv_crtc
->
index
*
0x400
),
2
);
...
...
@@ -975,19 +975,19 @@ nvd0_crtc_commit(struct drm_crtc *crtc)
evo_kick
(
push
,
mast
);
}
nv
d
0_crtc_cursor_show_hide
(
nv_crtc
,
nv_crtc
->
cursor
.
visible
,
true
);
nv
d
0_display_flip_next
(
crtc
,
crtc
->
fb
,
NULL
,
1
);
nv
5
0_crtc_cursor_show_hide
(
nv_crtc
,
nv_crtc
->
cursor
.
visible
,
true
);
nv
5
0_display_flip_next
(
crtc
,
crtc
->
fb
,
NULL
,
1
);
}
static
bool
nv
d
0_crtc_mode_fixup
(
struct
drm_crtc
*
crtc
,
const
struct
drm_display_mode
*
mode
,
nv
5
0_crtc_mode_fixup
(
struct
drm_crtc
*
crtc
,
const
struct
drm_display_mode
*
mode
,
struct
drm_display_mode
*
adjusted_mode
)
{
return
true
;
}
static
int
nv
d
0_crtc_swap_fbs
(
struct
drm_crtc
*
crtc
,
struct
drm_framebuffer
*
old_fb
)
nv
5
0_crtc_swap_fbs
(
struct
drm_crtc
*
crtc
,
struct
drm_framebuffer
*
old_fb
)
{
struct
nouveau_framebuffer
*
nvfb
=
nouveau_framebuffer
(
crtc
->
fb
);
int
ret
;
...
...
@@ -1005,11 +1005,11 @@ nvd0_crtc_swap_fbs(struct drm_crtc *crtc, struct drm_framebuffer *old_fb)
}
static
int
nv
d
0_crtc_mode_set
(
struct
drm_crtc
*
crtc
,
struct
drm_display_mode
*
umode
,
nv
5
0_crtc_mode_set
(
struct
drm_crtc
*
crtc
,
struct
drm_display_mode
*
umode
,
struct
drm_display_mode
*
mode
,
int
x
,
int
y
,
struct
drm_framebuffer
*
old_fb
)
{
struct
nv
d0_mast
*
mast
=
nvd
0_mast
(
crtc
->
dev
);
struct
nv
50_mast
*
mast
=
nv5
0_mast
(
crtc
->
dev
);
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
struct
nouveau_connector
*
nv_connector
;
u32
ilace
=
(
mode
->
flags
&
DRM_MODE_FLAG_INTERLACE
)
?
2
:
1
;
...
...
@@ -1039,13 +1039,13 @@ nvd0_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode,
vactive
=
(
vactive
*
2
)
+
1
;
}
ret
=
nv
d
0_crtc_swap_fbs
(
crtc
,
old_fb
);
ret
=
nv
5
0_crtc_swap_fbs
(
crtc
,
old_fb
);
if
(
ret
)
return
ret
;
push
=
evo_wait
(
mast
,
64
);
if
(
push
)
{
if
(
nv
d
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
evo_mthd
(
push
,
0x0804
+
(
nv_crtc
->
index
*
0x400
),
2
);
evo_data
(
push
,
0x00800000
|
mode
->
clock
);
evo_data
(
push
,
(
ilace
==
2
)
?
2
:
0
);
...
...
@@ -1084,15 +1084,15 @@ nvd0_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode,
}
nv_connector
=
nouveau_crtc_connector_get
(
nv_crtc
);
nv
d
0_crtc_set_dither
(
nv_crtc
,
false
);
nv
d
0_crtc_set_scale
(
nv_crtc
,
false
);
nv
d
0_crtc_set_color_vibrance
(
nv_crtc
,
false
);
nv
d
0_crtc_set_image
(
nv_crtc
,
crtc
->
fb
,
x
,
y
,
false
);
nv
5
0_crtc_set_dither
(
nv_crtc
,
false
);
nv
5
0_crtc_set_scale
(
nv_crtc
,
false
);
nv
5
0_crtc_set_color_vibrance
(
nv_crtc
,
false
);
nv
5
0_crtc_set_image
(
nv_crtc
,
crtc
->
fb
,
x
,
y
,
false
);
return
0
;
}
static
int
nv
d
0_crtc_mode_set_base
(
struct
drm_crtc
*
crtc
,
int
x
,
int
y
,
nv
5
0_crtc_mode_set_base
(
struct
drm_crtc
*
crtc
,
int
x
,
int
y
,
struct
drm_framebuffer
*
old_fb
)
{
struct
nouveau_drm
*
drm
=
nouveau_drm
(
crtc
->
dev
);
...
...
@@ -1104,31 +1104,31 @@ nvd0_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
return
0
;
}
ret
=
nv
d
0_crtc_swap_fbs
(
crtc
,
old_fb
);
ret
=
nv
5
0_crtc_swap_fbs
(
crtc
,
old_fb
);
if
(
ret
)
return
ret
;
nv
d
0_display_flip_stop
(
crtc
);
nv
d
0_crtc_set_image
(
nv_crtc
,
crtc
->
fb
,
x
,
y
,
true
);
nv
d
0_display_flip_next
(
crtc
,
crtc
->
fb
,
NULL
,
1
);
nv
5
0_display_flip_stop
(
crtc
);
nv
5
0_crtc_set_image
(
nv_crtc
,
crtc
->
fb
,
x
,
y
,
true
);
nv
5
0_display_flip_next
(
crtc
,
crtc
->
fb
,
NULL
,
1
);
return
0
;
}
static
int
nv
d
0_crtc_mode_set_base_atomic
(
struct
drm_crtc
*
crtc
,
nv
5
0_crtc_mode_set_base_atomic
(
struct
drm_crtc
*
crtc
,
struct
drm_framebuffer
*
fb
,
int
x
,
int
y
,
enum
mode_set_atomic
state
)
{
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
nv
d
0_display_flip_stop
(
crtc
);
nv
d
0_crtc_set_image
(
nv_crtc
,
fb
,
x
,
y
,
true
);
nv
5
0_display_flip_stop
(
crtc
);
nv
5
0_crtc_set_image
(
nv_crtc
,
fb
,
x
,
y
,
true
);
return
0
;
}
static
void
nv
d
0_crtc_lut_load
(
struct
drm_crtc
*
crtc
)
nv
5
0_crtc_lut_load
(
struct
drm_crtc
*
crtc
)
{
struct
nv
d0_disp
*
disp
=
nvd
0_disp
(
crtc
->
dev
);
struct
nv
50_disp
*
disp
=
nv5
0_disp
(
crtc
->
dev
);
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
void
__iomem
*
lut
=
nvbo_kmap_obj_iovirtual
(
nv_crtc
->
lut
.
nvbo
);
int
i
;
...
...
@@ -1151,7 +1151,7 @@ nvd0_crtc_lut_load(struct drm_crtc *crtc)
}
static
int
nv
d
0_crtc_cursor_set
(
struct
drm_crtc
*
crtc
,
struct
drm_file
*
file_priv
,
nv
5
0_crtc_cursor_set
(
struct
drm_crtc
*
crtc
,
struct
drm_file
*
file_priv
,
uint32_t
handle
,
uint32_t
width
,
uint32_t
height
)
{
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
...
...
@@ -1183,7 +1183,7 @@ nvd0_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv,
}
if
(
visible
!=
nv_crtc
->
cursor
.
visible
)
{
nv
d
0_crtc_cursor_show_hide
(
nv_crtc
,
visible
,
true
);
nv
5
0_crtc_cursor_show_hide
(
nv_crtc
,
visible
,
true
);
nv_crtc
->
cursor
.
visible
=
visible
;
}
...
...
@@ -1191,17 +1191,17 @@ nvd0_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv,
}
static
int
nv
d
0_crtc_cursor_move
(
struct
drm_crtc
*
crtc
,
int
x
,
int
y
)
nv
5
0_crtc_cursor_move
(
struct
drm_crtc
*
crtc
,
int
x
,
int
y
)
{
struct
nv
d0_curs
*
curs
=
nvd
0_curs
(
crtc
);
struct
nv
d0_chan
*
chan
=
nvd
0_chan
(
curs
);
struct
nv
50_curs
*
curs
=
nv5
0_curs
(
crtc
);
struct
nv
50_chan
*
chan
=
nv5
0_chan
(
curs
);
nv_wo32
(
chan
->
user
,
0x0084
,
(
y
<<
16
)
|
(
x
&
0xffff
));
nv_wo32
(
chan
->
user
,
0x0080
,
0x00000000
);
return
0
;
}
static
void
nv
d
0_crtc_gamma_set
(
struct
drm_crtc
*
crtc
,
u16
*
r
,
u16
*
g
,
u16
*
b
,
nv
5
0_crtc_gamma_set
(
struct
drm_crtc
*
crtc
,
u16
*
r
,
u16
*
g
,
u16
*
b
,
uint32_t
start
,
uint32_t
size
)
{
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
...
...
@@ -1214,19 +1214,19 @@ nvd0_crtc_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,
nv_crtc
->
lut
.
b
[
i
]
=
b
[
i
];
}
nv
d
0_crtc_lut_load
(
crtc
);
nv
5
0_crtc_lut_load
(
crtc
);
}
static
void
nv
d
0_crtc_destroy
(
struct
drm_crtc
*
crtc
)
nv
5
0_crtc_destroy
(
struct
drm_crtc
*
crtc
)
{
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
struct
nv
d0_disp
*
disp
=
nvd
0_disp
(
crtc
->
dev
);
struct
nv
d0_head
*
head
=
nvd
0_head
(
crtc
);
nv
d
0_dmac_destroy
(
disp
->
core
,
&
head
->
ovly
.
base
);
nv
d
0_pioc_destroy
(
disp
->
core
,
&
head
->
oimm
.
base
);
nv
d
0_dmac_destroy
(
disp
->
core
,
&
head
->
sync
.
base
);
nv
d
0_pioc_destroy
(
disp
->
core
,
&
head
->
curs
.
base
);
struct
nv
50_disp
*
disp
=
nv5
0_disp
(
crtc
->
dev
);
struct
nv
50_head
*
head
=
nv5
0_head
(
crtc
);
nv
5
0_dmac_destroy
(
disp
->
core
,
&
head
->
ovly
.
base
);
nv
5
0_pioc_destroy
(
disp
->
core
,
&
head
->
oimm
.
base
);
nv
5
0_dmac_destroy
(
disp
->
core
,
&
head
->
sync
.
base
);
nv
5
0_pioc_destroy
(
disp
->
core
,
&
head
->
curs
.
base
);
nouveau_bo_unmap
(
nv_crtc
->
cursor
.
nvbo
);
nouveau_bo_ref
(
NULL
,
&
nv_crtc
->
cursor
.
nvbo
);
nouveau_bo_unmap
(
nv_crtc
->
lut
.
nvbo
);
...
...
@@ -1235,41 +1235,41 @@ nvd0_crtc_destroy(struct drm_crtc *crtc)
kfree
(
crtc
);
}
static
const
struct
drm_crtc_helper_funcs
nv
d
0_crtc_hfunc
=
{
.
dpms
=
nv
d
0_crtc_dpms
,
.
prepare
=
nv
d
0_crtc_prepare
,
.
commit
=
nv
d
0_crtc_commit
,
.
mode_fixup
=
nv
d
0_crtc_mode_fixup
,
.
mode_set
=
nv
d
0_crtc_mode_set
,
.
mode_set_base
=
nv
d
0_crtc_mode_set_base
,
.
mode_set_base_atomic
=
nv
d
0_crtc_mode_set_base_atomic
,
.
load_lut
=
nv
d
0_crtc_lut_load
,
static
const
struct
drm_crtc_helper_funcs
nv
5
0_crtc_hfunc
=
{
.
dpms
=
nv
5
0_crtc_dpms
,
.
prepare
=
nv
5
0_crtc_prepare
,
.
commit
=
nv
5
0_crtc_commit
,
.
mode_fixup
=
nv
5
0_crtc_mode_fixup
,
.
mode_set
=
nv
5
0_crtc_mode_set
,
.
mode_set_base
=
nv
5
0_crtc_mode_set_base
,
.
mode_set_base_atomic
=
nv
5
0_crtc_mode_set_base_atomic
,
.
load_lut
=
nv
5
0_crtc_lut_load
,
};
static
const
struct
drm_crtc_funcs
nv
d
0_crtc_func
=
{
.
cursor_set
=
nv
d
0_crtc_cursor_set
,
.
cursor_move
=
nv
d
0_crtc_cursor_move
,
.
gamma_set
=
nv
d
0_crtc_gamma_set
,
static
const
struct
drm_crtc_funcs
nv
5
0_crtc_func
=
{
.
cursor_set
=
nv
5
0_crtc_cursor_set
,
.
cursor_move
=
nv
5
0_crtc_cursor_move
,
.
gamma_set
=
nv
5
0_crtc_gamma_set
,
.
set_config
=
drm_crtc_helper_set_config
,
.
destroy
=
nv
d
0_crtc_destroy
,
.
destroy
=
nv
5
0_crtc_destroy
,
.
page_flip
=
nouveau_crtc_page_flip
,
};
static
void
nv
d
0_cursor_set_pos
(
struct
nouveau_crtc
*
nv_crtc
,
int
x
,
int
y
)
nv
5
0_cursor_set_pos
(
struct
nouveau_crtc
*
nv_crtc
,
int
x
,
int
y
)
{
}
static
void
nv
d
0_cursor_set_offset
(
struct
nouveau_crtc
*
nv_crtc
,
uint32_t
offset
)
nv
5
0_cursor_set_offset
(
struct
nouveau_crtc
*
nv_crtc
,
uint32_t
offset
)
{
}
static
int
nv
d
0_crtc_create
(
struct
drm_device
*
dev
,
struct
nouveau_object
*
core
,
int
index
)
nv
5
0_crtc_create
(
struct
drm_device
*
dev
,
struct
nouveau_object
*
core
,
int
index
)
{
struct
nv
d0_disp
*
disp
=
nvd
0_disp
(
dev
);
struct
nv
d
0_head
*
head
;
struct
nv
50_disp
*
disp
=
nv5
0_disp
(
dev
);
struct
nv
5
0_head
*
head
;
struct
drm_crtc
*
crtc
;
int
ret
,
i
;
...
...
@@ -1278,13 +1278,13 @@ nvd0_crtc_create(struct drm_device *dev, struct nouveau_object *core, int index)
return
-
ENOMEM
;
head
->
base
.
index
=
index
;
head
->
base
.
set_dither
=
nv
d
0_crtc_set_dither
;
head
->
base
.
set_scale
=
nv
d
0_crtc_set_scale
;
head
->
base
.
set_color_vibrance
=
nv
d
0_crtc_set_color_vibrance
;
head
->
base
.
set_dither
=
nv
5
0_crtc_set_dither
;
head
->
base
.
set_scale
=
nv
5
0_crtc_set_scale
;
head
->
base
.
set_color_vibrance
=
nv
5
0_crtc_set_color_vibrance
;
head
->
base
.
color_vibrance
=
50
;
head
->
base
.
vibrant_hue
=
0
;
head
->
base
.
cursor
.
set_offset
=
nv
d
0_cursor_set_offset
;
head
->
base
.
cursor
.
set_pos
=
nv
d
0_cursor_set_pos
;
head
->
base
.
cursor
.
set_offset
=
nv
5
0_cursor_set_offset
;
head
->
base
.
cursor
.
set_pos
=
nv
5
0_cursor_set_pos
;
for
(
i
=
0
;
i
<
256
;
i
++
)
{
head
->
base
.
lut
.
r
[
i
]
=
i
<<
8
;
head
->
base
.
lut
.
g
[
i
]
=
i
<<
8
;
...
...
@@ -1292,8 +1292,8 @@ nvd0_crtc_create(struct drm_device *dev, struct nouveau_object *core, int index)
}
crtc
=
&
head
->
base
.
base
;
drm_crtc_init
(
dev
,
crtc
,
&
nv
d
0_crtc_func
);
drm_crtc_helper_add
(
crtc
,
&
nv
d
0_crtc_hfunc
);
drm_crtc_init
(
dev
,
crtc
,
&
nv
5
0_crtc_func
);
drm_crtc_helper_add
(
crtc
,
&
nv
5
0_crtc_hfunc
);
drm_mode_crtc_set_gamma_size
(
crtc
,
256
);
ret
=
nouveau_bo_new
(
dev
,
8192
,
0x100
,
TTM_PL_FLAG_VRAM
,
...
...
@@ -1309,10 +1309,10 @@ nvd0_crtc_create(struct drm_device *dev, struct nouveau_object *core, int index)
if
(
ret
)
goto
out
;
nv
d
0_crtc_lut_load
(
crtc
);
nv
5
0_crtc_lut_load
(
crtc
);
/* allocate cursor resources */
ret
=
nv
d
0_pioc_create
(
disp
->
core
,
NV50_DISP_CURS_CLASS
,
index
,
ret
=
nv
5
0_pioc_create
(
disp
->
core
,
NV50_DISP_CURS_CLASS
,
index
,
&
(
struct
nv50_display_curs_class
)
{
.
head
=
index
,
},
sizeof
(
struct
nv50_display_curs_class
),
...
...
@@ -1334,7 +1334,7 @@ nvd0_crtc_create(struct drm_device *dev, struct nouveau_object *core, int index)
goto
out
;
/* allocate page flip / sync resources */
ret
=
nv
d
0_dmac_create
(
disp
->
core
,
NV50_DISP_SYNC_CLASS
,
index
,
ret
=
nv
5
0_dmac_create
(
disp
->
core
,
NV50_DISP_SYNC_CLASS
,
index
,
&
(
struct
nv50_display_sync_class
)
{
.
pushbuf
=
EVO_PUSH_HANDLE
(
SYNC
,
index
),
.
head
=
index
,
...
...
@@ -1346,7 +1346,7 @@ nvd0_crtc_create(struct drm_device *dev, struct nouveau_object *core, int index)
head
->
sync
.
sem
.
offset
=
EVO_SYNC
(
1
+
index
,
0x00
);
/* allocate overlay resources */
ret
=
nv
d
0_pioc_create
(
disp
->
core
,
NV50_DISP_OIMM_CLASS
,
index
,
ret
=
nv
5
0_pioc_create
(
disp
->
core
,
NV50_DISP_OIMM_CLASS
,
index
,
&
(
struct
nv50_display_oimm_class
)
{
.
head
=
index
,
},
sizeof
(
struct
nv50_display_oimm_class
),
...
...
@@ -1354,7 +1354,7 @@ nvd0_crtc_create(struct drm_device *dev, struct nouveau_object *core, int index)
if
(
ret
)
goto
out
;
ret
=
nv
d
0_dmac_create
(
disp
->
core
,
NV50_DISP_OVLY_CLASS
,
index
,
ret
=
nv
5
0_dmac_create
(
disp
->
core
,
NV50_DISP_OVLY_CLASS
,
index
,
&
(
struct
nv50_display_ovly_class
)
{
.
pushbuf
=
EVO_PUSH_HANDLE
(
OVLY
,
index
),
.
head
=
index
,
...
...
@@ -1365,7 +1365,7 @@ nvd0_crtc_create(struct drm_device *dev, struct nouveau_object *core, int index)
out:
if
(
ret
)
nv
d
0_crtc_destroy
(
crtc
);
nv
5
0_crtc_destroy
(
crtc
);
return
ret
;
}
...
...
@@ -1373,10 +1373,10 @@ nvd0_crtc_create(struct drm_device *dev, struct nouveau_object *core, int index)
* DAC
*****************************************************************************/
static
void
nv
d
0_dac_dpms
(
struct
drm_encoder
*
encoder
,
int
mode
)
nv
5
0_dac_dpms
(
struct
drm_encoder
*
encoder
,
int
mode
)
{
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
struct
nv
d0_disp
*
disp
=
nvd
0_disp
(
encoder
->
dev
);
struct
nv
50_disp
*
disp
=
nv5
0_disp
(
encoder
->
dev
);
int
or
=
nv_encoder
->
or
;
u32
dpms_ctrl
;
...
...
@@ -1390,7 +1390,7 @@ nvd0_dac_dpms(struct drm_encoder *encoder, int mode)
}
static
bool
nv
d
0_dac_mode_fixup
(
struct
drm_encoder
*
encoder
,
nv
5
0_dac_mode_fixup
(
struct
drm_encoder
*
encoder
,
const
struct
drm_display_mode
*
mode
,
struct
drm_display_mode
*
adjusted_mode
)
{
...
...
@@ -1410,24 +1410,24 @@ nvd0_dac_mode_fixup(struct drm_encoder *encoder,
}
static
void
nv
d
0_dac_commit
(
struct
drm_encoder
*
encoder
)
nv
5
0_dac_commit
(
struct
drm_encoder
*
encoder
)
{
}
static
void
nv
d
0_dac_mode_set
(
struct
drm_encoder
*
encoder
,
struct
drm_display_mode
*
mode
,
nv
5
0_dac_mode_set
(
struct
drm_encoder
*
encoder
,
struct
drm_display_mode
*
mode
,
struct
drm_display_mode
*
adjusted_mode
)
{
struct
nv
d0_mast
*
mast
=
nvd
0_mast
(
encoder
->
dev
);
struct
nv
50_mast
*
mast
=
nv5
0_mast
(
encoder
->
dev
);
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
encoder
->
crtc
);
u32
*
push
;
nv
d
0_dac_dpms
(
encoder
,
DRM_MODE_DPMS_ON
);
nv
5
0_dac_dpms
(
encoder
,
DRM_MODE_DPMS_ON
);
push
=
evo_wait
(
mast
,
8
);
if
(
push
)
{
if
(
nv
d
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
u32
syncs
=
0x00000000
;
if
(
mode
->
flags
&
DRM_MODE_FLAG_NHSYNC
)
...
...
@@ -1464,19 +1464,19 @@ nvd0_dac_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
}
static
void
nv
d
0_dac_disconnect
(
struct
drm_encoder
*
encoder
)
nv
5
0_dac_disconnect
(
struct
drm_encoder
*
encoder
)
{
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
struct
nv
d0_mast
*
mast
=
nvd
0_mast
(
encoder
->
dev
);
struct
nv
50_mast
*
mast
=
nv5
0_mast
(
encoder
->
dev
);
const
int
or
=
nv_encoder
->
or
;
u32
*
push
;
if
(
nv_encoder
->
crtc
)
{
nv
d
0_crtc_prepare
(
nv_encoder
->
crtc
);
nv
5
0_crtc_prepare
(
nv_encoder
->
crtc
);
push
=
evo_wait
(
mast
,
4
);
if
(
push
)
{
if
(
nv
d
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
evo_mthd
(
push
,
0x0400
+
(
or
*
0x080
),
1
);
evo_data
(
push
,
0x00000000
);
}
else
{
...
...
@@ -1494,9 +1494,9 @@ nvd0_dac_disconnect(struct drm_encoder *encoder)
}
static
enum
drm_connector_status
nv
d
0_dac_detect
(
struct
drm_encoder
*
encoder
,
struct
drm_connector
*
connector
)
nv
5
0_dac_detect
(
struct
drm_encoder
*
encoder
,
struct
drm_connector
*
connector
)
{
struct
nv
d0_disp
*
disp
=
nvd
0_disp
(
encoder
->
dev
);
struct
nv
50_disp
*
disp
=
nv5
0_disp
(
encoder
->
dev
);
int
ret
,
or
=
nouveau_encoder
(
encoder
)
->
or
;
u32
load
=
0
;
...
...
@@ -1508,29 +1508,29 @@ nvd0_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector)
}
static
void
nv
d
0_dac_destroy
(
struct
drm_encoder
*
encoder
)
nv
5
0_dac_destroy
(
struct
drm_encoder
*
encoder
)
{
drm_encoder_cleanup
(
encoder
);
kfree
(
encoder
);
}
static
const
struct
drm_encoder_helper_funcs
nv
d
0_dac_hfunc
=
{
.
dpms
=
nv
d
0_dac_dpms
,
.
mode_fixup
=
nv
d
0_dac_mode_fixup
,
.
prepare
=
nv
d
0_dac_disconnect
,
.
commit
=
nv
d
0_dac_commit
,
.
mode_set
=
nv
d
0_dac_mode_set
,
.
disable
=
nv
d
0_dac_disconnect
,
.
get_crtc
=
nv
d
0_display_crtc_get
,
.
detect
=
nv
d
0_dac_detect
static
const
struct
drm_encoder_helper_funcs
nv
5
0_dac_hfunc
=
{
.
dpms
=
nv
5
0_dac_dpms
,
.
mode_fixup
=
nv
5
0_dac_mode_fixup
,
.
prepare
=
nv
5
0_dac_disconnect
,
.
commit
=
nv
5
0_dac_commit
,
.
mode_set
=
nv
5
0_dac_mode_set
,
.
disable
=
nv
5
0_dac_disconnect
,
.
get_crtc
=
nv
5
0_display_crtc_get
,
.
detect
=
nv
5
0_dac_detect
};
static
const
struct
drm_encoder_funcs
nv
d
0_dac_func
=
{
.
destroy
=
nv
d
0_dac_destroy
,
static
const
struct
drm_encoder_funcs
nv
5
0_dac_func
=
{
.
destroy
=
nv
5
0_dac_destroy
,
};
static
int
nv
d
0_dac_create
(
struct
drm_connector
*
connector
,
struct
dcb_output
*
dcbe
)
nv
5
0_dac_create
(
struct
drm_connector
*
connector
,
struct
dcb_output
*
dcbe
)
{
struct
drm_device
*
dev
=
connector
->
dev
;
struct
nouveau_encoder
*
nv_encoder
;
...
...
@@ -1545,8 +1545,8 @@ nvd0_dac_create(struct drm_connector *connector, struct dcb_output *dcbe)
encoder
=
to_drm_encoder
(
nv_encoder
);
encoder
->
possible_crtcs
=
dcbe
->
heads
;
encoder
->
possible_clones
=
0
;
drm_encoder_init
(
dev
,
encoder
,
&
nv
d
0_dac_func
,
DRM_MODE_ENCODER_DAC
);
drm_encoder_helper_add
(
encoder
,
&
nv
d
0_dac_hfunc
);
drm_encoder_init
(
dev
,
encoder
,
&
nv
5
0_dac_func
,
DRM_MODE_ENCODER_DAC
);
drm_encoder_helper_add
(
encoder
,
&
nv
5
0_dac_hfunc
);
drm_mode_connector_attach_encoder
(
connector
,
encoder
);
return
0
;
...
...
@@ -1556,11 +1556,11 @@ nvd0_dac_create(struct drm_connector *connector, struct dcb_output *dcbe)
* Audio
*****************************************************************************/
static
void
nv
d
0_audio_mode_set
(
struct
drm_encoder
*
encoder
,
struct
drm_display_mode
*
mode
)
nv
5
0_audio_mode_set
(
struct
drm_encoder
*
encoder
,
struct
drm_display_mode
*
mode
)
{
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
struct
nouveau_connector
*
nv_connector
;
struct
nv
d0_disp
*
disp
=
nvd
0_disp
(
encoder
->
dev
);
struct
nv
50_disp
*
disp
=
nv5
0_disp
(
encoder
->
dev
);
nv_connector
=
nouveau_encoder_connector_get
(
nv_encoder
);
if
(
!
drm_detect_monitor_audio
(
nv_connector
->
edid
))
...
...
@@ -1574,10 +1574,10 @@ nvd0_audio_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode)
}
static
void
nv
d
0_audio_disconnect
(
struct
drm_encoder
*
encoder
)
nv
5
0_audio_disconnect
(
struct
drm_encoder
*
encoder
)
{
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
struct
nv
d0_disp
*
disp
=
nvd
0_disp
(
encoder
->
dev
);
struct
nv
50_disp
*
disp
=
nv5
0_disp
(
encoder
->
dev
);
nv_exec
(
disp
->
core
,
NVA3_DISP_SOR_HDA_ELD
+
nv_encoder
->
or
,
NULL
,
0
);
}
...
...
@@ -1586,12 +1586,12 @@ nvd0_audio_disconnect(struct drm_encoder *encoder)
* HDMI
*****************************************************************************/
static
void
nv
d
0_hdmi_mode_set
(
struct
drm_encoder
*
encoder
,
struct
drm_display_mode
*
mode
)
nv
5
0_hdmi_mode_set
(
struct
drm_encoder
*
encoder
,
struct
drm_display_mode
*
mode
)
{
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
encoder
->
crtc
);
struct
nouveau_connector
*
nv_connector
;
struct
nv
d0_disp
*
disp
=
nvd
0_disp
(
encoder
->
dev
);
struct
nv
50_disp
*
disp
=
nv5
0_disp
(
encoder
->
dev
);
const
u32
moff
=
(
nv_crtc
->
index
<<
3
)
|
nv_encoder
->
or
;
u32
rekey
=
56
;
/* binary driver, and tegra constant */
u32
max_ac_packet
;
...
...
@@ -1609,18 +1609,18 @@ nvd0_hdmi_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode)
NV84_DISP_SOR_HDMI_PWR_STATE_ON
|
(
max_ac_packet
<<
16
)
|
rekey
);
nv
d
0_audio_mode_set
(
encoder
,
mode
);
nv
5
0_audio_mode_set
(
encoder
,
mode
);
}
static
void
nv
d
0_hdmi_disconnect
(
struct
drm_encoder
*
encoder
)
nv
5
0_hdmi_disconnect
(
struct
drm_encoder
*
encoder
)
{
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
nv_encoder
->
crtc
);
struct
nv
d0_disp
*
disp
=
nvd
0_disp
(
encoder
->
dev
);
struct
nv
50_disp
*
disp
=
nv5
0_disp
(
encoder
->
dev
);
const
u32
moff
=
(
nv_crtc
->
index
<<
3
)
|
nv_encoder
->
or
;
nv
d
0_audio_disconnect
(
encoder
);
nv
5
0_audio_disconnect
(
encoder
);
nv_call
(
disp
->
core
,
NV84_DISP_SOR_HDMI_PWR
+
moff
,
0x00000000
);
}
...
...
@@ -1629,11 +1629,11 @@ nvd0_hdmi_disconnect(struct drm_encoder *encoder)
* SOR
*****************************************************************************/
static
void
nv
d
0_sor_dpms
(
struct
drm_encoder
*
encoder
,
int
mode
)
nv
5
0_sor_dpms
(
struct
drm_encoder
*
encoder
,
int
mode
)
{
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
struct
drm_device
*
dev
=
encoder
->
dev
;
struct
nv
d0_disp
*
disp
=
nvd
0_disp
(
dev
);
struct
nv
50_disp
*
disp
=
nv5
0_disp
(
dev
);
struct
drm_encoder
*
partner
;
int
or
=
nv_encoder
->
or
;
...
...
@@ -1660,7 +1660,7 @@ nvd0_sor_dpms(struct drm_encoder *encoder, int mode)
}
static
bool
nv
d
0_sor_mode_fixup
(
struct
drm_encoder
*
encoder
,
nv
5
0_sor_mode_fixup
(
struct
drm_encoder
*
encoder
,
const
struct
drm_display_mode
*
mode
,
struct
drm_display_mode
*
adjusted_mode
)
{
...
...
@@ -1680,19 +1680,19 @@ nvd0_sor_mode_fixup(struct drm_encoder *encoder,
}
static
void
nv
d
0_sor_disconnect
(
struct
drm_encoder
*
encoder
)
nv
5
0_sor_disconnect
(
struct
drm_encoder
*
encoder
)
{
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
struct
nv
d0_mast
*
mast
=
nvd
0_mast
(
encoder
->
dev
);
struct
nv
50_mast
*
mast
=
nv5
0_mast
(
encoder
->
dev
);
const
int
or
=
nv_encoder
->
or
;
u32
*
push
;
if
(
nv_encoder
->
crtc
)
{
nv
d
0_crtc_prepare
(
nv_encoder
->
crtc
);
nv
5
0_crtc_prepare
(
nv_encoder
->
crtc
);
push
=
evo_wait
(
mast
,
4
);
if
(
push
)
{
if
(
nv
d
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NVD0_DISP_MAST_CLASS
)
{
evo_mthd
(
push
,
0x0600
+
(
or
*
0x40
),
1
);
evo_data
(
push
,
0x00000000
);
}
else
{
...
...
@@ -1705,7 +1705,7 @@ nvd0_sor_disconnect(struct drm_encoder *encoder)
evo_kick
(
push
,
mast
);
}
nv
d
0_hdmi_disconnect
(
encoder
);
nv
5
0_hdmi_disconnect
(
encoder
);
}
nv_encoder
->
last_dpms
=
DRM_MODE_DPMS_OFF
;
...
...
@@ -1713,24 +1713,24 @@ nvd0_sor_disconnect(struct drm_encoder *encoder)
}
static
void
nv
d
0_sor_prepare
(
struct
drm_encoder
*
encoder
)
nv
5
0_sor_prepare
(
struct
drm_encoder
*
encoder
)
{
nv
d
0_sor_disconnect
(
encoder
);
nv
5
0_sor_disconnect
(
encoder
);
if
(
nouveau_encoder
(
encoder
)
->
dcb
->
type
==
DCB_OUTPUT_DP
)
evo_sync
(
encoder
->
dev
);
}
static
void
nv
d
0_sor_commit
(
struct
drm_encoder
*
encoder
)
nv
5
0_sor_commit
(
struct
drm_encoder
*
encoder
)
{
}
static
void
nv
d
0_sor_mode_set
(
struct
drm_encoder
*
encoder
,
struct
drm_display_mode
*
umode
,
nv
5
0_sor_mode_set
(
struct
drm_encoder
*
encoder
,
struct
drm_display_mode
*
umode
,
struct
drm_display_mode
*
mode
)
{
struct
nv
d0_disp
*
disp
=
nvd
0_disp
(
encoder
->
dev
);
struct
nv
d0_mast
*
mast
=
nvd
0_mast
(
encoder
->
dev
);
struct
nv
50_disp
*
disp
=
nv5
0_disp
(
encoder
->
dev
);
struct
nv
50_mast
*
mast
=
nv5
0_mast
(
encoder
->
dev
);
struct
drm_device
*
dev
=
encoder
->
dev
;
struct
nouveau_drm
*
drm
=
nouveau_drm
(
dev
);
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
...
...
@@ -1754,7 +1754,7 @@ nvd0_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *umode,
proto
=
0x2
;
}
nv
d
0_hdmi_mode_set
(
encoder
,
mode
);
nv
5
0_hdmi_mode_set
(
encoder
,
mode
);
break
;
case
DCB_OUTPUT_LVDS
:
proto
=
0x0
;
...
...
@@ -1806,11 +1806,11 @@ nvd0_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *umode,
break
;
}
nv
d
0_sor_dpms
(
encoder
,
DRM_MODE_DPMS_ON
);
nv
5
0_sor_dpms
(
encoder
,
DRM_MODE_DPMS_ON
);
push
=
evo_wait
(
nv
d
0_mast
(
dev
),
8
);
push
=
evo_wait
(
nv
5
0_mast
(
dev
),
8
);
if
(
push
)
{
if
(
nv
d
0_vers
(
mast
)
<
NVD0_DISP_CLASS
)
{
if
(
nv
5
0_vers
(
mast
)
<
NVD0_DISP_CLASS
)
{
evo_mthd
(
push
,
0x0600
+
(
nv_encoder
->
or
*
0x040
),
1
);
evo_data
(
push
,
(
depth
<<
16
)
|
(
proto
<<
8
)
|
owner
);
}
else
{
...
...
@@ -1839,28 +1839,28 @@ nvd0_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *umode,
}
static
void
nv
d
0_sor_destroy
(
struct
drm_encoder
*
encoder
)
nv
5
0_sor_destroy
(
struct
drm_encoder
*
encoder
)
{
drm_encoder_cleanup
(
encoder
);
kfree
(
encoder
);
}
static
const
struct
drm_encoder_helper_funcs
nv
d
0_sor_hfunc
=
{
.
dpms
=
nv
d
0_sor_dpms
,
.
mode_fixup
=
nv
d
0_sor_mode_fixup
,
.
prepare
=
nv
d
0_sor_prepare
,
.
commit
=
nv
d
0_sor_commit
,
.
mode_set
=
nv
d
0_sor_mode_set
,
.
disable
=
nv
d
0_sor_disconnect
,
.
get_crtc
=
nv
d
0_display_crtc_get
,
static
const
struct
drm_encoder_helper_funcs
nv
5
0_sor_hfunc
=
{
.
dpms
=
nv
5
0_sor_dpms
,
.
mode_fixup
=
nv
5
0_sor_mode_fixup
,
.
prepare
=
nv
5
0_sor_prepare
,
.
commit
=
nv
5
0_sor_commit
,
.
mode_set
=
nv
5
0_sor_mode_set
,
.
disable
=
nv
5
0_sor_disconnect
,
.
get_crtc
=
nv
5
0_display_crtc_get
,
};
static
const
struct
drm_encoder_funcs
nv
d
0_sor_func
=
{
.
destroy
=
nv
d
0_sor_destroy
,
static
const
struct
drm_encoder_funcs
nv
5
0_sor_func
=
{
.
destroy
=
nv
5
0_sor_destroy
,
};
static
int
nv
d
0_sor_create
(
struct
drm_connector
*
connector
,
struct
dcb_output
*
dcbe
)
nv
5
0_sor_create
(
struct
drm_connector
*
connector
,
struct
dcb_output
*
dcbe
)
{
struct
drm_device
*
dev
=
connector
->
dev
;
struct
nouveau_encoder
*
nv_encoder
;
...
...
@@ -1876,8 +1876,8 @@ nvd0_sor_create(struct drm_connector *connector, struct dcb_output *dcbe)
encoder
=
to_drm_encoder
(
nv_encoder
);
encoder
->
possible_crtcs
=
dcbe
->
heads
;
encoder
->
possible_clones
=
0
;
drm_encoder_init
(
dev
,
encoder
,
&
nv
d
0_sor_func
,
DRM_MODE_ENCODER_TMDS
);
drm_encoder_helper_add
(
encoder
,
&
nv
d
0_sor_hfunc
);
drm_encoder_init
(
dev
,
encoder
,
&
nv
5
0_sor_func
,
DRM_MODE_ENCODER_TMDS
);
drm_encoder_helper_add
(
encoder
,
&
nv
5
0_sor_hfunc
);
drm_mode_connector_attach_encoder
(
connector
,
encoder
);
return
0
;
...
...
@@ -1887,18 +1887,18 @@ nvd0_sor_create(struct drm_connector *connector, struct dcb_output *dcbe)
* Init
*****************************************************************************/
void
nv
d
0_display_fini
(
struct
drm_device
*
dev
)
nv
5
0_display_fini
(
struct
drm_device
*
dev
)
{
}
int
nv
d
0_display_init
(
struct
drm_device
*
dev
)
nv
5
0_display_init
(
struct
drm_device
*
dev
)
{
u32
*
push
=
evo_wait
(
nv
d
0_mast
(
dev
),
32
);
u32
*
push
=
evo_wait
(
nv
5
0_mast
(
dev
),
32
);
if
(
push
)
{
evo_mthd
(
push
,
0x0088
,
1
);
evo_data
(
push
,
NvEvoSync
);
evo_kick
(
push
,
nv
d
0_mast
(
dev
));
evo_kick
(
push
,
nv
5
0_mast
(
dev
));
return
evo_sync
(
dev
);
}
...
...
@@ -1906,11 +1906,11 @@ nvd0_display_init(struct drm_device *dev)
}
void
nv
d
0_display_destroy
(
struct
drm_device
*
dev
)
nv
5
0_display_destroy
(
struct
drm_device
*
dev
)
{
struct
nv
d0_disp
*
disp
=
nvd
0_disp
(
dev
);
struct
nv
50_disp
*
disp
=
nv5
0_disp
(
dev
);
nv
d
0_dmac_destroy
(
disp
->
core
,
&
disp
->
mast
.
base
);
nv
5
0_dmac_destroy
(
disp
->
core
,
&
disp
->
mast
.
base
);
nouveau_bo_unmap
(
disp
->
sync
);
nouveau_bo_ref
(
NULL
,
&
disp
->
sync
);
...
...
@@ -1920,7 +1920,7 @@ nvd0_display_destroy(struct drm_device *dev)
}
int
nv
d
0_display_create
(
struct
drm_device
*
dev
)
nv
5
0_display_create
(
struct
drm_device
*
dev
)
{
static
const
u16
oclass
[]
=
{
NVE0_DISP_CLASS
,
...
...
@@ -1935,7 +1935,7 @@ nvd0_display_create(struct drm_device *dev)
struct
nouveau_drm
*
drm
=
nouveau_drm
(
dev
);
struct
dcb_table
*
dcb
=
&
drm
->
vbios
.
dcb
;
struct
drm_connector
*
connector
,
*
tmp
;
struct
nv
d
0_disp
*
disp
;
struct
nv
5
0_disp
*
disp
;
struct
dcb_output
*
dcbe
;
int
crtcs
,
ret
,
i
;
...
...
@@ -1944,9 +1944,9 @@ nvd0_display_create(struct drm_device *dev)
return
-
ENOMEM
;
nouveau_display
(
dev
)
->
priv
=
disp
;
nouveau_display
(
dev
)
->
dtor
=
nv
d
0_display_destroy
;
nouveau_display
(
dev
)
->
init
=
nv
d
0_display_init
;
nouveau_display
(
dev
)
->
fini
=
nv
d
0_display_fini
;
nouveau_display
(
dev
)
->
dtor
=
nv
5
0_display_destroy
;
nouveau_display
(
dev
)
->
init
=
nv
5
0_display_init
;
nouveau_display
(
dev
)
->
fini
=
nv
5
0_display_fini
;
/* small shared memory area we use for notifiers and semaphores */
ret
=
nouveau_bo_new
(
dev
,
4096
,
0x1000
,
TTM_PL_FLAG_VRAM
,
...
...
@@ -1974,7 +1974,7 @@ nvd0_display_create(struct drm_device *dev)
goto
out
;
/* allocate master evo channel */
ret
=
nv
d
0_dmac_create
(
disp
->
core
,
NV50_DISP_MAST_CLASS
,
0
,
ret
=
nv
5
0_dmac_create
(
disp
->
core
,
NV50_DISP_MAST_CLASS
,
0
,
&
(
struct
nv50_display_mast_class
)
{
.
pushbuf
=
EVO_PUSH_HANDLE
(
MAST
,
0
),
},
sizeof
(
struct
nv50_display_mast_class
),
...
...
@@ -1989,7 +1989,7 @@ nvd0_display_create(struct drm_device *dev)
crtcs
=
2
;
for
(
i
=
0
;
i
<
crtcs
;
i
++
)
{
ret
=
nv
d
0_crtc_create
(
dev
,
disp
->
core
,
i
);
ret
=
nv
5
0_crtc_create
(
dev
,
disp
->
core
,
i
);
if
(
ret
)
goto
out
;
}
...
...
@@ -2010,10 +2010,10 @@ nvd0_display_create(struct drm_device *dev)
case
DCB_OUTPUT_TMDS
:
case
DCB_OUTPUT_LVDS
:
case
DCB_OUTPUT_DP
:
nv
d
0_sor_create
(
connector
,
dcbe
);
nv
5
0_sor_create
(
connector
,
dcbe
);
break
;
case
DCB_OUTPUT_ANALOG
:
nv
d
0_dac_create
(
connector
,
dcbe
);
nv
5
0_dac_create
(
connector
,
dcbe
);
break
;
default:
NV_WARN
(
drm
,
"skipping unsupported encoder %d/%d
\n
"
,
...
...
@@ -2034,6 +2034,6 @@ nvd0_display_create(struct drm_device *dev)
out:
if
(
ret
)
nv
d
0_display_destroy
(
dev
);
nv
5
0_display_destroy
(
dev
);
return
ret
;
}
drivers/gpu/drm/nouveau/nv50_display.h
View file @
e225f446
...
...
@@ -31,15 +31,15 @@
#include "nouveau_crtc.h"
#include "nouveau_reg.h"
int
nv
d
0_display_create
(
struct
drm_device
*
);
void
nv
d
0_display_destroy
(
struct
drm_device
*
);
int
nv
d
0_display_init
(
struct
drm_device
*
);
void
nv
d
0_display_fini
(
struct
drm_device
*
);
int
nv
5
0_display_create
(
struct
drm_device
*
);
void
nv
5
0_display_destroy
(
struct
drm_device
*
);
int
nv
5
0_display_init
(
struct
drm_device
*
);
void
nv
5
0_display_fini
(
struct
drm_device
*
);
void
nv
d
0_display_flip_stop
(
struct
drm_crtc
*
);
int
nv
d
0_display_flip_next
(
struct
drm_crtc
*
,
struct
drm_framebuffer
*
,
void
nv
5
0_display_flip_stop
(
struct
drm_crtc
*
);
int
nv
5
0_display_flip_next
(
struct
drm_crtc
*
,
struct
drm_framebuffer
*
,
struct
nouveau_channel
*
,
u32
swap_interval
);
struct
nouveau_bo
*
nv
d
0_display_crtc_sema
(
struct
drm_device
*
,
int
head
);
struct
nouveau_bo
*
nv
5
0_display_crtc_sema
(
struct
drm_device
*
,
int
head
);
#endif
/* __NV50_DISPLAY_H__ */
drivers/gpu/drm/nouveau/nv50_fence.c
View file @
e225f446
...
...
@@ -70,7 +70,7 @@ nv50_fence_context_new(struct nouveau_channel *chan)
/* dma objects for display sync channel semaphore blocks */
for
(
i
=
0
;
!
ret
&&
i
<
dev
->
mode_config
.
num_crtc
;
i
++
)
{
struct
nouveau_bo
*
bo
=
nv
d
0_display_crtc_sema
(
dev
,
i
);
struct
nouveau_bo
*
bo
=
nv
5
0_display_crtc_sema
(
dev
,
i
);
ret
=
nouveau_object_new
(
nv_object
(
chan
->
cli
),
chan
->
handle
,
NvEvoSema0
+
i
,
0x003d
,
...
...
drivers/gpu/drm/nouveau/nv84_fence.c
View file @
e225f446
...
...
@@ -127,7 +127,7 @@ nv84_fence_context_new(struct nouveau_channel *chan)
/* dma objects for display sync channel semaphore blocks */
for
(
i
=
0
;
!
ret
&&
i
<
dev
->
mode_config
.
num_crtc
;
i
++
)
{
struct
nouveau_bo
*
bo
=
nv
d
0_display_crtc_sema
(
dev
,
i
);
struct
nouveau_bo
*
bo
=
nv
5
0_display_crtc_sema
(
dev
,
i
);
ret
=
nouveau_object_new
(
nv_object
(
chan
->
cli
),
chan
->
handle
,
NvEvoSema0
+
i
,
0x003d
,
...
...
drivers/gpu/drm/nouveau/nvc0_fence.c
View file @
e225f446
...
...
@@ -115,7 +115,7 @@ nvc0_fence_context_del(struct nouveau_channel *chan)
int
i
;
for
(
i
=
0
;
i
<
dev
->
mode_config
.
num_crtc
;
i
++
)
{
struct
nouveau_bo
*
bo
=
nv
d
0_display_crtc_sema
(
dev
,
i
);
struct
nouveau_bo
*
bo
=
nv
5
0_display_crtc_sema
(
dev
,
i
);
nouveau_bo_vma_del
(
bo
,
&
fctx
->
dispc_vma
[
i
]);
}
...
...
@@ -146,7 +146,7 @@ nvc0_fence_context_new(struct nouveau_channel *chan)
/* map display semaphore buffers into channel's vm */
for
(
i
=
0
;
!
ret
&&
i
<
chan
->
drm
->
dev
->
mode_config
.
num_crtc
;
i
++
)
{
struct
nouveau_bo
*
bo
=
nv
d
0_display_crtc_sema
(
chan
->
drm
->
dev
,
i
);
struct
nouveau_bo
*
bo
=
nv
5
0_display_crtc_sema
(
chan
->
drm
->
dev
,
i
);
ret
=
nouveau_bo_vma_add
(
bo
,
client
->
vm
,
&
fctx
->
dispc_vma
[
i
]);
}
...
...
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