Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Yusuf Khan
mesa
Commits
1bd1bf9d
Commit
1bd1bf9d
authored
Nov 04, 2022
by
Yusuf Khan
Browse files
nvc0/mt: tiling mode and compression support
Signed-off-by:
Yusuf Khan
<
yusisamerican@gmail.com
>
parent
650597a7
Pipeline
#729006
waiting for manual action with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c
View file @
1bd1bf9d
...
...
@@ -197,6 +197,36 @@ nvc0_mt_choose_storage_type(struct pipe_screen *pscreen,
return
nvc0_choose_tiled_storage_type
(
pscreen
,
mt
->
base
.
base
.
format
,
ms
,
compressed
);
}
static
uint32_t
nvc0_mt_choose_tile_mode
(
struct
pipe_screen
*
pscreen
,
const
struct
nv50_miptree
*
mt
,
bool
compressed
)
{
if
(
unlikely
(
mt
->
base
.
base
.
bind
&
PIPE_BIND_CURSOR
))
return
0
;
if
(
unlikely
(
mt
->
base
.
base
.
flags
&
NOUVEAU_RESOURCE_FLAG_LINEAR
))
return
0
;
if
(
!
compressed
)
return
0
;
switch
(
util_format_get_blocksizebits
(
format
))
{
case
16
:
return
0x1
;
/* NOUVEAU_GEM_TILE_16BPP */
case
32
:
return
0x2
;
/* NOUVEAU_GEM_TILE_32BPP */
default:
break
;
}
switch
(
format
)
{
case
PIPE_FORMAT_Z16_UNORM
:
return
0x30000
;
/* NOUVEAU_GEM_TILE_COMP */
default:
break
;
}
return
0x30000
;
}
static
inline
bool
nvc0_miptree_init_ms_mode
(
struct
nv50_miptree
*
mt
)
{
...
...
@@ -526,7 +556,7 @@ nvc0_miptree_create(struct pipe_screen *pscreen,
return
NULL
;
}
}
bo_config
.
nvc0
.
tile_mode
=
mt
->
level
[
0
].
tile_mode
;
bo_config
.
nvc0
.
tile_mode
=
mt
->
level
[
0
].
tile_mode
|
nvc0_mt_choose_tile_mode
(
pscreen
,
mt
,
compressed
)
;
if
(
!
bo_config
.
nvc0
.
memtype
&&
(
pt
->
usage
==
PIPE_USAGE_STAGING
||
pt
->
bind
&
PIPE_BIND_SHARED
))
mt
->
base
.
domain
=
NOUVEAU_BO_GART
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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