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
04a39c57
Commit
04a39c57
authored
Feb 24, 2010
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau: merge nvbios and nouveau_bios_info
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
7f245b20
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
73 additions
and
81 deletions
+73
-81
drivers/gpu/drm/nouveau/nouveau_bios.c
drivers/gpu/drm/nouveau/nouveau_bios.c
+39
-43
drivers/gpu/drm/nouveau/nouveau_bios.h
drivers/gpu/drm/nouveau/nouveau_bios.h
+3
-6
drivers/gpu/drm/nouveau/nouveau_calc.c
drivers/gpu/drm/nouveau/nouveau_calc.c
+2
-2
drivers/gpu/drm/nouveau/nouveau_connector.c
drivers/gpu/drm/nouveau/nouveau_connector.c
+3
-3
drivers/gpu/drm/nouveau/nouveau_debugfs.c
drivers/gpu/drm/nouveau/nouveau_debugfs.c
+2
-2
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+1
-2
drivers/gpu/drm/nouveau/nouveau_hw.c
drivers/gpu/drm/nouveau/nouveau_hw.c
+3
-3
drivers/gpu/drm/nouveau/nouveau_i2c.c
drivers/gpu/drm/nouveau/nouveau_i2c.c
+1
-1
drivers/gpu/drm/nouveau/nv04_dac.c
drivers/gpu/drm/nouveau/nv04_dac.c
+4
-4
drivers/gpu/drm/nouveau/nv04_dfp.c
drivers/gpu/drm/nouveau/nv04_dfp.c
+2
-2
drivers/gpu/drm/nouveau/nv04_display.c
drivers/gpu/drm/nouveau/nv04_display.c
+1
-1
drivers/gpu/drm/nouveau/nv04_tv.c
drivers/gpu/drm/nouveau/nv04_tv.c
+1
-1
drivers/gpu/drm/nouveau/nv17_tv.c
drivers/gpu/drm/nouveau/nv17_tv.c
+3
-3
drivers/gpu/drm/nouveau/nv50_dac.c
drivers/gpu/drm/nouveau/nv50_dac.c
+2
-2
drivers/gpu/drm/nouveau/nv50_display.c
drivers/gpu/drm/nouveau/nv50_display.c
+6
-6
No files found.
drivers/gpu/drm/nouveau/nouveau_bios.c
View file @
04a39c57
This diff is collapsed.
Click to expand it.
drivers/gpu/drm/nouveau/nouveau_bios.h
View file @
04a39c57
...
...
@@ -186,18 +186,15 @@ struct pll_lims {
int
refclk
;
};
struct
nouveau_bios_info
{
struct
nvbios
{
struct
drm_device
*
dev
;
uint8_t
chip_version
;
uint32_t
dactestval
;
uint32_t
tvdactestval
;
uint8_t
digital_min_front_porch
;
bool
fp_no_ddc
;
};
struct
nvbios
{
struct
drm_device
*
dev
;
struct
nouveau_bios_info
pub
;
struct
mutex
lock
;
...
...
drivers/gpu/drm/nouveau/nouveau_calc.c
View file @
04a39c57
...
...
@@ -274,7 +274,7 @@ getMNP_single(struct drm_device *dev, struct pll_lims *pll_lim, int clk,
* returns calculated clock
*/
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
int
cv
=
dev_priv
->
vbios
->
chip_version
;
int
cv
=
dev_priv
->
vbios
.
chip_version
;
int
minvco
=
pll_lim
->
vco1
.
minfreq
,
maxvco
=
pll_lim
->
vco1
.
maxfreq
;
int
minM
=
pll_lim
->
vco1
.
min_m
,
maxM
=
pll_lim
->
vco1
.
max_m
;
int
minN
=
pll_lim
->
vco1
.
min_n
,
maxN
=
pll_lim
->
vco1
.
max_n
;
...
...
@@ -373,7 +373,7 @@ getMNP_double(struct drm_device *dev, struct pll_lims *pll_lim, int clk,
* returns calculated clock
*/
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
int
chip_version
=
dev_priv
->
vbios
->
chip_version
;
int
chip_version
=
dev_priv
->
vbios
.
chip_version
;
int
minvco1
=
pll_lim
->
vco1
.
minfreq
,
maxvco1
=
pll_lim
->
vco1
.
maxfreq
;
int
minvco2
=
pll_lim
->
vco2
.
minfreq
,
maxvco2
=
pll_lim
->
vco2
.
maxfreq
;
int
minU1
=
pll_lim
->
vco1
.
min_inputfreq
,
minU2
=
pll_lim
->
vco2
.
min_inputfreq
;
...
...
drivers/gpu/drm/nouveau/nouveau_connector.c
View file @
04a39c57
...
...
@@ -680,7 +680,7 @@ nouveau_connector_create_lvds(struct drm_device *dev,
/* Firstly try getting EDID over DDC, if allowed and I2C channel
* is available.
*/
if
(
!
dev_priv
->
VBIOS
.
pub
.
fp_no_ddc
&&
nv_encoder
->
dcb
->
i2c_index
<
0xf
)
if
(
!
dev_priv
->
vbios
.
fp_no_ddc
&&
nv_encoder
->
dcb
->
i2c_index
<
0xf
)
i2c
=
nouveau_i2c_find
(
dev
,
nv_encoder
->
dcb
->
i2c_index
);
if
(
i2c
)
{
...
...
@@ -695,7 +695,7 @@ nouveau_connector_create_lvds(struct drm_device *dev,
*/
if
(
!
nv_connector
->
edid
&&
nouveau_bios_fp_mode
(
dev
,
&
native
)
&&
(
nv_encoder
->
dcb
->
lvdsconf
.
use_straps_for_mode
||
dev_priv
->
VBIOS
.
pub
.
fp_no_ddc
))
{
dev_priv
->
vbios
.
fp_no_ddc
))
{
nv_connector
->
native_mode
=
drm_mode_duplicate
(
dev
,
&
native
);
goto
out
;
}
...
...
@@ -704,7 +704,7 @@ nouveau_connector_create_lvds(struct drm_device *dev,
* stored for the panel stored in them.
*/
if
(
!
nv_connector
->
edid
&&
!
nv_connector
->
native_mode
&&
!
dev_priv
->
VBIOS
.
pub
.
fp_no_ddc
)
{
!
dev_priv
->
vbios
.
fp_no_ddc
)
{
struct
edid
*
edid
=
(
struct
edid
*
)
nouveau_bios_embedded_edid
(
dev
);
if
(
edid
)
{
...
...
drivers/gpu/drm/nouveau/nouveau_debugfs.c
View file @
04a39c57
...
...
@@ -151,8 +151,8 @@ nouveau_debugfs_vbios_image(struct seq_file *m, void *data)
struct
drm_nouveau_private
*
dev_priv
=
node
->
minor
->
dev
->
dev_private
;
int
i
;
for
(
i
=
0
;
i
<
dev_priv
->
VBIOS
.
length
;
i
++
)
seq_printf
(
m
,
"%c"
,
dev_priv
->
VBIOS
.
data
[
i
]);
for
(
i
=
0
;
i
<
dev_priv
->
vbios
.
length
;
i
++
)
seq_printf
(
m
,
"%c"
,
dev_priv
->
vbios
.
data
[
i
]);
return
0
;
}
...
...
drivers/gpu/drm/nouveau/nouveau_drv.h
View file @
04a39c57
...
...
@@ -605,8 +605,7 @@ struct drm_nouveau_private {
struct
list_head
gpuobj_list
;
struct
nvbios
VBIOS
;
struct
nouveau_bios_info
*
vbios
;
struct
nvbios
vbios
;
struct
nv04_mode_state
mode_reg
;
struct
nv04_mode_state
saved_reg
;
...
...
drivers/gpu/drm/nouveau/nouveau_hw.c
View file @
04a39c57
...
...
@@ -160,7 +160,7 @@ static void
setPLL_single
(
struct
drm_device
*
dev
,
uint32_t
reg
,
struct
nouveau_pll_vals
*
pv
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
int
chip_version
=
dev_priv
->
vbios
->
chip_version
;
int
chip_version
=
dev_priv
->
vbios
.
chip_version
;
uint32_t
oldpll
=
NVReadRAMDAC
(
dev
,
0
,
reg
);
int
oldN
=
(
oldpll
>>
8
)
&
0xff
,
oldM
=
oldpll
&
0xff
;
uint32_t
pll
=
(
oldpll
&
0xfff80000
)
|
pv
->
log2P
<<
16
|
pv
->
NM1
;
...
...
@@ -216,7 +216,7 @@ setPLL_double_highregs(struct drm_device *dev, uint32_t reg1,
struct
nouveau_pll_vals
*
pv
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
int
chip_version
=
dev_priv
->
vbios
->
chip_version
;
int
chip_version
=
dev_priv
->
vbios
.
chip_version
;
bool
nv3035
=
chip_version
==
0x30
||
chip_version
==
0x35
;
uint32_t
reg2
=
reg1
+
((
reg1
==
NV_RAMDAC_VPLL2
)
?
0x5c
:
0x70
);
uint32_t
oldpll1
=
NVReadRAMDAC
(
dev
,
0
,
reg1
);
...
...
@@ -374,7 +374,7 @@ nouveau_hw_setpll(struct drm_device *dev, uint32_t reg1,
struct
nouveau_pll_vals
*
pv
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
int
cv
=
dev_priv
->
vbios
->
chip_version
;
int
cv
=
dev_priv
->
vbios
.
chip_version
;
if
(
cv
==
0x30
||
cv
==
0x31
||
cv
==
0x35
||
cv
==
0x36
||
cv
>=
0x40
)
{
...
...
drivers/gpu/drm/nouveau/nouveau_i2c.c
View file @
04a39c57
...
...
@@ -254,7 +254,7 @@ struct nouveau_i2c_chan *
nouveau_i2c_find
(
struct
drm_device
*
dev
,
int
index
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nvbios
*
bios
=
&
dev_priv
->
VBIOS
;
struct
nvbios
*
bios
=
&
dev_priv
->
vbios
;
if
(
index
>=
DCB_MAX_NUM_I2C_ENTRIES
)
return
NULL
;
...
...
drivers/gpu/drm/nouveau/nv04_dac.c
View file @
04a39c57
...
...
@@ -230,13 +230,13 @@ uint32_t nv17_dac_sample_load(struct drm_encoder *encoder)
if
(
dcb
->
type
==
OUTPUT_TV
)
{
testval
=
RGB_TEST_DATA
(
0xa0
,
0xa0
,
0xa0
);
if
(
dev_priv
->
vbios
->
tvdactestval
)
testval
=
dev_priv
->
vbios
->
tvdactestval
;
if
(
dev_priv
->
vbios
.
tvdactestval
)
testval
=
dev_priv
->
vbios
.
tvdactestval
;
}
else
{
testval
=
RGB_TEST_DATA
(
0x140
,
0x140
,
0x140
);
/* 0x94050140 */
if
(
dev_priv
->
vbios
->
dactestval
)
testval
=
dev_priv
->
vbios
->
dactestval
;
if
(
dev_priv
->
vbios
.
dactestval
)
testval
=
dev_priv
->
vbios
.
dactestval
;
}
saved_rtest_ctrl
=
NVReadRAMDAC
(
dev
,
0
,
NV_PRAMDAC_TEST_CONTROL
+
regoffset
);
...
...
drivers/gpu/drm/nouveau/nv04_dfp.c
View file @
04a39c57
...
...
@@ -269,10 +269,10 @@ static void nv04_dfp_mode_set(struct drm_encoder *encoder,
regp
->
fp_horiz_regs
[
FP_TOTAL
]
=
output_mode
->
htotal
-
1
;
if
(
!
nv_gf4_disp_arch
(
dev
)
||
(
output_mode
->
hsync_start
-
output_mode
->
hdisplay
)
>=
dev_priv
->
vbios
->
digital_min_front_porch
)
dev_priv
->
vbios
.
digital_min_front_porch
)
regp
->
fp_horiz_regs
[
FP_CRTC
]
=
output_mode
->
hdisplay
;
else
regp
->
fp_horiz_regs
[
FP_CRTC
]
=
output_mode
->
hsync_start
-
dev_priv
->
vbios
->
digital_min_front_porch
-
1
;
regp
->
fp_horiz_regs
[
FP_CRTC
]
=
output_mode
->
hsync_start
-
dev_priv
->
vbios
.
digital_min_front_porch
-
1
;
regp
->
fp_horiz_regs
[
FP_SYNC_START
]
=
output_mode
->
hsync_start
-
1
;
regp
->
fp_horiz_regs
[
FP_SYNC_END
]
=
output_mode
->
hsync_end
-
1
;
regp
->
fp_horiz_regs
[
FP_VALID_START
]
=
output_mode
->
hskew
;
...
...
drivers/gpu/drm/nouveau/nv04_display.c
View file @
04a39c57
...
...
@@ -93,7 +93,7 @@ int
nv04_display_create
(
struct
drm_device
*
dev
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
dcb_table
*
dcb
=
&
dev_priv
->
VBIOS
.
dcb
;
struct
dcb_table
*
dcb
=
&
dev_priv
->
vbios
.
dcb
;
struct
drm_encoder
*
encoder
;
struct
drm_crtc
*
crtc
;
uint16_t
connector
[
16
]
=
{
0
};
...
...
drivers/gpu/drm/nouveau/nv04_tv.c
View file @
04a39c57
...
...
@@ -262,7 +262,7 @@ int nv04_tv_create(struct drm_device *dev, struct dcb_entry *entry)
nv_encoder
->
or
=
ffs
(
entry
->
or
)
-
1
;
/* Run the slave-specific initialization */
adap
=
&
dev_priv
->
VBIOS
.
dcb
.
i2c
[
i2c_index
].
chan
->
adapter
;
adap
=
&
dev_priv
->
vbios
.
dcb
.
i2c
[
i2c_index
].
chan
->
adapter
;
was_locked
=
NVLockVgaCrtcs
(
dev
,
false
);
...
...
drivers/gpu/drm/nouveau/nv17_tv.c
View file @
04a39c57
...
...
@@ -45,8 +45,8 @@ static uint32_t nv42_tv_sample_load(struct drm_encoder *encoder)
#define RGB_TEST_DATA(r, g, b) (r << 0 | g << 10 | b << 20)
testval
=
RGB_TEST_DATA
(
0x82
,
0xeb
,
0x82
);
if
(
dev_priv
->
vbios
->
tvdactestval
)
testval
=
dev_priv
->
vbios
->
tvdactestval
;
if
(
dev_priv
->
vbios
.
tvdactestval
)
testval
=
dev_priv
->
vbios
.
tvdactestval
;
dacclk
=
NVReadRAMDAC
(
dev
,
0
,
NV_PRAMDAC_DACCLK
+
regoffset
);
head
=
(
dacclk
&
0x100
)
>>
8
;
...
...
@@ -367,7 +367,7 @@ static void nv17_tv_prepare(struct drm_encoder *encoder)
!
enc
->
crtc
&&
nv04_dfp_get_bound_head
(
dev
,
dcb
)
==
head
)
{
nv04_dfp_bind_head
(
dev
,
dcb
,
head
^
1
,
dev_priv
->
VBIOS
.
fp
.
dual_link
);
dev_priv
->
vbios
.
fp
.
dual_link
);
}
}
...
...
drivers/gpu/drm/nouveau/nv50_dac.c
View file @
04a39c57
...
...
@@ -79,8 +79,8 @@ nv50_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector)
}
/* Use bios provided value if possible. */
if
(
dev_priv
->
vbios
->
dactestval
)
{
load_pattern
=
dev_priv
->
vbios
->
dactestval
;
if
(
dev_priv
->
vbios
.
dactestval
)
{
load_pattern
=
dev_priv
->
vbios
.
dactestval
;
NV_DEBUG_KMS
(
dev
,
"Using bios provided load_pattern of %d
\n
"
,
load_pattern
);
}
else
{
...
...
drivers/gpu/drm/nouveau/nv50_display.c
View file @
04a39c57
...
...
@@ -465,7 +465,7 @@ static int nv50_display_disable(struct drm_device *dev)
int
nv50_display_create
(
struct
drm_device
*
dev
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
dcb_table
*
dcb
=
&
dev_priv
->
VBIOS
.
dcb
;
struct
dcb_table
*
dcb
=
&
dev_priv
->
vbios
.
dcb
;
uint32_t
connector
[
16
]
=
{};
int
ret
,
i
;
...
...
@@ -526,7 +526,7 @@ int nv50_display_create(struct drm_device *dev)
connector
[
entry
->
connector
]
|=
(
1
<<
entry
->
type
);
}
/* It appears that DCB 3.0+
VBIOS
has a connector table, however,
/* It appears that DCB 3.0+
vbios
has a connector table, however,
* I'm not 100% certain how to decode it correctly yet so just
* look at what encoders are present on each connector index and
* attempt to derive the connector type from that.
...
...
@@ -667,8 +667,8 @@ nv50_display_irq_head(struct drm_device *dev, int *phead,
return
-
1
;
}
for
(
i
=
0
;
i
<
dev_priv
->
VBIOS
.
dcb
.
entries
;
i
++
)
{
struct
dcb_entry
*
dcbent
=
&
dev_priv
->
VBIOS
.
dcb
.
entry
[
i
];
for
(
i
=
0
;
i
<
dev_priv
->
vbios
.
dcb
.
entries
;
i
++
)
{
struct
dcb_entry
*
dcbent
=
&
dev_priv
->
vbios
.
dcb
.
entry
[
i
];
if
(
dcbent
->
type
!=
type
)
continue
;
...
...
@@ -692,7 +692,7 @@ nv50_display_script_select(struct drm_device *dev, struct dcb_entry *dcbent,
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_connector
*
nv_connector
=
NULL
;
struct
drm_encoder
*
encoder
;
struct
nvbios
*
bios
=
&
dev_priv
->
VBIOS
;
struct
nvbios
*
bios
=
&
dev_priv
->
vbios
;
uint32_t
mc
,
script
=
0
,
or
;
list_for_each_entry
(
encoder
,
&
dev
->
mode_config
.
encoder_list
,
head
)
{
...
...
@@ -710,7 +710,7 @@ nv50_display_script_select(struct drm_device *dev, struct dcb_entry *dcbent,
switch
(
dcbent
->
type
)
{
case
OUTPUT_LVDS
:
script
=
(
mc
>>
8
)
&
0xf
;
if
(
bios
->
pub
.
fp_no_ddc
)
{
if
(
bios
->
fp_no_ddc
)
{
if
(
bios
->
fp
.
dual_link
)
script
|=
0x0100
;
if
(
bios
->
fp
.
if_is_24bit
)
...
...
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