diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-01-14 15:36:34 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-01-22 12:18:07 +1000 |
commit | be83cd4ef9a2a56bd35550bf96146b7b837daf02 (patch) | |
tree | 7cd92cdbb6c9fa473f4b896e8bd22e9dc8cbc28e /drivers/gpu/drm/nouveau/nvkm/subdev/mxm | |
parent | 9719047b4d985ca7a46819956047cca04213d63e (diff) | |
download | op-kernel-dev-be83cd4ef9a2a56bd35550bf96146b7b837daf02.zip op-kernel-dev-be83cd4ef9a2a56bd35550bf96146b7b837daf02.tar.gz |
drm/nouveau: finalise nvkm namespace switch (no binary change)
The namespace of NVKM is being changed to nvkm_ instead of nouveau_,
which will be used for the DRM part of the driver. This is being
done in order to make it very clear as to what part of the driver a
given symbol belongs to, and as a minor step towards splitting the
DRM driver out to be able to stand on its own (for virt).
Because there's already a large amount of churn here anyway, this is
as good a time as any to also switch to NVIDIA's device and chipset
naming to ease collaboration with them.
A comparison of objdump disassemblies proves no code changes.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev/mxm')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c | 49 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.c | 20 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.h | 18 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/mxm/nv50.c | 40 |
4 files changed, 60 insertions, 67 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c index 51fcf79..0ca9dca 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c @@ -21,18 +21,16 @@ * * Authors: Ben Skeggs */ +#include "mxms.h" +#include <core/device.h> #include <core/option.h> - -#include <subdev/i2c.h> -#include <subdev/mxm.h> #include <subdev/bios.h> #include <subdev/bios/mxm.h> - -#include "mxms.h" +#include <subdev/i2c.h> static bool -mxm_shadow_rom_fetch(struct nouveau_i2c_port *i2c, u8 addr, +mxm_shadow_rom_fetch(struct nvkm_i2c_port *i2c, u8 addr, u8 offset, u8 size, u8 *data) { struct i2c_msg msgs[] = { @@ -44,11 +42,11 @@ mxm_shadow_rom_fetch(struct nouveau_i2c_port *i2c, u8 addr, } static bool -mxm_shadow_rom(struct nouveau_mxm *mxm, u8 version) +mxm_shadow_rom(struct nvkm_mxm *mxm, u8 version) { - struct nouveau_bios *bios = nouveau_bios(mxm); - struct nouveau_i2c *i2c = nouveau_i2c(mxm); - struct nouveau_i2c_port *port = NULL; + struct nvkm_bios *bios = nvkm_bios(mxm); + struct nvkm_i2c *i2c = nvkm_i2c(mxm); + struct nvkm_i2c_port *port = NULL; u8 i2cidx, mxms[6], addr, size; i2cidx = mxm_ddc_map(bios, 1 /* LVDS_DDC */) & 0x0f; @@ -79,9 +77,9 @@ mxm_shadow_rom(struct nouveau_mxm *mxm, u8 version) #if defined(CONFIG_ACPI) static bool -mxm_shadow_dsm(struct nouveau_mxm *mxm, u8 version) +mxm_shadow_dsm(struct nvkm_mxm *mxm, u8 version) { - struct nouveau_device *device = nv_device(mxm); + struct nvkm_device *device = nv_device(mxm); static char muid[] = { 0x00, 0xA4, 0x04, 0x40, 0x7D, 0x91, 0xF2, 0x4C, 0xB8, 0x9C, 0x79, 0xB6, 0x2F, 0xD5, 0x56, 0x65 @@ -129,7 +127,7 @@ mxm_shadow_dsm(struct nouveau_mxm *mxm, u8 version) #define WMI_WMMX_GUID "F6CB5C3C-9CAE-4EBD-B577-931EA32A2CC0" static u8 -wmi_wmmx_mxmi(struct nouveau_mxm *mxm, u8 version) +wmi_wmmx_mxmi(struct nvkm_mxm *mxm, u8 version) { u32 mxmi_args[] = { 0x494D584D /* MXMI */, version, 0 }; struct acpi_buffer args = { sizeof(mxmi_args), mxmi_args }; @@ -158,7 +156,7 @@ wmi_wmmx_mxmi(struct nouveau_mxm *mxm, u8 version) } static bool -mxm_shadow_wmi(struct nouveau_mxm *mxm, u8 version) +mxm_shadow_wmi(struct nvkm_mxm *mxm, u8 version) { u32 mxms_args[] = { 0x534D584D /* MXMS */, version, 0 }; struct acpi_buffer args = { sizeof(mxms_args), mxms_args }; @@ -186,7 +184,7 @@ mxm_shadow_wmi(struct nouveau_mxm *mxm, u8 version) obj = retn.pointer; if (obj->type == ACPI_TYPE_BUFFER) { mxm->mxms = kmemdup(obj->buffer.pointer, - obj->buffer.length, GFP_KERNEL); + obj->buffer.length, GFP_KERNEL); } kfree(obj); @@ -196,7 +194,7 @@ mxm_shadow_wmi(struct nouveau_mxm *mxm, u8 version) static struct mxm_shadow_h { const char *name; - bool (*exec)(struct nouveau_mxm *, u8 version); + bool (*exec)(struct nvkm_mxm *, u8 version); } _mxm_shadow[] = { { "ROM", mxm_shadow_rom }, #if defined(CONFIG_ACPI) @@ -209,7 +207,7 @@ static struct mxm_shadow_h { }; static int -mxm_shadow(struct nouveau_mxm *mxm, u8 version) +mxm_shadow(struct nvkm_mxm *mxm, u8 version) { struct mxm_shadow_h *shadow = _mxm_shadow; do { @@ -225,19 +223,18 @@ mxm_shadow(struct nouveau_mxm *mxm, u8 version) } int -nouveau_mxm_create_(struct nouveau_object *parent, - struct nouveau_object *engine, - struct nouveau_oclass *oclass, int length, void **pobject) +nvkm_mxm_create_(struct nvkm_object *parent, struct nvkm_object *engine, + struct nvkm_oclass *oclass, int length, void **pobject) { - struct nouveau_device *device = nv_device(parent); - struct nouveau_bios *bios = nouveau_bios(device); - struct nouveau_mxm *mxm; + struct nvkm_device *device = nv_device(parent); + struct nvkm_bios *bios = nvkm_bios(device); + struct nvkm_mxm *mxm; u8 ver, len; u16 data; int ret; - ret = nouveau_subdev_create_(parent, engine, oclass, 0, "MXM", "mxm", - length, pobject); + ret = nvkm_subdev_create_(parent, engine, oclass, 0, "MXM", "mxm", + length, pobject); mxm = *pobject; if (ret) return ret; @@ -268,7 +265,7 @@ nouveau_mxm_create_(struct nouveau_object *parent, mxms_version(mxm) >> 8, mxms_version(mxm) & 0xff); mxms_foreach(mxm, 0, NULL, NULL); - if (nouveau_boolopt(device->cfgopt, "NvMXMDCB", true)) + if (nvkm_boolopt(device->cfgopt, "NvMXMDCB", true)) mxm->action |= MXM_SANITISE_DCB; return 0; } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.c index 4bde7f7..a9b1d63 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.c @@ -21,22 +21,20 @@ * * Authors: Ben Skeggs */ - -#include <subdev/mxm.h> #include "mxms.h" #define ROM16(x) le16_to_cpu(*(u16 *)&(x)) #define ROM32(x) le32_to_cpu(*(u32 *)&(x)) static u8 * -mxms_data(struct nouveau_mxm *mxm) +mxms_data(struct nvkm_mxm *mxm) { return mxm->mxms; } u16 -mxms_version(struct nouveau_mxm *mxm) +mxms_version(struct nvkm_mxm *mxm) { u8 *mxms = mxms_data(mxm); u16 version = (mxms[4] << 8) | mxms[5]; @@ -54,19 +52,19 @@ mxms_version(struct nouveau_mxm *mxm) } u16 -mxms_headerlen(struct nouveau_mxm *mxm) +mxms_headerlen(struct nvkm_mxm *mxm) { return 8; } u16 -mxms_structlen(struct nouveau_mxm *mxm) +mxms_structlen(struct nvkm_mxm *mxm) { return *(u16 *)&mxms_data(mxm)[6]; } bool -mxms_checksum(struct nouveau_mxm *mxm) +mxms_checksum(struct nvkm_mxm *mxm) { u16 size = mxms_headerlen(mxm) + mxms_structlen(mxm); u8 *mxms = mxms_data(mxm), sum = 0; @@ -80,7 +78,7 @@ mxms_checksum(struct nouveau_mxm *mxm) } bool -mxms_valid(struct nouveau_mxm *mxm) +mxms_valid(struct nvkm_mxm *mxm) { u8 *mxms = mxms_data(mxm); if (*(u32 *)mxms != 0x5f4d584d) { @@ -95,8 +93,8 @@ mxms_valid(struct nouveau_mxm *mxm) } bool -mxms_foreach(struct nouveau_mxm *mxm, u8 types, - bool (*exec)(struct nouveau_mxm *, u8 *, void *), void *info) +mxms_foreach(struct nvkm_mxm *mxm, u8 types, + bool (*exec)(struct nvkm_mxm *, u8 *, void *), void *info) { u8 *mxms = mxms_data(mxm); u8 *desc = mxms + mxms_headerlen(mxm); @@ -180,7 +178,7 @@ mxms_foreach(struct nouveau_mxm *mxm, u8 types, } void -mxms_output_device(struct nouveau_mxm *mxm, u8 *pdata, struct mxms_odev *desc) +mxms_output_device(struct nvkm_mxm *mxm, u8 *pdata, struct mxms_odev *desc) { u64 data = ROM32(pdata[0]); if (mxms_version(mxm) >= 0x0300) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.h b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.h index 5e0be0c..4ef8040 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.h +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.h @@ -1,5 +1,6 @@ #ifndef __NVMXM_MXMS_H__ #define __NVMXM_MXMS_H__ +#include <subdev/mxm.h> struct mxms_odev { u8 outp_type; @@ -8,15 +9,14 @@ struct mxms_odev { u8 dig_conn; }; -void mxms_output_device(struct nouveau_mxm *, u8 *, struct mxms_odev *); +void mxms_output_device(struct nvkm_mxm *, u8 *, struct mxms_odev *); -u16 mxms_version(struct nouveau_mxm *); -u16 mxms_headerlen(struct nouveau_mxm *); -u16 mxms_structlen(struct nouveau_mxm *); -bool mxms_checksum(struct nouveau_mxm *); -bool mxms_valid(struct nouveau_mxm *); - -bool mxms_foreach(struct nouveau_mxm *, u8, - bool (*)(struct nouveau_mxm *, u8 *, void *), void *); +u16 mxms_version(struct nvkm_mxm *); +u16 mxms_headerlen(struct nvkm_mxm *); +u16 mxms_structlen(struct nvkm_mxm *); +bool mxms_checksum(struct nvkm_mxm *); +bool mxms_valid(struct nvkm_mxm *); +bool mxms_foreach(struct nvkm_mxm *, u8, + bool (*)(struct nvkm_mxm *, u8 *, void *), void *); #endif diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/nv50.c index fcaabe8..42cac13 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/nv50.c @@ -21,17 +21,15 @@ * * Authors: Ben Skeggs */ +#include "mxms.h" -#include <subdev/mxm.h> #include <subdev/bios.h> #include <subdev/bios/conn.h> #include <subdev/bios/dcb.h> #include <subdev/bios/mxm.h> -#include "mxms.h" - struct nv50_mxm_priv { - struct nouveau_mxm base; + struct nvkm_mxm base; }; struct context { @@ -40,7 +38,7 @@ struct context { }; static bool -mxm_match_tmds_partner(struct nouveau_mxm *mxm, u8 *data, void *info) +mxm_match_tmds_partner(struct nvkm_mxm *mxm, u8 *data, void *info) { struct context *ctx = info; struct mxms_odev desc; @@ -53,9 +51,9 @@ mxm_match_tmds_partner(struct nouveau_mxm *mxm, u8 *data, void *info) } static bool -mxm_match_dcb(struct nouveau_mxm *mxm, u8 *data, void *info) +mxm_match_dcb(struct nvkm_mxm *mxm, u8 *data, void *info) { - struct nouveau_bios *bios = nouveau_bios(mxm); + struct nvkm_bios *bios = nvkm_bios(mxm); struct context *ctx = info; u64 desc = *(u64 *)data; @@ -98,9 +96,9 @@ mxm_match_dcb(struct nouveau_mxm *mxm, u8 *data, void *info) } static int -mxm_dcb_sanitise_entry(struct nouveau_bios *bios, void *data, int idx, u16 pdcb) +mxm_dcb_sanitise_entry(struct nvkm_bios *bios, void *data, int idx, u16 pdcb) { - struct nouveau_mxm *mxm = data; + struct nvkm_mxm *mxm = data; struct context ctx = { .outp = (u32 *)(bios->data + pdcb) }; u8 type, i2cidx, link, ver, len; u8 *conn; @@ -180,7 +178,7 @@ mxm_dcb_sanitise_entry(struct nouveau_bios *bios, void *data, int idx, u16 pdcb) } static bool -mxm_show_unmatched(struct nouveau_mxm *mxm, u8 *data, void *info) +mxm_show_unmatched(struct nvkm_mxm *mxm, u8 *data, void *info) { u64 desc = *(u64 *)data; if ((desc & 0xf0) != 0xf0) @@ -189,9 +187,9 @@ mxm_show_unmatched(struct nouveau_mxm *mxm, u8 *data, void *info) } static void -mxm_dcb_sanitise(struct nouveau_mxm *mxm) +mxm_dcb_sanitise(struct nvkm_mxm *mxm) { - struct nouveau_bios *bios = nouveau_bios(mxm); + struct nvkm_bios *bios = nvkm_bios(mxm); u8 ver, hdr, cnt, len; u16 dcb = dcb_table(bios, &ver, &hdr, &cnt, &len); if (dcb == 0x0000 || ver != 0x40) { @@ -204,14 +202,14 @@ mxm_dcb_sanitise(struct nouveau_mxm *mxm) } static int -nv50_mxm_ctor(struct nouveau_object *parent, struct nouveau_object *engine, - struct nouveau_oclass *oclass, void *data, u32 size, - struct nouveau_object **pobject) +nv50_mxm_ctor(struct nvkm_object *parent, struct nvkm_object *engine, + struct nvkm_oclass *oclass, void *data, u32 size, + struct nvkm_object **pobject) { struct nv50_mxm_priv *priv; int ret; - ret = nouveau_mxm_create(parent, engine, oclass, &priv); + ret = nvkm_mxm_create(parent, engine, oclass, &priv); *pobject = nv_object(priv); if (ret) return ret; @@ -221,13 +219,13 @@ nv50_mxm_ctor(struct nouveau_object *parent, struct nouveau_object *engine, return 0; } -struct nouveau_oclass +struct nvkm_oclass nv50_mxm_oclass = { .handle = NV_SUBDEV(MXM, 0x50), - .ofuncs = &(struct nouveau_ofuncs) { + .ofuncs = &(struct nvkm_ofuncs) { .ctor = nv50_mxm_ctor, - .dtor = _nouveau_mxm_dtor, - .init = _nouveau_mxm_init, - .fini = _nouveau_mxm_fini, + .dtor = _nvkm_mxm_dtor, + .init = _nvkm_mxm_init, + .fini = _nvkm_mxm_fini, }, }; |