mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-12 16:11:04 +00:00
drm/nouveau/fb/ga10[024]: initial support
No VPR scrub. GA102 and GA104 have a new VRAM size detection method. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
de4781d0f2
commit
41ba806f40
@ -86,6 +86,8 @@ int gp100_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
|
|||||||
int gp102_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
|
int gp102_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
|
||||||
int gp10b_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
|
int gp10b_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
|
||||||
int gv100_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
|
int gv100_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
|
||||||
|
int ga100_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
|
||||||
|
int ga102_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
|
||||||
|
|
||||||
#include <subdev/bios.h>
|
#include <subdev/bios.h>
|
||||||
#include <subdev/bios/ramcfg.h>
|
#include <subdev/bios/ramcfg.h>
|
||||||
|
@ -2657,6 +2657,7 @@ nv170_chipset = {
|
|||||||
.name = "GA100",
|
.name = "GA100",
|
||||||
.bios = nvkm_bios_new,
|
.bios = nvkm_bios_new,
|
||||||
.devinit = ga100_devinit_new,
|
.devinit = ga100_devinit_new,
|
||||||
|
.fb = ga100_fb_new,
|
||||||
.ibus = gm200_ibus_new,
|
.ibus = gm200_ibus_new,
|
||||||
.imem = nv50_instmem_new,
|
.imem = nv50_instmem_new,
|
||||||
.mc = ga100_mc_new,
|
.mc = ga100_mc_new,
|
||||||
@ -2668,6 +2669,7 @@ nv172_chipset = {
|
|||||||
.name = "GA102",
|
.name = "GA102",
|
||||||
.bios = nvkm_bios_new,
|
.bios = nvkm_bios_new,
|
||||||
.devinit = ga100_devinit_new,
|
.devinit = ga100_devinit_new,
|
||||||
|
.fb = ga102_fb_new,
|
||||||
.ibus = gm200_ibus_new,
|
.ibus = gm200_ibus_new,
|
||||||
.imem = nv50_instmem_new,
|
.imem = nv50_instmem_new,
|
||||||
.mc = ga100_mc_new,
|
.mc = ga100_mc_new,
|
||||||
@ -2679,6 +2681,7 @@ nv174_chipset = {
|
|||||||
.name = "GA104",
|
.name = "GA104",
|
||||||
.bios = nvkm_bios_new,
|
.bios = nvkm_bios_new,
|
||||||
.devinit = ga100_devinit_new,
|
.devinit = ga100_devinit_new,
|
||||||
|
.fb = ga102_fb_new,
|
||||||
.ibus = gm200_ibus_new,
|
.ibus = gm200_ibus_new,
|
||||||
.imem = nv50_instmem_new,
|
.imem = nv50_instmem_new,
|
||||||
.mc = ga100_mc_new,
|
.mc = ga100_mc_new,
|
||||||
|
@ -32,6 +32,8 @@ nvkm-y += nvkm/subdev/fb/gp100.o
|
|||||||
nvkm-y += nvkm/subdev/fb/gp102.o
|
nvkm-y += nvkm/subdev/fb/gp102.o
|
||||||
nvkm-y += nvkm/subdev/fb/gp10b.o
|
nvkm-y += nvkm/subdev/fb/gp10b.o
|
||||||
nvkm-y += nvkm/subdev/fb/gv100.o
|
nvkm-y += nvkm/subdev/fb/gv100.o
|
||||||
|
nvkm-y += nvkm/subdev/fb/ga100.o
|
||||||
|
nvkm-y += nvkm/subdev/fb/ga102.o
|
||||||
|
|
||||||
nvkm-y += nvkm/subdev/fb/ram.o
|
nvkm-y += nvkm/subdev/fb/ram.o
|
||||||
nvkm-y += nvkm/subdev/fb/ramnv04.o
|
nvkm-y += nvkm/subdev/fb/ramnv04.o
|
||||||
@ -52,6 +54,7 @@ nvkm-y += nvkm/subdev/fb/ramgk104.o
|
|||||||
nvkm-y += nvkm/subdev/fb/ramgm107.o
|
nvkm-y += nvkm/subdev/fb/ramgm107.o
|
||||||
nvkm-y += nvkm/subdev/fb/ramgm200.o
|
nvkm-y += nvkm/subdev/fb/ramgm200.o
|
||||||
nvkm-y += nvkm/subdev/fb/ramgp100.o
|
nvkm-y += nvkm/subdev/fb/ramgp100.o
|
||||||
|
nvkm-y += nvkm/subdev/fb/ramga102.o
|
||||||
nvkm-y += nvkm/subdev/fb/sddr2.o
|
nvkm-y += nvkm/subdev/fb/sddr2.o
|
||||||
nvkm-y += nvkm/subdev/fb/sddr3.o
|
nvkm-y += nvkm/subdev/fb/sddr3.o
|
||||||
nvkm-y += nvkm/subdev/fb/gddr3.o
|
nvkm-y += nvkm/subdev/fb/gddr3.o
|
||||||
|
40
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga100.c
Normal file
40
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga100.c
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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.
|
||||||
|
*/
|
||||||
|
#include "gf100.h"
|
||||||
|
#include "ram.h"
|
||||||
|
|
||||||
|
static const struct nvkm_fb_func
|
||||||
|
ga100_fb = {
|
||||||
|
.dtor = gf100_fb_dtor,
|
||||||
|
.oneinit = gf100_fb_oneinit,
|
||||||
|
.init = gp100_fb_init,
|
||||||
|
.init_page = gv100_fb_init_page,
|
||||||
|
.init_unkn = gp100_fb_init_unkn,
|
||||||
|
.ram_new = gp100_ram_new,
|
||||||
|
.default_bigpage = 16,
|
||||||
|
};
|
||||||
|
|
||||||
|
int
|
||||||
|
ga100_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb)
|
||||||
|
{
|
||||||
|
return gp102_fb_new_(&ga100_fb, device, index, pfb);
|
||||||
|
}
|
40
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga102.c
Normal file
40
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga102.c
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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.
|
||||||
|
*/
|
||||||
|
#include "gf100.h"
|
||||||
|
#include "ram.h"
|
||||||
|
|
||||||
|
static const struct nvkm_fb_func
|
||||||
|
ga102_fb = {
|
||||||
|
.dtor = gf100_fb_dtor,
|
||||||
|
.oneinit = gf100_fb_oneinit,
|
||||||
|
.init = gp100_fb_init,
|
||||||
|
.init_page = gv100_fb_init_page,
|
||||||
|
.init_unkn = gp100_fb_init_unkn,
|
||||||
|
.ram_new = ga102_ram_new,
|
||||||
|
.default_bigpage = 16,
|
||||||
|
};
|
||||||
|
|
||||||
|
int
|
||||||
|
ga102_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb)
|
||||||
|
{
|
||||||
|
return gp102_fb_new_(&ga102_fb, device, index, pfb);
|
||||||
|
}
|
@ -22,7 +22,7 @@
|
|||||||
#include "gf100.h"
|
#include "gf100.h"
|
||||||
#include "ram.h"
|
#include "ram.h"
|
||||||
|
|
||||||
static int
|
int
|
||||||
gv100_fb_init_page(struct nvkm_fb *fb)
|
gv100_fb_init_page(struct nvkm_fb *fb)
|
||||||
{
|
{
|
||||||
return (fb->page == 16) ? 0 : -EINVAL;
|
return (fb->page == 16) ? 0 : -EINVAL;
|
||||||
|
@ -82,4 +82,6 @@ int gp102_fb_new_(const struct nvkm_fb_func *, struct nvkm_device *, int,
|
|||||||
struct nvkm_fb **);
|
struct nvkm_fb **);
|
||||||
bool gp102_fb_vpr_scrub_required(struct nvkm_fb *);
|
bool gp102_fb_vpr_scrub_required(struct nvkm_fb *);
|
||||||
int gp102_fb_vpr_scrub(struct nvkm_fb *);
|
int gp102_fb_vpr_scrub(struct nvkm_fb *);
|
||||||
|
|
||||||
|
int gv100_fb_init_page(struct nvkm_fb *);
|
||||||
#endif
|
#endif
|
||||||
|
@ -70,4 +70,5 @@ int gk104_ram_new(struct nvkm_fb *, struct nvkm_ram **);
|
|||||||
int gm107_ram_new(struct nvkm_fb *, struct nvkm_ram **);
|
int gm107_ram_new(struct nvkm_fb *, struct nvkm_ram **);
|
||||||
int gm200_ram_new(struct nvkm_fb *, struct nvkm_ram **);
|
int gm200_ram_new(struct nvkm_fb *, struct nvkm_ram **);
|
||||||
int gp100_ram_new(struct nvkm_fb *, struct nvkm_ram **);
|
int gp100_ram_new(struct nvkm_fb *, struct nvkm_ram **);
|
||||||
|
int ga102_ram_new(struct nvkm_fb *, struct nvkm_ram **);
|
||||||
#endif
|
#endif
|
||||||
|
40
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramga102.c
Normal file
40
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramga102.c
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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.
|
||||||
|
*/
|
||||||
|
#include "ram.h"
|
||||||
|
|
||||||
|
#include <subdev/bios.h>
|
||||||
|
#include <subdev/bios/init.h>
|
||||||
|
#include <subdev/bios/rammap.h>
|
||||||
|
|
||||||
|
static const struct nvkm_ram_func
|
||||||
|
ga102_ram = {
|
||||||
|
};
|
||||||
|
|
||||||
|
int
|
||||||
|
ga102_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram)
|
||||||
|
{
|
||||||
|
struct nvkm_device *device = fb->subdev.device;
|
||||||
|
enum nvkm_ram_type type = nvkm_fb_bios_memtype(device->bios);
|
||||||
|
u32 size = nvkm_rd32(device, 0x1183a4);
|
||||||
|
|
||||||
|
return nvkm_ram_new_(&ga102_ram, fb, type, (u64)size << 20, pram);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user