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
267dcb66
Commit
267dcb66
authored
Feb 24, 2014
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/gm107/fb: initial implementation
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
57f74220
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
109 additions
and
8 deletions
+109
-8
drivers/gpu/drm/nouveau/Makefile
drivers/gpu/drm/nouveau/Makefile
+2
-0
drivers/gpu/drm/nouveau/core/include/subdev/fb.h
drivers/gpu/drm/nouveau/core/include/subdev/fb.h
+1
-0
drivers/gpu/drm/nouveau/core/subdev/fb/gm107.c
drivers/gpu/drm/nouveau/core/subdev/fb/gm107.c
+38
-0
drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.h
drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.h
+5
-3
drivers/gpu/drm/nouveau/core/subdev/fb/priv.h
drivers/gpu/drm/nouveau/core/subdev/fb/priv.h
+1
-0
drivers/gpu/drm/nouveau/core/subdev/fb/ramgm107.c
drivers/gpu/drm/nouveau/core/subdev/fb/ramgm107.c
+56
-0
drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c
drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c
+4
-3
drivers/gpu/drm/nouveau/core/subdev/fb/ramnve0.c
drivers/gpu/drm/nouveau/core/subdev/fb/ramnve0.c
+2
-2
No files found.
drivers/gpu/drm/nouveau/Makefile
View file @
267dcb66
...
...
@@ -101,6 +101,7 @@ nouveau-y += core/subdev/fb/nvaa.o
nouveau-y
+=
core/subdev/fb/nvaf.o
nouveau-y
+=
core/subdev/fb/nvc0.o
nouveau-y
+=
core/subdev/fb/nve0.o
nouveau-y
+=
core/subdev/fb/gm107.o
nouveau-y
+=
core/subdev/fb/ramnv04.o
nouveau-y
+=
core/subdev/fb/ramnv10.o
nouveau-y
+=
core/subdev/fb/ramnv1a.o
...
...
@@ -115,6 +116,7 @@ nouveau-y += core/subdev/fb/ramnva3.o
nouveau-y
+=
core/subdev/fb/ramnvaa.o
nouveau-y
+=
core/subdev/fb/ramnvc0.o
nouveau-y
+=
core/subdev/fb/ramnve0.o
nouveau-y
+=
core/subdev/fb/ramgm107.o
nouveau-y
+=
core/subdev/fb/sddr3.o
nouveau-y
+=
core/subdev/fb/gddr5.o
nouveau-y
+=
core/subdev/gpio/base.o
...
...
drivers/gpu/drm/nouveau/core/include/subdev/fb.h
View file @
267dcb66
...
...
@@ -105,6 +105,7 @@ extern struct nouveau_oclass *nvaa_fb_oclass;
extern
struct
nouveau_oclass
*
nvaf_fb_oclass
;
extern
struct
nouveau_oclass
*
nvc0_fb_oclass
;
extern
struct
nouveau_oclass
*
nve0_fb_oclass
;
extern
struct
nouveau_oclass
*
gm107_fb_oclass
;
#include <subdev/bios/ramcfg.h>
...
...
drivers/gpu/drm/nouveau/core/subdev/fb/gm107.c
0 → 100644
View file @
267dcb66
/*
* Copyright 2012 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Ben Skeggs
*/
#include "nvc0.h"
struct
nouveau_oclass
*
gm107_fb_oclass
=
&
(
struct
nouveau_fb_impl
)
{
.
base
.
handle
=
NV_SUBDEV
(
FB
,
0x07
),
.
base
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nvc0_fb_ctor
,
.
dtor
=
nvc0_fb_dtor
,
.
init
=
nvc0_fb_init
,
.
fini
=
_nouveau_fb_fini
,
},
.
memtype
=
nvc0_fb_memtype_valid
,
.
ram
=
&
gm107_ram_oclass
,
}.
base
;
drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.h
View file @
267dcb66
...
...
@@ -18,12 +18,14 @@ int nvc0_fb_init(struct nouveau_object *);
bool
nvc0_fb_memtype_valid
(
struct
nouveau_fb
*
,
u32
);
#define nvc0_ram_create(p,e,o,
d)
\
nvc0_ram_create_((p), (e), (o), sizeof(**d), (void **)d)
#define nvc0_ram_create(p,e,o,
m,d)
\
nvc0_ram_create_((p), (e), (o),
(m),
sizeof(**d), (void **)d)
int
nvc0_ram_create_
(
struct
nouveau_object
*
,
struct
nouveau_object
*
,
struct
nouveau_oclass
*
,
int
,
void
**
);
struct
nouveau_oclass
*
,
u32
,
int
,
void
**
);
int
nvc0_ram_get
(
struct
nouveau_fb
*
,
u64
,
u32
,
u32
,
u32
,
struct
nouveau_mem
**
);
void
nvc0_ram_put
(
struct
nouveau_fb
*
,
struct
nouveau_mem
**
);
int
nve0_ram_init
(
struct
nouveau_object
*
);
#endif
drivers/gpu/drm/nouveau/core/subdev/fb/priv.h
View file @
267dcb66
...
...
@@ -32,6 +32,7 @@ extern struct nouveau_oclass nva3_ram_oclass;
extern
struct
nouveau_oclass
nvaa_ram_oclass
;
extern
struct
nouveau_oclass
nvc0_ram_oclass
;
extern
struct
nouveau_oclass
nve0_ram_oclass
;
extern
struct
nouveau_oclass
gm107_ram_oclass
;
int
nouveau_sddr3_calc
(
struct
nouveau_ram
*
ram
);
int
nouveau_gddr5_calc
(
struct
nouveau_ram
*
ram
,
bool
nuts
);
...
...
drivers/gpu/drm/nouveau/core/subdev/fb/ramgm107.c
0 → 100644
View file @
267dcb66
/*
* Copyright 2013 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Ben Skeggs
*/
#include "nvc0.h"
struct
gm107_ram
{
struct
nouveau_ram
base
;
};
static
int
gm107_ram_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nouveau_object
**
pobject
)
{
struct
gm107_ram
*
ram
;
int
ret
;
ret
=
nvc0_ram_create
(
parent
,
engine
,
oclass
,
0x021c14
,
&
ram
);
*
pobject
=
nv_object
(
ram
);
if
(
ret
)
return
ret
;
return
0
;
}
struct
nouveau_oclass
gm107_ram_oclass
=
{
.
handle
=
0
,
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
gm107_ram_ctor
,
.
dtor
=
_nouveau_ram_dtor
,
.
init
=
nve0_ram_init
,
.
fini
=
_nouveau_ram_fini
,
}
};
drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c
View file @
267dcb66
...
...
@@ -505,7 +505,8 @@ nvc0_ram_get(struct nouveau_fb *pfb, u64 size, u32 align, u32 ncmin,
int
nvc0_ram_create_
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
int
size
,
void
**
pobject
)
struct
nouveau_oclass
*
oclass
,
u32
maskaddr
,
int
size
,
void
**
pobject
)
{
struct
nouveau_fb
*
pfb
=
nouveau_fb
(
parent
);
struct
nouveau_bios
*
bios
=
nouveau_bios
(
pfb
);
...
...
@@ -513,7 +514,7 @@ nvc0_ram_create_(struct nouveau_object *parent, struct nouveau_object *engine,
const
u32
rsvd_head
=
(
256
*
1024
)
>>
12
;
/* vga memory */
const
u32
rsvd_tail
=
(
1024
*
1024
)
>>
12
;
/* vbios etc */
u32
parts
=
nv_rd32
(
pfb
,
0x022438
);
u32
pmask
=
nv_rd32
(
pfb
,
0x022554
);
u32
pmask
=
nv_rd32
(
pfb
,
maskaddr
);
u32
bsize
=
nv_rd32
(
pfb
,
0x10f20c
);
u32
offset
,
length
;
bool
uniform
=
true
;
...
...
@@ -630,7 +631,7 @@ nvc0_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct
nvc0_ram
*
ram
;
int
ret
;
ret
=
nvc0_ram_create
(
parent
,
engine
,
oclass
,
&
ram
);
ret
=
nvc0_ram_create
(
parent
,
engine
,
oclass
,
0x022554
,
&
ram
);
*
pobject
=
nv_object
(
ram
);
if
(
ret
)
return
ret
;
...
...
drivers/gpu/drm/nouveau/core/subdev/fb/ramnve0.c
View file @
267dcb66
...
...
@@ -1123,7 +1123,7 @@ nve0_ram_tidy(struct nouveau_fb *pfb)
ram_exec
(
fuc
,
false
);
}
static
int
int
nve0_ram_init
(
struct
nouveau_object
*
object
)
{
struct
nouveau_fb
*
pfb
=
(
void
*
)
object
->
parent
;
...
...
@@ -1226,7 +1226,7 @@ nve0_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
int
ret
,
i
;
u32
tmp
;
ret
=
nvc0_ram_create
(
parent
,
engine
,
oclass
,
&
ram
);
ret
=
nvc0_ram_create
(
parent
,
engine
,
oclass
,
0x022554
,
&
ram
);
*
pobject
=
nv_object
(
ram
);
if
(
ret
)
return
ret
;
...
...
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