From 80b88a349e37b8493506c7e28cf169c9314cdbf4 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 14 Jan 2012 21:03:13 +0800 Subject: [PATCH] Modules/Tegra2Vid - Renamed properly --- BuildConf/armv7/tegra2.mk | 2 +- Modules/Display/{Tegra2 => Tegra2Vid}/Makefile | 2 +- Modules/Display/{Tegra2 => Tegra2Vid}/main.c | 16 ++++++++++++---- Modules/Display/{Tegra2 => Tegra2Vid}/tegra2.h | 2 ++ 4 files changed, 16 insertions(+), 6 deletions(-) rename Modules/Display/{Tegra2 => Tegra2Vid}/Makefile (72%) rename Modules/Display/{Tegra2 => Tegra2Vid}/main.c (89%) rename Modules/Display/{Tegra2 => Tegra2Vid}/tegra2.h (97%) diff --git a/BuildConf/armv7/tegra2.mk b/BuildConf/armv7/tegra2.mk index ece6ccf5..4abc5c88 100644 --- a/BuildConf/armv7/tegra2.mk +++ b/BuildConf/armv7/tegra2.mk @@ -1,4 +1,4 @@ include $(ACESSDIR)/BuildConf/armv7/default.mk -MODULES += Display/Tegra2 +MODULES += Display/Tegra2Vid diff --git a/Modules/Display/Tegra2/Makefile b/Modules/Display/Tegra2Vid/Makefile similarity index 72% rename from Modules/Display/Tegra2/Makefile rename to Modules/Display/Tegra2Vid/Makefile index 3155db3c..ecab050e 100644 --- a/Modules/Display/Tegra2/Makefile +++ b/Modules/Display/Tegra2Vid/Makefile @@ -2,6 +2,6 @@ # OBJ = main.o -NAME = Tegra2 +NAME = Tegra2Vid -include ../Makefile.tpl diff --git a/Modules/Display/Tegra2/main.c b/Modules/Display/Tegra2Vid/main.c similarity index 89% rename from Modules/Display/Tegra2/main.c rename to Modules/Display/Tegra2Vid/main.c index dfafb2a2..deae8f6b 100644 --- a/Modules/Display/Tegra2/main.c +++ b/Modules/Display/Tegra2Vid/main.c @@ -30,9 +30,9 @@ Uint64 Tegra2Vid_Write(tVFS_Node *node, Uint64 off, Uint64 len, void *buffer); int Tegra2Vid_int_SetMode(int Mode); // === GLOBALS === -MODULE_DEFINE(0, VERSION, Video_Tegra2, Tegra2Vid_Install, NULL, NULL); +MODULE_DEFINE(0, VERSION, Tegra2Vid, Tegra2Vid_Install, NULL, NULL); tDevFS_Driver gTegra2Vid_DriverStruct = { - NULL, "PL110", + NULL, "Tegra2Vid", { .Read = Tegra2Vid_Read, .Write = Tegra2Vid_Write, @@ -54,7 +54,7 @@ const tKeyVal_ParseRules gTegra2Vid_KeyValueParser = { int giTegra2Vid_CurrentMode = 0; int giTegra2Vid_BufferMode; size_t giTegra2Vid_FramebufferSize; -Uint8 *gpTegra2Vid_IOMem; +Uint32 *gpTegra2Vid_IOMem; tPAddr gTegra2Vid_FramebufferPhys; void *gpTegra2Vid_Framebuffer; // -- Misc @@ -252,9 +252,12 @@ int Tegra2Vid_int_SetMode(int Mode) *(Uint32*)(gpTegra2Vid_IOMem + DC_WIN_A_POSITION_0) = 0; *(Uint32*)(gpTegra2Vid_IOMem + DC_WIN_A_SIZE_0) = (mode->H << 16) | mode->W; - *(Uint8*)(gpTegra2Vid_IOMem + DC_WIN_A_COLOR_DEPTH_0) = 12; // Could be 13 (BGR/RGB) + *(Uint32*)(gpTegra2Vid_IOMem + DC_DISP_DISP_COLOR_CONTROL_0) = 0x8; // BASE888 + *(Uint32*)(gpTegra2Vid_IOMem + DC_WIN_A_COLOR_DEPTH_0) = 12; // Could be 13 (BGR/RGB) *(Uint32*)(gpTegra2Vid_IOMem + DC_WIN_A_PRESCALED_SIZE_0) = (mode->H << 16) | mode->W; + Log_Debug("Tegra2Vid", "Mode %i (%ix%i) selected", Mode, w, h); + if( !gpTegra2Vid_Framebuffer || w*h*4 != giTegra2Vid_FramebufferSize ) { if( gpTegra2Vid_Framebuffer ) @@ -270,6 +273,11 @@ int Tegra2Vid_int_SetMode(int Mode) &gTegra2Vid_FramebufferPhys ); // TODO: Catch allocation failures + Log_Debug("Tegra2Vid", "0x%x byte framebuffer at %p (%P phys)", + giTegra2Vid_FramebufferSize, + gpTegra2Vid_Framebuffer, + gTegra2Vid_FramebufferPhys + ); // Tell hardware *(Uint32*)(gpTegra2Vid_IOMem + DC_WINBUF_A_START_ADDR_0) = gTegra2Vid_FramebufferPhys; diff --git a/Modules/Display/Tegra2/tegra2.h b/Modules/Display/Tegra2Vid/tegra2.h similarity index 97% rename from Modules/Display/Tegra2/tegra2.h rename to Modules/Display/Tegra2Vid/tegra2.h index b05ca8c1..b5666f33 100644 --- a/Modules/Display/Tegra2/tegra2.h +++ b/Modules/Display/Tegra2Vid/tegra2.h @@ -42,6 +42,8 @@ enum eTegra2_Disp_Regs DC_DISP_FRONT_PORCH_0, DC_DISP_H_PULSE0_CONTROL_0, + + DC_DISP_DISP_COLOR_CONTROL_0 = 0x430, DC_WINC_A_COLOR_PALETTE_0 = 0x500, DC_WINC_A_PALETTE_COLOR_EXT_0 = 0x600, -- 2.20.1