From ca9df00d04e302f5620632621ad3baf46fe24c8e Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 21 Mar 2013 15:45:11 +1000 Subject: [PATCH] drm/nv04/disp: hide all the cruft away in its own little hole It'd be pretty awesome if someone would care enough to port this all properly to a class interface, perhaps submitting a command stream to the core via a sw object on PFIFO (emulating how EVO works basically, and also what nvidia have done forever..).. But, this seems unlikely given how old this hardware is now, so, lets just hide it away. There's a heap of other bits and pieces laying around that are still tangled. I'll (re)move them in pieces. Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/Makefile | 4 +--- drivers/gpu/drm/nouveau/dispnv04/Makefile | 10 ++++++++++ .../gpu/drm/nouveau/{nouveau_calc.c => dispnv04/arb.c} | 2 +- .../gpu/drm/nouveau/{nv04_crtc.c => dispnv04/crtc.c} | 5 ++--- .../drm/nouveau/{nv04_cursor.c => dispnv04/cursor.c} | 3 +-- drivers/gpu/drm/nouveau/{nv04_dac.c => dispnv04/dac.c} | 2 +- drivers/gpu/drm/nouveau/{nv04_dfp.c => dispnv04/dfp.c} | 2 +- .../drm/nouveau/{nv04_display.c => dispnv04/disp.c} | 2 +- .../drm/nouveau/{nv04_display.h => dispnv04/disp.h} | 0 .../gpu/drm/nouveau/{nouveau_hw.c => dispnv04/hw.c} | 2 +- .../gpu/drm/nouveau/{nouveau_hw.h => dispnv04/hw.h} | 3 ++- drivers/gpu/drm/nouveau/{ => dispnv04}/nvreg.h | 0 .../{nv17_tv_modes.c => dispnv04/tvmodesnv17.c} | 4 ++-- .../gpu/drm/nouveau/{nv04_tv.c => dispnv04/tvnv04.c} | 2 +- .../gpu/drm/nouveau/{nv17_tv.c => dispnv04/tvnv17.c} | 4 ++-- .../gpu/drm/nouveau/{nv17_tv.h => dispnv04/tvnv17.h} | 0 drivers/gpu/drm/nouveau/nouveau_bios.c | 2 +- drivers/gpu/drm/nouveau/nouveau_bios.h | 2 -- drivers/gpu/drm/nouveau/nouveau_connector.c | 2 +- drivers/gpu/drm/nouveau/nouveau_display.c | 2 +- drivers/gpu/drm/nouveau/nouveau_encoder.h | 2 +- drivers/gpu/drm/nouveau/nv04_pm.c | 2 +- drivers/gpu/drm/nouveau/nv40_pm.c | 2 +- drivers/gpu/drm/nouveau/nv50_pm.c | 2 +- 24 files changed, 33 insertions(+), 28 deletions(-) create mode 100644 drivers/gpu/drm/nouveau/dispnv04/Makefile rename drivers/gpu/drm/nouveau/{nouveau_calc.c => dispnv04/arb.c} (99%) rename drivers/gpu/drm/nouveau/{nv04_crtc.c => dispnv04/crtc.c} (99%) rename drivers/gpu/drm/nouveau/{nv04_cursor.c => dispnv04/cursor.c} (98%) rename drivers/gpu/drm/nouveau/{nv04_dac.c => dispnv04/dac.c} (99%) rename drivers/gpu/drm/nouveau/{nv04_dfp.c => dispnv04/dfp.c} (99%) rename drivers/gpu/drm/nouveau/{nv04_display.c => dispnv04/disp.c} (99%) rename drivers/gpu/drm/nouveau/{nv04_display.h => dispnv04/disp.h} (100%) rename drivers/gpu/drm/nouveau/{nouveau_hw.c => dispnv04/hw.c} (99%) rename drivers/gpu/drm/nouveau/{nouveau_hw.h => dispnv04/hw.h} (99%) rename drivers/gpu/drm/nouveau/{ => dispnv04}/nvreg.h (100%) rename drivers/gpu/drm/nouveau/{nv17_tv_modes.c => dispnv04/tvmodesnv17.c} (99%) rename drivers/gpu/drm/nouveau/{nv04_tv.c => dispnv04/tvnv04.c} (99%) rename drivers/gpu/drm/nouveau/{nv17_tv.c => dispnv04/tvnv17.c} (99%) rename drivers/gpu/drm/nouveau/{nv17_tv.h => dispnv04/tvnv17.h} (100%) diff --git a/drivers/gpu/drm/nouveau/Makefile b/drivers/gpu/drm/nouveau/Makefile index 0c65479c1b6f8..1a8f6e9f55583 100644 --- a/drivers/gpu/drm/nouveau/Makefile +++ b/drivers/gpu/drm/nouveau/Makefile @@ -225,9 +225,7 @@ nouveau-y += nouveau_connector.o nouveau_dp.o nouveau-y += nv04_fbcon.o nv50_fbcon.o nvc0_fbcon.o # drm/kms/nv04:nv50 -nouveau-y += nouveau_hw.o nouveau_calc.o -nouveau-y += nv04_dac.o nv04_dfp.o nv04_tv.o nv17_tv.o nv17_tv_modes.o -nouveau-y += nv04_crtc.o nv04_display.o nv04_cursor.o +include $(src)/dispnv04/Makefile # drm/kms/nv50- nouveau-y += nv50_display.o diff --git a/drivers/gpu/drm/nouveau/dispnv04/Makefile b/drivers/gpu/drm/nouveau/dispnv04/Makefile new file mode 100644 index 0000000000000..ea3f5b8a0f95d --- /dev/null +++ b/drivers/gpu/drm/nouveau/dispnv04/Makefile @@ -0,0 +1,10 @@ +nouveau-y += dispnv04/arb.o +nouveau-y += dispnv04/crtc.o +nouveau-y += dispnv04/cursor.o +nouveau-y += dispnv04/dac.o +nouveau-y += dispnv04/dfp.o +nouveau-y += dispnv04/disp.o +nouveau-y += dispnv04/hw.o +nouveau-y += dispnv04/tvmodesnv17.o +nouveau-y += dispnv04/tvnv04.o +nouveau-y += dispnv04/tvnv17.o diff --git a/drivers/gpu/drm/nouveau/nouveau_calc.c b/drivers/gpu/drm/nouveau/dispnv04/arb.c similarity index 99% rename from drivers/gpu/drm/nouveau/nouveau_calc.c rename to drivers/gpu/drm/nouveau/dispnv04/arb.c index 6da576445b3d5..2e70462883e89 100644 --- a/drivers/gpu/drm/nouveau/nouveau_calc.c +++ b/drivers/gpu/drm/nouveau/dispnv04/arb.c @@ -25,7 +25,7 @@ #include "nouveau_drm.h" #include "nouveau_reg.h" -#include "nouveau_hw.h" +#include "hw.h" /****************************************************************************\ * * diff --git a/drivers/gpu/drm/nouveau/nv04_crtc.c b/drivers/gpu/drm/nouveau/dispnv04/crtc.c similarity index 99% rename from drivers/gpu/drm/nouveau/nv04_crtc.c rename to drivers/gpu/drm/nouveau/dispnv04/crtc.c index 6578cd28c5564..0782bd2f1e04c 100644 --- a/drivers/gpu/drm/nouveau/nv04_crtc.c +++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c @@ -33,10 +33,10 @@ #include "nouveau_encoder.h" #include "nouveau_connector.h" #include "nouveau_crtc.h" -#include "nouveau_hw.h" +#include "hw.h" #include "nvreg.h" #include "nouveau_fbcon.h" -#include "nv04_display.h" +#include "disp.h" #include #include @@ -1070,4 +1070,3 @@ nv04_crtc_create(struct drm_device *dev, int crtc_num) return 0; } - diff --git a/drivers/gpu/drm/nouveau/nv04_cursor.c b/drivers/gpu/drm/nouveau/dispnv04/cursor.c similarity index 98% rename from drivers/gpu/drm/nouveau/nv04_cursor.c rename to drivers/gpu/drm/nouveau/dispnv04/cursor.c index fe86f0de348f1..a810303169de9 100644 --- a/drivers/gpu/drm/nouveau/nv04_cursor.c +++ b/drivers/gpu/drm/nouveau/dispnv04/cursor.c @@ -3,7 +3,7 @@ #include "nouveau_drm.h" #include "nouveau_reg.h" #include "nouveau_crtc.h" -#include "nouveau_hw.h" +#include "hw.h" static void nv04_cursor_show(struct nouveau_crtc *nv_crtc, bool update) @@ -68,4 +68,3 @@ nv04_cursor_init(struct nouveau_crtc *crtc) crtc->cursor.show = nv04_cursor_show; return 0; } - diff --git a/drivers/gpu/drm/nouveau/nv04_dac.c b/drivers/gpu/drm/nouveau/dispnv04/dac.c similarity index 99% rename from drivers/gpu/drm/nouveau/nv04_dac.c rename to drivers/gpu/drm/nouveau/dispnv04/dac.c index 64f7020fb605d..434b920f6bd4d 100644 --- a/drivers/gpu/drm/nouveau/nv04_dac.c +++ b/drivers/gpu/drm/nouveau/dispnv04/dac.c @@ -31,7 +31,7 @@ #include "nouveau_encoder.h" #include "nouveau_connector.h" #include "nouveau_crtc.h" -#include "nouveau_hw.h" +#include "hw.h" #include "nvreg.h" #include diff --git a/drivers/gpu/drm/nouveau/nv04_dfp.c b/drivers/gpu/drm/nouveau/dispnv04/dfp.c similarity index 99% rename from drivers/gpu/drm/nouveau/nv04_dfp.c rename to drivers/gpu/drm/nouveau/dispnv04/dfp.c index 7e24cdf1cb394..93dd23ff00931 100644 --- a/drivers/gpu/drm/nouveau/nv04_dfp.c +++ b/drivers/gpu/drm/nouveau/dispnv04/dfp.c @@ -32,7 +32,7 @@ #include "nouveau_encoder.h" #include "nouveau_connector.h" #include "nouveau_crtc.h" -#include "nouveau_hw.h" +#include "hw.h" #include "nvreg.h" #include diff --git a/drivers/gpu/drm/nouveau/nv04_display.c b/drivers/gpu/drm/nouveau/dispnv04/disp.c similarity index 99% rename from drivers/gpu/drm/nouveau/nv04_display.c rename to drivers/gpu/drm/nouveau/dispnv04/disp.c index ad48444c385c1..4908d3fd04861 100644 --- a/drivers/gpu/drm/nouveau/nv04_display.c +++ b/drivers/gpu/drm/nouveau/dispnv04/disp.c @@ -30,7 +30,7 @@ #include "nouveau_drm.h" #include "nouveau_reg.h" -#include "nouveau_hw.h" +#include "hw.h" #include "nouveau_encoder.h" #include "nouveau_connector.h" diff --git a/drivers/gpu/drm/nouveau/nv04_display.h b/drivers/gpu/drm/nouveau/dispnv04/disp.h similarity index 100% rename from drivers/gpu/drm/nouveau/nv04_display.h rename to drivers/gpu/drm/nouveau/dispnv04/disp.h diff --git a/drivers/gpu/drm/nouveau/nouveau_hw.c b/drivers/gpu/drm/nouveau/dispnv04/hw.c similarity index 99% rename from drivers/gpu/drm/nouveau/nouveau_hw.c rename to drivers/gpu/drm/nouveau/dispnv04/hw.c index 617a06ffdb462..973056b86207d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_hw.c +++ b/drivers/gpu/drm/nouveau/dispnv04/hw.c @@ -24,7 +24,7 @@ #include #include "nouveau_drm.h" -#include "nouveau_hw.h" +#include "hw.h" #include #include diff --git a/drivers/gpu/drm/nouveau/nouveau_hw.h b/drivers/gpu/drm/nouveau/dispnv04/hw.h similarity index 99% rename from drivers/gpu/drm/nouveau/nouveau_hw.h rename to drivers/gpu/drm/nouveau/dispnv04/hw.h index 7dff1021fab44..eeb70d912d994 100644 --- a/drivers/gpu/drm/nouveau/nouveau_hw.h +++ b/drivers/gpu/drm/nouveau/dispnv04/hw.h @@ -24,7 +24,8 @@ #define __NOUVEAU_HW_H__ #include -#include "nv04_display.h" +#include "disp.h" +#include "nvreg.h" #include diff --git a/drivers/gpu/drm/nouveau/nvreg.h b/drivers/gpu/drm/nouveau/dispnv04/nvreg.h similarity index 100% rename from drivers/gpu/drm/nouveau/nvreg.h rename to drivers/gpu/drm/nouveau/dispnv04/nvreg.h diff --git a/drivers/gpu/drm/nouveau/nv17_tv_modes.c b/drivers/gpu/drm/nouveau/dispnv04/tvmodesnv17.c similarity index 99% rename from drivers/gpu/drm/nouveau/nv17_tv_modes.c rename to drivers/gpu/drm/nouveau/dispnv04/tvmodesnv17.c index 1cdfe2a5875d8..08c6f5e506109 100644 --- a/drivers/gpu/drm/nouveau/nv17_tv_modes.c +++ b/drivers/gpu/drm/nouveau/dispnv04/tvmodesnv17.c @@ -29,8 +29,8 @@ #include "nouveau_drm.h" #include "nouveau_encoder.h" #include "nouveau_crtc.h" -#include "nouveau_hw.h" -#include "nv17_tv.h" +#include "hw.h" +#include "tvnv17.h" char *nv17_tv_norm_names[NUM_TV_NORMS] = { [TV_NORM_PAL] = "PAL", diff --git a/drivers/gpu/drm/nouveau/nv04_tv.c b/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c similarity index 99% rename from drivers/gpu/drm/nouveau/nv04_tv.c rename to drivers/gpu/drm/nouveau/dispnv04/tvnv04.c index 4a69ccdef9b4b..bf13db4e86317 100644 --- a/drivers/gpu/drm/nouveau/nv04_tv.c +++ b/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c @@ -30,7 +30,7 @@ #include "nouveau_encoder.h" #include "nouveau_connector.h" #include "nouveau_crtc.h" -#include "nouveau_hw.h" +#include "hw.h" #include #include diff --git a/drivers/gpu/drm/nouveau/nv17_tv.c b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c similarity index 99% rename from drivers/gpu/drm/nouveau/nv17_tv.c rename to drivers/gpu/drm/nouveau/dispnv04/tvnv17.c index 977e42be20500..acef48f4a4ea2 100644 --- a/drivers/gpu/drm/nouveau/nv17_tv.c +++ b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c @@ -31,8 +31,8 @@ #include "nouveau_encoder.h" #include "nouveau_connector.h" #include "nouveau_crtc.h" -#include "nouveau_hw.h" -#include "nv17_tv.h" +#include "hw.h" +#include "tvnv17.h" #include diff --git a/drivers/gpu/drm/nouveau/nv17_tv.h b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.h similarity index 100% rename from drivers/gpu/drm/nouveau/nv17_tv.h rename to drivers/gpu/drm/nouveau/dispnv04/tvnv17.h diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index 50a6dd02f7c5c..6aa2137e093ab 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c @@ -28,7 +28,7 @@ #include "nouveau_drm.h" #include "nouveau_reg.h" -#include "nouveau_hw.h" +#include "dispnv04/hw.h" #include "nouveau_encoder.h" #include diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.h b/drivers/gpu/drm/nouveau/nouveau_bios.h index 7ccd28f11adf0..0067586eb015b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.h +++ b/drivers/gpu/drm/nouveau/nouveau_bios.h @@ -24,8 +24,6 @@ #ifndef __NOUVEAU_DISPBIOS_H__ #define __NOUVEAU_DISPBIOS_H__ -#include "nvreg.h" - #define DCB_MAX_NUM_ENTRIES 16 #define DCB_MAX_NUM_I2C_ENTRIES 16 #define DCB_MAX_NUM_GPIO_ENTRIES 32 diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 4dd7ae2ac6c69..4da776f344d70 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -32,7 +32,7 @@ #include "nouveau_reg.h" #include "nouveau_drm.h" -#include "nouveau_hw.h" +#include "dispnv04/hw.h" #include "nouveau_acpi.h" #include "nouveau_display.h" diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 4610c3a29bbef..7bf22d4a3d967 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -28,7 +28,7 @@ #include #include "nouveau_fbcon.h" -#include "nouveau_hw.h" +#include "dispnv04/hw.h" #include "nouveau_crtc.h" #include "nouveau_dma.h" #include "nouveau_gem.h" diff --git a/drivers/gpu/drm/nouveau/nouveau_encoder.h b/drivers/gpu/drm/nouveau/nouveau_encoder.h index e24341229d5e0..24660c0f713d6 100644 --- a/drivers/gpu/drm/nouveau/nouveau_encoder.h +++ b/drivers/gpu/drm/nouveau/nouveau_encoder.h @@ -30,7 +30,7 @@ #include #include -#include "nv04_display.h" +#include "dispnv04/disp.h" #define NV_DPMS_CLEARED 0x80 diff --git a/drivers/gpu/drm/nouveau/nv04_pm.c b/drivers/gpu/drm/nouveau/nv04_pm.c index 2a0cc9d0614ad..27afc0ea28b04 100644 --- a/drivers/gpu/drm/nouveau/nv04_pm.c +++ b/drivers/gpu/drm/nouveau/nv04_pm.c @@ -25,7 +25,7 @@ #include #include "nouveau_drm.h" #include "nouveau_reg.h" -#include "nouveau_hw.h" +#include "dispnv04/hw.h" #include "nouveau_pm.h" #include diff --git a/drivers/gpu/drm/nouveau/nv40_pm.c b/drivers/gpu/drm/nouveau/nv40_pm.c index 3382064c7f33c..3af5bcd0b203f 100644 --- a/drivers/gpu/drm/nouveau/nv40_pm.c +++ b/drivers/gpu/drm/nouveau/nv40_pm.c @@ -26,7 +26,7 @@ #include "nouveau_drm.h" #include "nouveau_bios.h" #include "nouveau_pm.h" -#include "nouveau_hw.h" +#include "dispnv04/hw.h" #include #include diff --git a/drivers/gpu/drm/nouveau/nv50_pm.c b/drivers/gpu/drm/nouveau/nv50_pm.c index 8bd5d2781baf0..69620e39c90c8 100644 --- a/drivers/gpu/drm/nouveau/nv50_pm.c +++ b/drivers/gpu/drm/nouveau/nv50_pm.c @@ -25,7 +25,7 @@ #include #include "nouveau_drm.h" #include "nouveau_bios.h" -#include "nouveau_hw.h" +#include "dispnv04/hw.h" #include "nouveau_pm.h" #include "nouveau_hwsq.h" -- 2.39.5