Use kernel facilities to change debug level at runtime

svn path=/trunk/; revision=31477
This commit is contained in:
Hervé Poussineau 2007-12-28 14:47:03 +00:00
parent 7ac6443e27
commit 5b799176ba
13 changed files with 195 additions and 217 deletions

View file

@ -18,7 +18,6 @@
* If not, write to the Free Software Foundation, * If not, write to the Free Software Foundation,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id$
*/ */
#include "videoprt.h" #include "videoprt.h"
@ -104,7 +103,7 @@ IntAgpCommitPhysical(
PVIDEO_PORT_AGP_MAPPING AgpMapping; PVIDEO_PORT_AGP_MAPPING AgpMapping;
NTSTATUS Status; NTSTATUS Status;
DPRINT("AgpCommitPhysical - PhysicalContext: 0x%x Pages: %d, Offset: 0x%x\n", TRACE_(VIDEOPRT, "AgpCommitPhysical - PhysicalContext: 0x%x Pages: %d, Offset: 0x%x\n",
PhysicalContext, Pages, Offset); PhysicalContext, Pages, Offset);
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
@ -117,7 +116,7 @@ IntAgpCommitPhysical(
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("Warning: AgpBusInterface->CommitMemory failed (Status = 0x%x)\n", WARN_(VIDEOPRT, "Warning: AgpBusInterface->CommitMemory failed (Status = 0x%x)\n",
Status); Status);
} }
return NT_SUCCESS(Status); return NT_SUCCESS(Status);
@ -135,7 +134,7 @@ IntAgpFreePhysical(
PVIDEO_PORT_AGP_MAPPING AgpMapping; PVIDEO_PORT_AGP_MAPPING AgpMapping;
NTSTATUS Status; NTSTATUS Status;
DPRINT("AgpFreePhysical - PhysicalContext: 0x%x Pages: %d, Offset: 0x%x\n", TRACE_(VIDEOPRT, "AgpFreePhysical - PhysicalContext: 0x%x Pages: %d, Offset: 0x%x\n",
PhysicalContext, Pages, Offset); PhysicalContext, Pages, Offset);
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
@ -146,7 +145,7 @@ IntAgpFreePhysical(
AgpMapping->MapHandle, Pages, Offset); AgpMapping->MapHandle, Pages, Offset);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("Warning: AgpBusInterface->FreeMemory failed (Status = 0x%x)\n", WARN_(VIDEOPRT, "Warning: AgpBusInterface->FreeMemory failed (Status = 0x%x)\n",
Status); Status);
} }
} }
@ -161,7 +160,7 @@ IntAgpReleasePhysical(
PVIDEO_PORT_AGP_MAPPING AgpMapping; PVIDEO_PORT_AGP_MAPPING AgpMapping;
NTSTATUS Status; NTSTATUS Status;
DPRINT("AgpReleasePhysical - PhysicalContext: 0x%x\n", PhysicalContext); TRACE_(VIDEOPRT, "AgpReleasePhysical - PhysicalContext: 0x%x\n", PhysicalContext);
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
AgpBusInterface = &DeviceExtension->AgpInterface; AgpBusInterface = &DeviceExtension->AgpInterface;
@ -172,7 +171,7 @@ IntAgpReleasePhysical(
AgpMapping->MapHandle); AgpMapping->MapHandle);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("Warning: AgpBusInterface->ReleaseMemory failed (Status = 0x%x)\n", WARN_(VIDEOPRT, "Warning: AgpBusInterface->ReleaseMemory failed (Status = 0x%x)\n",
Status); Status);
} }
@ -194,7 +193,7 @@ IntAgpReservePhysical(
PVIDEO_PORT_AGP_MAPPING AgpMapping; PVIDEO_PORT_AGP_MAPPING AgpMapping;
NTSTATUS Status; NTSTATUS Status;
DPRINT("AgpReservePhysical - Pages: %d, Caching: 0x%x\n", Pages, Caching); TRACE_(VIDEOPRT, "AgpReservePhysical - Pages: %d, Caching: 0x%x\n", Pages, Caching);
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
AgpBusInterface = &DeviceExtension->AgpInterface; AgpBusInterface = &DeviceExtension->AgpInterface;
@ -208,7 +207,7 @@ IntAgpReservePhysical(
MemCachingType = MmWriteCombined; MemCachingType = MmWriteCombined;
else else
{ {
DPRINT1("Invalid caching type %d!\n", Caching); WARN_(VIDEOPRT, "Invalid caching type %d!\n", Caching);
return ZeroAddress; return ZeroAddress;
} }
@ -218,7 +217,7 @@ IntAgpReservePhysical(
TAG_VIDEO_PORT); TAG_VIDEO_PORT);
if (AgpMapping == NULL) if (AgpMapping == NULL)
{ {
DPRINT1("Out of memory! Couldn't allocate AGP mapping structure!\n"); WARN_(VIDEOPRT, "Out of memory! Couldn't allocate AGP mapping structure!\n");
return ZeroAddress; return ZeroAddress;
} }
RtlZeroMemory(AgpMapping, sizeof(VIDEO_PORT_AGP_MAPPING)); RtlZeroMemory(AgpMapping, sizeof(VIDEO_PORT_AGP_MAPPING));
@ -232,7 +231,7 @@ IntAgpReservePhysical(
if (!NT_SUCCESS(Status) || AgpMapping->MapHandle == NULL) if (!NT_SUCCESS(Status) || AgpMapping->MapHandle == NULL)
{ {
ExFreePool(AgpMapping); ExFreePool(AgpMapping);
DPRINT1("Warning: AgpBusInterface->ReserveMemory failed (Status = 0x%x)\n", WARN_(VIDEOPRT, "Warning: AgpBusInterface->ReserveMemory failed (Status = 0x%x)\n",
Status); Status);
return ZeroAddress; return ZeroAddress;
} }
@ -256,7 +255,7 @@ IntAgpCommitVirtual(
PVOID BaseAddress = NULL; PVOID BaseAddress = NULL;
NTSTATUS Status; NTSTATUS Status;
DPRINT("AgpCommitVirtual - VirtualContext: 0x%x Pages: %d, Offset: 0x%x\n", TRACE_(VIDEOPRT, "AgpCommitVirtual - VirtualContext: 0x%x Pages: %d, Offset: 0x%x\n",
VirtualContext, Pages, Offset); VirtualContext, Pages, Offset);
VirtualMapping = (PVIDEO_PORT_AGP_VIRTUAL_MAPPING)VirtualContext; VirtualMapping = (PVIDEO_PORT_AGP_VIRTUAL_MAPPING)VirtualContext;
@ -288,7 +287,7 @@ IntAgpCommitVirtual(
&Size, MEM_RELEASE); &Size, MEM_RELEASE);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("Warning: ZwFreeVirtualMemory() failed: Status = 0x%x\n", Status); WARN_(VIDEOPRT, "Warning: ZwFreeVirtualMemory() failed: Status = 0x%x\n", Status);
return NULL; return NULL;
} }
ASSERT(Size == Pages * PAGE_SIZE); ASSERT(Size == Pages * PAGE_SIZE);
@ -303,14 +302,14 @@ IntAgpCommitVirtual(
&BaseAddress); &BaseAddress);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("Warning: IntVideoPortMapPhysicalMemory() failed: Status = 0x%x\n", Status); WARN_(VIDEOPRT, "Warning: IntVideoPortMapPhysicalMemory() failed: Status = 0x%x\n", Status);
/* Reserve the released virtual memory area again */ /* Reserve the released virtual memory area again */
Status = ZwAllocateVirtualMemory(VirtualMapping->ProcessHandle, Status = ZwAllocateVirtualMemory(VirtualMapping->ProcessHandle,
&BaseAddress, 0, &Size, MEM_RESERVE, &BaseAddress, 0, &Size, MEM_RESERVE,
PAGE_NOACCESS); PAGE_NOACCESS);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("Warning: ZwAllocateVirtualMemory() failed: Status = 0x%x\n", Status); WARN_(VIDEOPRT, "Warning: ZwAllocateVirtualMemory() failed: Status = 0x%x\n", Status);
/* FIXME: What to do now?? */ /* FIXME: What to do now?? */
ASSERT(0); ASSERT(0);
return NULL; return NULL;
@ -338,7 +337,7 @@ IntAgpFreeVirtual(
PVOID BaseAddress = NULL; PVOID BaseAddress = NULL;
NTSTATUS Status; NTSTATUS Status;
DPRINT("AgpFreeVirtual - VirtualContext: 0x%x Pages: %d, Offset: 0x%x\n", TRACE_(VIDEOPRT, "AgpFreeVirtual - VirtualContext: 0x%x Pages: %d, Offset: 0x%x\n",
VirtualContext, Pages, Offset); VirtualContext, Pages, Offset);
VirtualMapping = (PVIDEO_PORT_AGP_VIRTUAL_MAPPING)VirtualContext; VirtualMapping = (PVIDEO_PORT_AGP_VIRTUAL_MAPPING)VirtualContext;
@ -358,7 +357,7 @@ IntAgpFreeVirtual(
Status = ZwUnmapViewOfSection(VirtualMapping->ProcessHandle, BaseAddress); Status = ZwUnmapViewOfSection(VirtualMapping->ProcessHandle, BaseAddress);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("Warning: ZwUnmapViewOfSection() failed: Status = 0x%x\n", Status); WARN_(VIDEOPRT, "Warning: ZwUnmapViewOfSection() failed: Status = 0x%x\n", Status);
/* FIXME: What to do now?? */ /* FIXME: What to do now?? */
ASSERT(0); ASSERT(0);
return; return;
@ -370,7 +369,7 @@ IntAgpFreeVirtual(
PAGE_NOACCESS); PAGE_NOACCESS);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("Warning: ZwAllocateVirtualMemory() failed: Status = 0x%x\n", Status); WARN_(VIDEOPRT, "Warning: ZwAllocateVirtualMemory() failed: Status = 0x%x\n", Status);
/* FIXME: What to do now?? */ /* FIXME: What to do now?? */
ASSERT(0); ASSERT(0);
return; return;
@ -389,7 +388,7 @@ IntAgpReleaseVirtual(
PVIDEO_PORT_AGP_VIRTUAL_MAPPING VirtualMapping; PVIDEO_PORT_AGP_VIRTUAL_MAPPING VirtualMapping;
NTSTATUS Status; NTSTATUS Status;
DPRINT("AgpReleaseVirtual - VirtualContext: 0x%x\n", VirtualContext); TRACE_(VIDEOPRT, "AgpReleaseVirtual - VirtualContext: 0x%x\n", VirtualContext);
VirtualMapping = (PVIDEO_PORT_AGP_VIRTUAL_MAPPING)VirtualContext; VirtualMapping = (PVIDEO_PORT_AGP_VIRTUAL_MAPPING)VirtualContext;
@ -407,7 +406,7 @@ IntAgpReleaseVirtual(
&Size, MEM_RELEASE); &Size, MEM_RELEASE);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("Warning: ZwFreeVirtualMemory() failed: Status = 0x%x\n", Status); WARN_(VIDEOPRT, "Warning: ZwFreeVirtualMemory() failed: Status = 0x%x\n", Status);
} }
} }
@ -427,7 +426,7 @@ IntAgpReserveVirtual(
PVOID MappedAddress; PVOID MappedAddress;
NTSTATUS Status; NTSTATUS Status;
DPRINT("AgpReserveVirtual - ProcessHandle: 0x%x PhysicalContext: 0x%x\n", TRACE_(VIDEOPRT, "AgpReserveVirtual - ProcessHandle: 0x%x PhysicalContext: 0x%x\n",
ProcessHandle, PhysicalContext); ProcessHandle, PhysicalContext);
AgpMapping = (PVIDEO_PORT_AGP_MAPPING)PhysicalContext; AgpMapping = (PVIDEO_PORT_AGP_MAPPING)PhysicalContext;
@ -438,7 +437,7 @@ IntAgpReserveVirtual(
TAG_VIDEO_PORT); TAG_VIDEO_PORT);
if (VirtualMapping == NULL) if (VirtualMapping == NULL)
{ {
DPRINT1("Out of memory! Couldn't allocate AGP virtual mapping structure!\n"); WARN_(VIDEOPRT, "Out of memory! Couldn't allocate AGP virtual mapping structure!\n");
return NULL; return NULL;
} }
RtlZeroMemory(VirtualMapping, sizeof(VIDEO_PORT_AGP_VIRTUAL_MAPPING)); RtlZeroMemory(VirtualMapping, sizeof(VIDEO_PORT_AGP_VIRTUAL_MAPPING));
@ -460,7 +459,7 @@ IntAgpReserveVirtual(
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
ExFreePool(VirtualMapping); ExFreePool(VirtualMapping);
DPRINT("ZwAllocateVirtualMemory() failed: Status = 0x%x\n", Status); WARN_(VIDEOPRT, "ZwAllocateVirtualMemory() failed: Status = 0x%x\n", Status);
return NULL; return NULL;
} }
} }
@ -483,7 +482,7 @@ IntAgpSetRate(
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
PAGP_BUS_INTERFACE_STANDARD AgpBusInterface; PAGP_BUS_INTERFACE_STANDARD AgpBusInterface;
DPRINT("AgpSetRate - Rate: %d\n", Rate); TRACE_(VIDEOPRT, "AgpSetRate - Rate: %d\n", Rate);
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
AgpBusInterface = &DeviceExtension->AgpInterface; AgpBusInterface = &DeviceExtension->AgpInterface;
@ -515,7 +514,7 @@ IntAgpGetInterface(
if (DeviceExtension->NextDeviceObject == NULL) if (DeviceExtension->NextDeviceObject == NULL)
{ {
DPRINT("DeviceExtension->NextDeviceObject is NULL!\n"); WARN_(VIDEOPRT, "DeviceExtension->NextDeviceObject is NULL!\n");
return STATUS_UNSUCCESSFUL; return STATUS_UNSUCCESSFUL;
} }
@ -536,10 +535,10 @@ IntAgpGetInterface(
&IoStatusBlock, IRP_MN_QUERY_INTERFACE, &IoStack); &IoStatusBlock, IRP_MN_QUERY_INTERFACE, &IoStack);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("IopInitiatePnpIrp() failed! (Status 0x%x)\n", Status); WARN_(VIDEOPRT, "IopInitiatePnpIrp() failed! (Status 0x%x)\n", Status);
return Status; return Status;
} }
DPRINT("Got AGP driver interface!\n"); INFO_(VIDEOPRT, "Got AGP driver interface!\n");
} }
/* FIXME: Not sure if we should wrap the reference/dereference functions */ /* FIXME: Not sure if we should wrap the reference/dereference functions */

View file

@ -18,7 +18,6 @@
* If not, write to the Free Software Foundation, * If not, write to the Free Software Foundation,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id$
*/ */
#include "videoprt.h" #include "videoprt.h"
@ -69,7 +68,7 @@ I2CWrite(PVOID HwDeviceExtension, PI2C_CALLBACKS i2c, UCHAR Data)
Ack = (READ_SDA() == LOW); Ack = (READ_SDA() == LOW);
DELAY_HALF(); DELAY_HALF();
DPRINT("I2CWrite: %s\n", Ack ? "Ack" : "Nak"); INFO_(VIDEOPRT, "I2CWrite: %s\n", Ack ? "Ack" : "Nak");
return Ack; return Ack;
} }
@ -128,7 +127,7 @@ I2CStart(PVOID HwDeviceExtension, PI2C_CALLBACKS i2c, UCHAR Address)
/* make sure the bus is free */ /* make sure the bus is free */
if (READ_SDA() == LOW || READ_SCL() == LOW) if (READ_SDA() == LOW || READ_SCL() == LOW)
{ {
DPRINT1("I2CStart: Bus is not free!\n"); WARN_(VIDEOPRT, "I2CStart: Bus is not free!\n");
return FALSE; return FALSE;
} }
@ -139,11 +138,11 @@ I2CStart(PVOID HwDeviceExtension, PI2C_CALLBACKS i2c, UCHAR Address)
{ {
/* ??release the bus?? */ /* ??release the bus?? */
I2CStop(HwDeviceExtension, i2c); I2CStop(HwDeviceExtension, i2c);
DPRINT1("I2CStart: Device not found (Address = 0x%x)\n", Address); WARN_(VIDEOPRT, "I2CStart: Device not found (Address = 0x%x)\n", Address);
return FALSE; return FALSE;
} }
DPRINT("I2CStart: SUCCESS!\n"); INFO_(VIDEOPRT, "I2CStart: SUCCESS!\n");
return TRUE; return TRUE;
} }
@ -182,12 +181,12 @@ VideoPortDDCMonitorHelper(
PUCHAR pBuffer = (PUCHAR)pEdidBuffer; PUCHAR pBuffer = (PUCHAR)pEdidBuffer;
BOOL Ack; BOOL Ack;
DPRINT("VideoPortDDCMonitorHelper()\n"); TRACE_(VIDEOPRT, "VideoPortDDCMonitorHelper()\n");
ASSERT_IRQL(PASSIVE_LEVEL); ASSERT_IRQL(PASSIVE_LEVEL);
if (ddc->Size != sizeof (ddc)) if (ddc->Size != sizeof (ddc))
{ {
DPRINT("ddc->Size != %d (%d)\n", sizeof (ddc), ddc->Size); WARN_(VIDEOPRT, "ddc->Size != %d (%d)\n", sizeof (ddc), ddc->Size);
return FALSE; return FALSE;
} }
@ -216,12 +215,12 @@ VideoPortDDCMonitorHelper(
pBuffer[4] != 0xff || pBuffer[5] != 0xff || pBuffer[4] != 0xff || pBuffer[5] != 0xff ||
pBuffer[6] != 0xff || pBuffer[7] != 0x00) pBuffer[6] != 0xff || pBuffer[7] != 0x00)
{ {
DPRINT1("VideoPortDDCMonitorHelper(): Invalid EDID header!\n"); WARN_(VIDEOPRT, "VideoPortDDCMonitorHelper(): Invalid EDID header!\n");
return FALSE; return FALSE;
} }
DPRINT("VideoPortDDCMonitorHelper(): EDID version %d rev. %d\n", pBuffer[18], pBuffer[19]); INFO_(VIDEOPRT, "VideoPortDDCMonitorHelper(): EDID version %d rev. %d\n", pBuffer[18], pBuffer[19]);
DPRINT("VideoPortDDCMonitorHelper() - SUCCESS!\n"); INFO_(VIDEOPRT, "VideoPortDDCMonitorHelper() - SUCCESS!\n");
return TRUE; return TRUE;
} }

View file

@ -102,7 +102,7 @@ IntVideoPortDispatchOpen(
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
PVIDEO_PORT_DRIVER_EXTENSION DriverExtension; PVIDEO_PORT_DRIVER_EXTENSION DriverExtension;
DPRINT("IntVideoPortDispatchOpen\n"); TRACE_(VIDEOPRT, "IntVideoPortDispatchOpen\n");
if (CsrssInitialized == FALSE) if (CsrssInitialized == FALSE)
{ {
@ -111,9 +111,9 @@ IntVideoPortDispatchOpen(
* to let us know its handle. * to let us know its handle.
*/ */
DPRINT("Referencing CSRSS\n"); INFO_(VIDEOPRT, "Referencing CSRSS\n");
Csrss = (PKPROCESS)PsGetCurrentProcess(); Csrss = (PKPROCESS)PsGetCurrentProcess();
DPRINT("Csrss %p\n", Csrss); INFO_(VIDEOPRT, "Csrss %p\n", Csrss);
CsrssInitialized = TRUE; CsrssInitialized = TRUE;
@ -159,7 +159,7 @@ IntVideoPortDispatchClose(
{ {
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
DPRINT("IntVideoPortDispatchClose\n"); TRACE_(VIDEOPRT, "IntVideoPortDispatchClose\n");
DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension; DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
if (DeviceExtension->DeviceOpened >= 1 && if (DeviceExtension->DeviceOpened >= 1 &&
@ -197,7 +197,7 @@ IntVideoPortDispatchDeviceControl(
PVIDEO_REQUEST_PACKET vrp; PVIDEO_REQUEST_PACKET vrp;
NTSTATUS Status; NTSTATUS Status;
DPRINT("IntVideoPortDispatchDeviceControl\n"); TRACE_(VIDEOPRT, "IntVideoPortDispatchDeviceControl\n");
IrpStack = IoGetCurrentIrpStackLocation(Irp); IrpStack = IoGetCurrentIrpStackLocation(Irp);
DeviceExtension = DeviceObject->DeviceExtension; DeviceExtension = DeviceObject->DeviceExtension;
@ -213,7 +213,7 @@ IntVideoPortDispatchDeviceControl(
vrp->StatusBlock = (PSTATUS_BLOCK)&(Irp->IoStatus); vrp->StatusBlock = (PSTATUS_BLOCK)&(Irp->IoStatus);
vrp->IoControlCode = IrpStack->Parameters.DeviceIoControl.IoControlCode; vrp->IoControlCode = IrpStack->Parameters.DeviceIoControl.IoControlCode;
DPRINT("- IoControlCode: %x\n", vrp->IoControlCode); INFO_(VIDEOPRT, "- IoControlCode: %x\n", vrp->IoControlCode);
/* We're assuming METHOD_BUFFERED */ /* We're assuming METHOD_BUFFERED */
vrp->InputBuffer = Irp->AssociatedIrp.SystemBuffer; vrp->InputBuffer = Irp->AssociatedIrp.SystemBuffer;
@ -229,7 +229,7 @@ IntVideoPortDispatchDeviceControl(
/* Free the VRP */ /* Free the VRP */
ExFreePool(vrp); ExFreePool(vrp);
DPRINT("- Returned status: %x\n", Irp->IoStatus.Status); INFO_(VIDEOPRT, "- Returned status: %x\n", Irp->IoStatus.Status);
if (Irp->IoStatus.Status != STATUS_SUCCESS) if (Irp->IoStatus.Status != STATUS_SUCCESS)
{ {
@ -377,7 +377,7 @@ IntVideoPortPnPStartDevice(
} }
} }
} }
DPRINT("Interrupt level: 0x%x Interrupt Vector: 0x%x\n", INFO_(VIDEOPRT, "Interrupt level: 0x%x Interrupt Vector: 0x%x\n",
DeviceExtension->InterruptLevel, DeviceExtension->InterruptLevel,
DeviceExtension->InterruptVector); DeviceExtension->InterruptVector);

View file

@ -18,7 +18,6 @@
* If not, write to the Free Software Foundation, * If not, write to the Free Software Foundation,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id: dma.c 27066 2007-06-07 22:12:10Z greatlrd $
*/ */
#include "videoprt.h" #include "videoprt.h"
@ -75,7 +74,7 @@ VideoPortPutDmaAdapter(
IN PVOID HwDeviceExtension, IN PVOID HwDeviceExtension,
IN PVP_DMA_ADAPTER VpDmaAdapter) IN PVP_DMA_ADAPTER VpDmaAdapter)
{ {
DPRINT1("unimplemented VideoPortPutDmaAdapter\n"); UNIMPLEMENTED;
} }
/* /*
@ -94,7 +93,7 @@ VideoPortGetDmaAdapter(
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
DPRINT("VideoPortGetDmaAdapter\n"); TRACE_(VIDEOPRT, "VideoPortGetDmaAdapter\n");
DeviceDescription.Version = DEVICE_DESCRIPTION_VERSION; DeviceDescription.Version = DEVICE_DESCRIPTION_VERSION;
DeviceDescription.Master = TRUE /* ?? */; DeviceDescription.Master = TRUE /* ?? */;
@ -114,7 +113,7 @@ VideoPortGetDmaAdapter(
Adapter = Adapter =
(PVP_DMA_ADAPTER)HalGetAdapter(&DeviceDescription, &NumberOfMapRegisters); (PVP_DMA_ADAPTER)HalGetAdapter(&DeviceDescription, &NumberOfMapRegisters);
DPRINT("Adapter %X\n", Adapter); INFO_(VIDEOPRT, "Adapter %p\n", Adapter);
return(Adapter); return(Adapter);
} }

View file

@ -18,7 +18,6 @@
* If not, write to the Free Software Foundation, * If not, write to the Free Software Foundation,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id: videoprt.c 28975 2007-09-09 12:39:11Z fireball $
*/ */
@ -46,7 +45,7 @@ IntVideoPortGetProcAddress(
{ {
ULONG i = 0; ULONG i = 0;
DPRINT("VideoPortGetProcAddress(%s)\n", FunctionName); TRACE_(VIDEOPRT, "VideoPortGetProcAddress(%s)\n", FunctionName);
/* Search by name */ /* Search by name */
for (i = 0; i < VP_EXPORTED_FUNCS; i++) for (i = 0; i < VP_EXPORTED_FUNCS; i++)
@ -58,7 +57,7 @@ IntVideoPortGetProcAddress(
} }
} }
DPRINT("VideoPortGetProcAddress: Can't resolve symbol %s\n", FunctionName); WARN_(VIDEOPRT, "VideoPortGetProcAddress: Can't resolve symbol %s\n", FunctionName);
return NULL; return NULL;
} }

View file

@ -18,7 +18,6 @@
* If not, write to the Free Software Foundation, * If not, write to the Free Software Foundation,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id: int10.c 23763 2006-08-28 23:56:35Z ion $
*/ */
#include "videoprt.h" #include "videoprt.h"
@ -38,7 +37,7 @@ IntInt10AllocateBuffer(
PKPROCESS CallingProcess; PKPROCESS CallingProcess;
KAPC_STATE ApcState; KAPC_STATE ApcState;
DPRINT("IntInt10AllocateBuffer\n"); TRACE_(VIDEOPRT, "IntInt10AllocateBuffer\n");
IntAttachToCSRSS(&CallingProcess, &ApcState); IntAttachToCSRSS(&CallingProcess, &ApcState);
@ -48,7 +47,7 @@ IntInt10AllocateBuffer(
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("- ZwAllocateVirtualMemory failed\n"); WARN_(VIDEOPRT, "- ZwAllocateVirtualMemory failed\n");
IntDetachFromCSRSS(&CallingProcess, &ApcState); IntDetachFromCSRSS(&CallingProcess, &ApcState);
return ERROR_NOT_ENOUGH_MEMORY; return ERROR_NOT_ENOUGH_MEMORY;
} }
@ -57,7 +56,7 @@ IntInt10AllocateBuffer(
{ {
ZwFreeVirtualMemory(NtCurrentProcess(), &MemoryAddress, Length, ZwFreeVirtualMemory(NtCurrentProcess(), &MemoryAddress, Length,
MEM_RELEASE); MEM_RELEASE);
DPRINT("- Unacceptable memory allocated\n"); WARN_(VIDEOPRT, "- Unacceptable memory allocated\n");
IntDetachFromCSRSS(&CallingProcess, &ApcState); IntDetachFromCSRSS(&CallingProcess, &ApcState);
return ERROR_NOT_ENOUGH_MEMORY; return ERROR_NOT_ENOUGH_MEMORY;
} }
@ -65,9 +64,9 @@ IntInt10AllocateBuffer(
*Seg = (ULONG)MemoryAddress >> 4; *Seg = (ULONG)MemoryAddress >> 4;
*Off = (ULONG)MemoryAddress & 0xF; *Off = (ULONG)MemoryAddress & 0xF;
DPRINT("- Segment: %x\n", (ULONG)MemoryAddress >> 4); INFO_(VIDEOPRT, "- Segment: %x\n", (ULONG)MemoryAddress >> 4);
DPRINT("- Offset: %x\n", (ULONG)MemoryAddress & 0xF); INFO_(VIDEOPRT, "- Offset: %x\n", (ULONG)MemoryAddress & 0xF);
DPRINT("- Length: %x\n", *Length); INFO_(VIDEOPRT, "- Length: %x\n", *Length);
IntDetachFromCSRSS(&CallingProcess, &ApcState); IntDetachFromCSRSS(&CallingProcess, &ApcState);
@ -85,9 +84,9 @@ IntInt10FreeBuffer(
PKPROCESS CallingProcess; PKPROCESS CallingProcess;
KAPC_STATE ApcState; KAPC_STATE ApcState;
DPRINT("IntInt10FreeBuffer\n"); TRACE_(VIDEOPRT, "IntInt10FreeBuffer\n");
DPRINT("- Segment: %x\n", Seg); INFO_(VIDEOPRT, "- Segment: %x\n", Seg);
DPRINT("- Offset: %x\n", Off); INFO_(VIDEOPRT, "- Offset: %x\n", Off);
IntAttachToCSRSS(&CallingProcess, &ApcState); IntAttachToCSRSS(&CallingProcess, &ApcState);
Status = ZwFreeVirtualMemory(NtCurrentProcess(), &MemoryAddress, 0, Status = ZwFreeVirtualMemory(NtCurrentProcess(), &MemoryAddress, 0,
@ -108,11 +107,11 @@ IntInt10ReadMemory(
PKPROCESS CallingProcess; PKPROCESS CallingProcess;
KAPC_STATE ApcState; KAPC_STATE ApcState;
DPRINT("IntInt10ReadMemory\n"); TRACE_(VIDEOPRT, "IntInt10ReadMemory\n");
DPRINT("- Segment: %x\n", Seg); INFO_(VIDEOPRT, "- Segment: %x\n", Seg);
DPRINT("- Offset: %x\n", Off); INFO_(VIDEOPRT, "- Offset: %x\n", Off);
DPRINT("- Buffer: %x\n", Buffer); INFO_(VIDEOPRT, "- Buffer: %x\n", Buffer);
DPRINT("- Length: %x\n", Length); INFO_(VIDEOPRT, "- Length: %x\n", Length);
IntAttachToCSRSS(&CallingProcess, &ApcState); IntAttachToCSRSS(&CallingProcess, &ApcState);
RtlCopyMemory(Buffer, (PVOID)((Seg << 4) | Off), Length); RtlCopyMemory(Buffer, (PVOID)((Seg << 4) | Off), Length);
@ -132,11 +131,11 @@ IntInt10WriteMemory(
PKPROCESS CallingProcess; PKPROCESS CallingProcess;
KAPC_STATE ApcState; KAPC_STATE ApcState;
DPRINT("IntInt10WriteMemory\n"); TRACE_(VIDEOPRT, "IntInt10WriteMemory\n");
DPRINT("- Segment: %x\n", Seg); INFO_(VIDEOPRT, "- Segment: %x\n", Seg);
DPRINT("- Offset: %x\n", Off); INFO_(VIDEOPRT, "- Offset: %x\n", Off);
DPRINT("- Buffer: %x\n", Buffer); INFO_(VIDEOPRT, "- Buffer: %x\n", Buffer);
DPRINT("- Length: %x\n", Length); INFO_(VIDEOPRT, "- Length: %x\n", Length);
IntAttachToCSRSS(&CallingProcess, &ApcState); IntAttachToCSRSS(&CallingProcess, &ApcState);
RtlCopyMemory((PVOID)((Seg << 4) | Off), Buffer, Length); RtlCopyMemory((PVOID)((Seg << 4) | Off), Buffer, Length);
@ -208,7 +207,7 @@ VideoPortInt10(
PKPROCESS CallingProcess; PKPROCESS CallingProcess;
KAPC_STATE ApcState; KAPC_STATE ApcState;
DPRINT("VideoPortInt10\n"); TRACE_(VIDEOPRT, "VideoPortInt10\n");
if (!CsrssInitialized) if (!CsrssInitialized)
{ {
@ -218,19 +217,19 @@ VideoPortInt10(
IntAttachToCSRSS(&CallingProcess, &ApcState); IntAttachToCSRSS(&CallingProcess, &ApcState);
memset(&Regs, 0, sizeof(Regs)); memset(&Regs, 0, sizeof(Regs));
DPRINT("- Input register Eax: %x\n", BiosArguments->Eax); INFO_(VIDEOPRT, "- Input register Eax: %x\n", BiosArguments->Eax);
Regs.Eax = BiosArguments->Eax; Regs.Eax = BiosArguments->Eax;
DPRINT("- Input register Ebx: %x\n", BiosArguments->Ebx); INFO_(VIDEOPRT, "- Input register Ebx: %x\n", BiosArguments->Ebx);
Regs.Ebx = BiosArguments->Ebx; Regs.Ebx = BiosArguments->Ebx;
DPRINT("- Input register Ecx: %x\n", BiosArguments->Ecx); INFO_(VIDEOPRT, "- Input register Ecx: %x\n", BiosArguments->Ecx);
Regs.Ecx = BiosArguments->Ecx; Regs.Ecx = BiosArguments->Ecx;
DPRINT("- Input register Edx: %x\n", BiosArguments->Edx); INFO_(VIDEOPRT, "- Input register Edx: %x\n", BiosArguments->Edx);
Regs.Edx = BiosArguments->Edx; Regs.Edx = BiosArguments->Edx;
DPRINT("- Input register Esi: %x\n", BiosArguments->Esi); INFO_(VIDEOPRT, "- Input register Esi: %x\n", BiosArguments->Esi);
Regs.Esi = BiosArguments->Esi; Regs.Esi = BiosArguments->Esi;
DPRINT("- Input register Edi: %x\n", BiosArguments->Edi); INFO_(VIDEOPRT, "- Input register Edi: %x\n", BiosArguments->Edi);
Regs.Edi = BiosArguments->Edi; Regs.Edi = BiosArguments->Edi;
DPRINT("- Input register Ebp: %x\n", BiosArguments->Ebp); INFO_(VIDEOPRT, "- Input register Ebp: %x\n", BiosArguments->Ebp);
Regs.Ebp = BiosArguments->Ebp; Regs.Ebp = BiosArguments->Ebp;
Status = Ke386CallBios(0x10, (PCONTEXT)&Regs); Status = Ke386CallBios(0x10, (PCONTEXT)&Regs);
BiosArguments->Eax = Regs.Eax; BiosArguments->Eax = Regs.Eax;

View file

@ -18,7 +18,6 @@
* If not, write to the Free Software Foundation, * If not, write to the Free Software Foundation,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id: interrupt.c 21844 2006-05-07 19:34:23Z ion $
*/ */
#include "videoprt.h" #include "videoprt.h"
@ -71,7 +70,7 @@ IntVideoPortSetupInterrupt(
if (InterruptVector == 0) if (InterruptVector == 0)
{ {
DPRINT("HalGetInterruptVector failed\n"); WARN_(VIDEOPRT, "HalGetInterruptVector failed\n");
return FALSE; return FALSE;
} }
@ -91,7 +90,7 @@ IntVideoPortSetupInterrupt(
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("IoConnectInterrupt failed with status 0x%08x\n", Status); WARN_(VIDEOPRT, "IoConnectInterrupt failed with status 0x%08x\n", Status);
return FALSE; return FALSE;
} }
} }
@ -111,7 +110,7 @@ VideoPortEnableInterrupt(IN PVOID HwDeviceExtension)
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
BOOLEAN Status; BOOLEAN Status;
DPRINT("VideoPortEnableInterrupt\n"); TRACE_(VIDEOPRT, "VideoPortEnableInterrupt\n");
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
@ -133,7 +132,7 @@ VideoPortDisableInterrupt(IN PVOID HwDeviceExtension)
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
BOOLEAN Status; BOOLEAN Status;
DPRINT("VideoPortDisableInterrupt\n"); TRACE_(VIDEOPRT, "VideoPortDisableInterrupt\n");
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);

View file

@ -18,7 +18,6 @@
* If not, write to the Free Software Foundation, * If not, write to the Free Software Foundation,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id: resource.c 21844 2006-05-07 19:34:23Z ion $
*/ */
#include "videoprt.h" #include "videoprt.h"
@ -50,7 +49,7 @@ IntVideoPortMapPhysicalMemory(
Status = ZwOpenSection(&hMemObj, SECTION_ALL_ACCESS, &ObjAttribs); Status = ZwOpenSection(&hMemObj, SECTION_ALL_ACCESS, &ObjAttribs);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("ZwOpenSection() failed! (0x%x)\n", Status); WARN_(VIDEOPRT, "ZwOpenSection() failed! (0x%x)\n", Status);
return Status; return Status;
} }
@ -69,7 +68,7 @@ IntVideoPortMapPhysicalMemory(
ZwClose(hMemObj); ZwClose(hMemObj);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("ZwMapViewOfSection() failed! (0x%x)\n", Status); WARN_(VIDEOPRT, "ZwMapViewOfSection() failed! (0x%x)\n", Status);
} }
return Status; return Status;
@ -91,20 +90,20 @@ IntVideoPortMapMemory(
PVOID MappedAddress; PVOID MappedAddress;
PLIST_ENTRY Entry; PLIST_ENTRY Entry;
DPRINT("- IoAddress: %lx\n", IoAddress.u.LowPart); INFO_(VIDEOPRT, "- IoAddress: %lx\n", IoAddress.u.LowPart);
DPRINT("- NumberOfUchars: %lx\n", NumberOfUchars); INFO_(VIDEOPRT, "- NumberOfUchars: %lx\n", NumberOfUchars);
DPRINT("- InIoSpace: %x\n", InIoSpace); INFO_(VIDEOPRT, "- InIoSpace: %x\n", InIoSpace);
InIoSpace &= ~VIDEO_MEMORY_SPACE_DENSE; InIoSpace &= ~VIDEO_MEMORY_SPACE_DENSE;
if ((InIoSpace & VIDEO_MEMORY_SPACE_P6CACHE) != 0) if ((InIoSpace & VIDEO_MEMORY_SPACE_P6CACHE) != 0)
{ {
DPRINT("VIDEO_MEMORY_SPACE_P6CACHE not supported, turning off\n"); INFO_(VIDEOPRT, "VIDEO_MEMORY_SPACE_P6CACHE not supported, turning off\n");
InIoSpace &= ~VIDEO_MEMORY_SPACE_P6CACHE; InIoSpace &= ~VIDEO_MEMORY_SPACE_P6CACHE;
} }
if (ProcessHandle != NULL && (InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) == 0) if (ProcessHandle != NULL && (InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) == 0)
{ {
DPRINT("ProcessHandle is not NULL (0x%x) but InIoSpace does not have " INFO_(VIDEOPRT, "ProcessHandle is not NULL (0x%x) but InIoSpace does not have "
"VIDEO_MEMORY_SPACE_USER_MODE set! Setting " "VIDEO_MEMORY_SPACE_USER_MODE set! Setting "
"VIDEO_MEMORY_SPACE_USER_MODE.\n", "VIDEO_MEMORY_SPACE_USER_MODE.\n",
ProcessHandle); ProcessHandle);
@ -112,7 +111,7 @@ IntVideoPortMapMemory(
} }
else if (ProcessHandle == NULL && (InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) != 0) else if (ProcessHandle == NULL && (InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) != 0)
{ {
DPRINT("ProcessHandle is NULL (0x%x) but InIoSpace does have " INFO_(VIDEOPRT, "ProcessHandle is NULL (0x%x) but InIoSpace does have "
"VIDEO_MEMORY_SPACE_USER_MODE set! Setting ProcessHandle " "VIDEO_MEMORY_SPACE_USER_MODE set! Setting ProcessHandle "
"to NtCurrentProcess()\n", "to NtCurrentProcess()\n",
ProcessHandle); ProcessHandle);
@ -180,12 +179,12 @@ IntVideoPortMapMemory(
&MappedAddress); &MappedAddress);
if (!NT_SUCCESS(NtStatus)) if (!NT_SUCCESS(NtStatus))
{ {
DPRINT("IntVideoPortMapPhysicalMemory() failed! (0x%x)\n", NtStatus); WARN_(VIDEOPRT, "IntVideoPortMapPhysicalMemory() failed! (0x%x)\n", NtStatus);
if (Status) if (Status)
*Status = NO_ERROR; *Status = NO_ERROR;
return NULL; return NULL;
} }
DPRINT("Mapped user address = 0x%08x\n", MappedAddress); INFO_(VIDEOPRT, "Mapped user address = 0x%08x\n", MappedAddress);
} }
else /* kernel space */ else /* kernel space */
{ {
@ -273,7 +272,7 @@ IntVideoPortUnmapMemory(
Status = ZwUnmapViewOfSection(NtCurrentProcess(), MappedAddress); Status = ZwUnmapViewOfSection(NtCurrentProcess(), MappedAddress);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("Warning: Mapping for address 0x%x not found!\n", (ULONG)MappedAddress); WARN_(VIDEOPRT, "Warning: Mapping for address 0x%x not found!\n", (ULONG)MappedAddress);
} }
} }
@ -290,7 +289,7 @@ VideoPortGetDeviceBase(
IN ULONG NumberOfUchars, IN ULONG NumberOfUchars,
IN UCHAR InIoSpace) IN UCHAR InIoSpace)
{ {
DPRINT("VideoPortGetDeviceBase\n"); TRACE_(VIDEOPRT, "VideoPortGetDeviceBase\n");
return IntVideoPortMapMemory( return IntVideoPortMapMemory(
VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension), VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension),
IoAddress, IoAddress,
@ -309,7 +308,7 @@ VideoPortFreeDeviceBase(
IN PVOID HwDeviceExtension, IN PVOID HwDeviceExtension,
IN PVOID MappedAddress) IN PVOID MappedAddress)
{ {
DPRINT("VideoPortFreeDeviceBase\n"); TRACE_(VIDEOPRT, "VideoPortFreeDeviceBase\n");
IntVideoPortUnmapMemory( IntVideoPortUnmapMemory(
VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension), VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension),
MappedAddress); MappedAddress);
@ -331,7 +330,7 @@ VideoPortMapBankedMemory(
IN PBANKED_SECTION_ROUTINE BankRoutine, IN PBANKED_SECTION_ROUTINE BankRoutine,
IN PVOID Context) IN PVOID Context)
{ {
DPRINT("VideoPortMapBankedMemory\n"); TRACE_(VIDEOPRT, "VideoPortMapBankedMemory\n");
UNIMPLEMENTED; UNIMPLEMENTED;
return ERROR_CALL_NOT_IMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED;
} }
@ -352,8 +351,8 @@ VideoPortMapMemory(
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
NTSTATUS Status; NTSTATUS Status;
DPRINT("VideoPortMapMemory\n"); TRACE_(VIDEOPRT, "VideoPortMapMemory\n");
DPRINT("- *VirtualAddress: 0x%x\n", *VirtualAddress); INFO_(VIDEOPRT, "- *VirtualAddress: 0x%x\n", *VirtualAddress);
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
*VirtualAddress = IntVideoPortMapMemory( *VirtualAddress = IntVideoPortMapMemory(
@ -377,7 +376,7 @@ VideoPortUnmapMemory(
IN PVOID VirtualAddress, IN PVOID VirtualAddress,
IN HANDLE ProcessHandle) IN HANDLE ProcessHandle)
{ {
DPRINT("VideoPortFreeDeviceBase\n"); TRACE_(VIDEOPRT, "VideoPortFreeDeviceBase\n");
IntVideoPortUnmapMemory( IntVideoPortUnmapMemory(
VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension), VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension),
@ -415,7 +414,7 @@ VideoPortGetAccessRanges(
ULONG SlotIdToFind; ULONG SlotIdToFind;
ULONG ReturnedLength; ULONG ReturnedLength;
DPRINT("VideoPortGetAccessRanges\n"); TRACE_(VIDEOPRT, "VideoPortGetAccessRanges\n");
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
@ -448,7 +447,7 @@ VideoPortGetAccessRanges(
SlotIdToFind = Slot != NULL ? *Slot : 0; SlotIdToFind = Slot != NULL ? *Slot : 0;
PciSlotNumber.u.AsULONG = SlotIdToFind; PciSlotNumber.u.AsULONG = SlotIdToFind;
DPRINT("Looking for VendorId 0x%04x DeviceId 0x%04x\n", INFO_(VIDEOPRT, "Looking for VendorId 0x%04x DeviceId 0x%04x\n",
VendorIdToFind, DeviceIdToFind); VendorIdToFind, DeviceIdToFind);
/* /*
@ -457,7 +456,7 @@ VideoPortGetAccessRanges(
for (FunctionNumber = 0; FunctionNumber < 8; FunctionNumber++) for (FunctionNumber = 0; FunctionNumber < 8; FunctionNumber++)
{ {
DPRINT("- Function number: %d\n", FunctionNumber); INFO_(VIDEOPRT, "- Function number: %d\n", FunctionNumber);
PciSlotNumber.u.bits.FunctionNumber = FunctionNumber; PciSlotNumber.u.bits.FunctionNumber = FunctionNumber;
ReturnedLength = HalGetBusData( ReturnedLength = HalGetBusData(
PCIConfiguration, PCIConfiguration,
@ -465,10 +464,10 @@ VideoPortGetAccessRanges(
PciSlotNumber.u.AsULONG, PciSlotNumber.u.AsULONG,
&Config, &Config,
sizeof(PCI_COMMON_CONFIG)); sizeof(PCI_COMMON_CONFIG));
DPRINT("- Length of data: %x\n", ReturnedLength); INFO_(VIDEOPRT, "- Length of data: %x\n", ReturnedLength);
if (ReturnedLength == sizeof(PCI_COMMON_CONFIG)) if (ReturnedLength == sizeof(PCI_COMMON_CONFIG))
{ {
DPRINT("- Slot 0x%02x (Device %d Function %d) VendorId 0x%04x " INFO_(VIDEOPRT, "- Slot 0x%02x (Device %d Function %d) VendorId 0x%04x "
"DeviceId 0x%04x\n", "DeviceId 0x%04x\n",
PciSlotNumber.u.AsULONG, PciSlotNumber.u.AsULONG,
PciSlotNumber.u.bits.DeviceNumber, PciSlotNumber.u.bits.DeviceNumber,
@ -486,7 +485,7 @@ VideoPortGetAccessRanges(
if (FunctionNumber == 8) if (FunctionNumber == 8)
{ {
DPRINT("Didn't find device.\n"); WARN_(VIDEOPRT, "Didn't find device.\n");
return ERROR_DEV_NOT_EXIST; return ERROR_DEV_NOT_EXIST;
} }
} }
@ -524,17 +523,17 @@ VideoPortGetAccessRanges(
Descriptor->Type == CmResourceTypePort) && Descriptor->Type == CmResourceTypePort) &&
AssignedCount >= NumAccessRanges) AssignedCount >= NumAccessRanges)
{ {
DPRINT1("Too many access ranges found\n"); WARN_(VIDEOPRT, "Too many access ranges found\n");
return ERROR_NO_SYSTEM_RESOURCES; return ERROR_NO_SYSTEM_RESOURCES;
} }
if (Descriptor->Type == CmResourceTypeMemory) if (Descriptor->Type == CmResourceTypeMemory)
{ {
if (NumAccessRanges <= AssignedCount) if (NumAccessRanges <= AssignedCount)
{ {
DPRINT1("Too many access ranges found\n"); WARN_(VIDEOPRT, "Too many access ranges found\n");
return ERROR_NO_SYSTEM_RESOURCES; return ERROR_NO_SYSTEM_RESOURCES;
} }
DPRINT("Memory range starting at 0x%08x length 0x%08x\n", INFO_(VIDEOPRT, "Memory range starting at 0x%08x length 0x%08x\n",
Descriptor->u.Memory.Start.u.LowPart, Descriptor->u.Memory.Length); Descriptor->u.Memory.Start.u.LowPart, Descriptor->u.Memory.Length);
AccessRanges[AssignedCount].RangeStart = Descriptor->u.Memory.Start; AccessRanges[AssignedCount].RangeStart = Descriptor->u.Memory.Start;
AccessRanges[AssignedCount].RangeLength = Descriptor->u.Memory.Length; AccessRanges[AssignedCount].RangeLength = Descriptor->u.Memory.Length;
@ -546,7 +545,7 @@ VideoPortGetAccessRanges(
} }
else if (Descriptor->Type == CmResourceTypePort) else if (Descriptor->Type == CmResourceTypePort)
{ {
DPRINT("Port range starting at 0x%04x length %d\n", INFO_(VIDEOPRT, "Port range starting at 0x%04x length %d\n",
Descriptor->u.Memory.Start.u.LowPart, Descriptor->u.Memory.Length); Descriptor->u.Memory.Start.u.LowPart, Descriptor->u.Memory.Length);
AccessRanges[AssignedCount].RangeStart = Descriptor->u.Port.Start; AccessRanges[AssignedCount].RangeStart = Descriptor->u.Port.Start;
AccessRanges[AssignedCount].RangeLength = Descriptor->u.Port.Length; AccessRanges[AssignedCount].RangeLength = Descriptor->u.Port.Length;
@ -593,7 +592,7 @@ VideoPortVerifyAccessRanges(
ULONG ResourceListSize; ULONG ResourceListSize;
NTSTATUS Status; NTSTATUS Status;
DPRINT("VideoPortVerifyAccessRanges\n"); TRACE_(VIDEOPRT, "VideoPortVerifyAccessRanges\n");
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
@ -603,7 +602,7 @@ VideoPortVerifyAccessRanges(
ResourceList = ExAllocatePool(PagedPool, ResourceListSize); ResourceList = ExAllocatePool(PagedPool, ResourceListSize);
if (!ResourceList) if (!ResourceList)
{ {
DPRINT("ExAllocatePool() failed\n"); WARN_(VIDEOPRT, "ExAllocatePool() failed\n");
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
} }
@ -666,7 +665,7 @@ VideoPortGetDeviceData(
IN PMINIPORT_QUERY_DEVICE_ROUTINE CallbackRoutine, IN PMINIPORT_QUERY_DEVICE_ROUTINE CallbackRoutine,
IN PVOID Context) IN PVOID Context)
{ {
DPRINT("VideoPortGetDeviceData\n"); TRACE_(VIDEOPRT, "VideoPortGetDeviceData\n");
UNIMPLEMENTED; UNIMPLEMENTED;
return ERROR_CALL_NOT_IMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED;
} }
@ -682,7 +681,7 @@ VideoPortAllocatePool(
IN SIZE_T NumberOfBytes, IN SIZE_T NumberOfBytes,
IN ULONG Tag) IN ULONG Tag)
{ {
DPRINT("VideoPortAllocatePool\n"); TRACE_(VIDEOPRT, "VideoPortAllocatePool\n");
return ExAllocatePoolWithTag(PoolType, NumberOfBytes, Tag); return ExAllocatePoolWithTag(PoolType, NumberOfBytes, Tag);
} }
@ -708,7 +707,7 @@ VideoPortAllocateBuffer(
IN ULONG Size, IN ULONG Size,
OUT PVOID *Buffer) OUT PVOID *Buffer)
{ {
DPRINT("VideoPortAllocateBuffer\n"); TRACE_(VIDEOPRT, "VideoPortAllocateBuffer\n");
*Buffer = ExAllocatePoolWithTag ( PagedPool, Size, TAG_VIDEO_PORT_BUFFER ) ; *Buffer = ExAllocatePoolWithTag ( PagedPool, Size, TAG_VIDEO_PORT_BUFFER ) ;
return *Buffer == NULL ? ERROR_NOT_ENOUGH_MEMORY : NO_ERROR; return *Buffer == NULL ? ERROR_NOT_ENOUGH_MEMORY : NO_ERROR;
} }
@ -722,7 +721,7 @@ VideoPortReleaseBuffer(
IN PVOID HwDeviceExtension, IN PVOID HwDeviceExtension,
IN PVOID Ptr) IN PVOID Ptr)
{ {
DPRINT("VideoPortReleaseBuffer\n"); TRACE_(VIDEOPRT, "VideoPortReleaseBuffer\n");
ExFreePool(Ptr); ExFreePool(Ptr);
} }
@ -737,8 +736,8 @@ VideoPortLockBuffer(
IN ULONG Length, IN ULONG Length,
IN VP_LOCK_OPERATION Operation) IN VP_LOCK_OPERATION Operation)
{ {
DPRINT1("VideoPortLockBuffer: Unimplemented.\n"); UNIMPLEMENTED;
return NULL; return NULL;
} }
/* /*
@ -750,7 +749,7 @@ VideoPortUnlockBuffer(
IN PVOID HwDeviceExtension, IN PVOID HwDeviceExtension,
IN PVOID Mdl) IN PVOID Mdl)
{ {
DPRINT1("VideoPortUnlockBuffer: Unimplemented.\n"); UNIMPLEMENTED;
} }
/* /*
@ -763,9 +762,9 @@ VideoPortSetTrappedEmulatorPorts(
IN ULONG NumAccessRanges, IN ULONG NumAccessRanges,
IN PVIDEO_ACCESS_RANGE AccessRange) IN PVIDEO_ACCESS_RANGE AccessRange)
{ {
DPRINT("VideoPortSetTrappedEmulatorPorts\n"); UNIMPLEMENTED;
/* Should store the ranges in the device extension for use by ntvdm. */ /* Should store the ranges in the device extension for use by ntvdm. */
return NO_ERROR; return NO_ERROR;
} }
/* /*
@ -783,7 +782,7 @@ VideoPortGetBusData(
{ {
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
DPRINT("VideoPortGetBusData\n"); TRACE_(VIDEOPRT, "VideoPortGetBusData\n");
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
@ -818,7 +817,7 @@ VideoPortSetBusData(
{ {
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
DPRINT("VideoPortSetBusData\n"); TRACE_(VIDEOPRT, "VideoPortSetBusData\n");
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);

View file

@ -18,7 +18,6 @@
* If not, write to the Free Software Foundation, * If not, write to the Free Software Foundation,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id: services.c 21844 2006-05-07 19:34:23Z ion $
*/ */
#include "videoprt.h" #include "videoprt.h"
@ -41,7 +40,7 @@ VideoPortQueryServices(
IN VIDEO_PORT_SERVICES ServicesType, IN VIDEO_PORT_SERVICES ServicesType,
IN OUT PINTERFACE Interface) IN OUT PINTERFACE Interface)
{ {
DPRINT("VideoPortQueryServices - ServicesType: 0x%x\n", ServicesType); TRACE_(VIDEOPRT, "VideoPortQueryServices - ServicesType: 0x%x\n", ServicesType);
switch (ServicesType) switch (ServicesType)
{ {
@ -77,9 +76,11 @@ VideoPortQueryServices(
break; break;
case VideoPortServicesI2C: case VideoPortServicesI2C:
UNIMPLEMENTED;
return ERROR_CALL_NOT_IMPLEMENTED;
case VideoPortServicesHeadless: case VideoPortServicesHeadless:
DPRINT1("VideoPortServices%s is UNIMPLEMENTED!\n", UNIMPLEMENTED;
(ServicesType == VideoPortServicesI2C) ? "I2C" : "Headless");
return ERROR_CALL_NOT_IMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED;
default: default:
@ -97,7 +98,7 @@ VideoPortGetAgpServices(
VIDEO_PORT_AGP_INTERFACE Interface; VIDEO_PORT_AGP_INTERFACE Interface;
VP_STATUS Status; VP_STATUS Status;
DPRINT("VideoPortGetAgpServices\n"); TRACE_(VIDEOPRT, "VideoPortGetAgpServices\n");
Interface.Size = sizeof(Interface); Interface.Size = sizeof(Interface);
Interface.Version = VIDEO_PORT_AGP_INTERFACE_VERSION_1; Interface.Version = VIDEO_PORT_AGP_INTERFACE_VERSION_1;
@ -106,7 +107,7 @@ VideoPortGetAgpServices(
(PINTERFACE)&Interface); (PINTERFACE)&Interface);
if (Status != NO_ERROR) if (Status != NO_ERROR)
{ {
DPRINT("VideoPortQueryServices() failed!\n"); WARN_(VIDEOPRT, "VideoPortQueryServices() failed!\n");
return FALSE; return FALSE;
} }

View file

@ -18,7 +18,6 @@
* If not, write to the Free Software Foundation, * If not, write to the Free Software Foundation,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id: spinlock.c 21844 2006-05-07 19:34:23Z ion $
*/ */
#include "videoprt.h" #include "videoprt.h"
@ -32,7 +31,7 @@ VideoPortCreateSpinLock(
IN PVOID HwDeviceExtension, IN PVOID HwDeviceExtension,
OUT PSPIN_LOCK *SpinLock) OUT PSPIN_LOCK *SpinLock)
{ {
DPRINT("VideoPortCreateSpinLock\n"); TRACE_(VIDEOPRT, "VideoPortCreateSpinLock\n");
*SpinLock = ExAllocatePool(NonPagedPool, sizeof(KSPIN_LOCK)); *SpinLock = ExAllocatePool(NonPagedPool, sizeof(KSPIN_LOCK));
if (*SpinLock == NULL) if (*SpinLock == NULL)
return ERROR_NOT_ENOUGH_MEMORY; return ERROR_NOT_ENOUGH_MEMORY;
@ -49,7 +48,7 @@ VideoPortDeleteSpinLock(
IN PVOID HwDeviceExtension, IN PVOID HwDeviceExtension,
IN PSPIN_LOCK SpinLock) IN PSPIN_LOCK SpinLock)
{ {
DPRINT("VideoPortDeleteSpinLock\n"); TRACE_(VIDEOPRT, "VideoPortDeleteSpinLock\n");
ExFreePool(SpinLock); ExFreePool(SpinLock);
return NO_ERROR; return NO_ERROR;
} }
@ -64,7 +63,7 @@ VideoPortAcquireSpinLock(
IN PSPIN_LOCK SpinLock, IN PSPIN_LOCK SpinLock,
OUT PUCHAR OldIrql) OUT PUCHAR OldIrql)
{ {
DPRINT("VideoPortAcquireSpinLock\n"); TRACE_(VIDEOPRT, "VideoPortAcquireSpinLock\n");
KeAcquireSpinLock((PKSPIN_LOCK)SpinLock, OldIrql); KeAcquireSpinLock((PKSPIN_LOCK)SpinLock, OldIrql);
} }
@ -77,7 +76,7 @@ VideoPortAcquireSpinLockAtDpcLevel(
IN PVOID HwDeviceExtension, IN PVOID HwDeviceExtension,
IN PSPIN_LOCK SpinLock) IN PSPIN_LOCK SpinLock)
{ {
DPRINT("VideoPortAcquireSpinLockAtDpcLevel\n"); TRACE_(VIDEOPRT, "VideoPortAcquireSpinLockAtDpcLevel\n");
KefAcquireSpinLockAtDpcLevel((PKSPIN_LOCK)SpinLock); KefAcquireSpinLockAtDpcLevel((PKSPIN_LOCK)SpinLock);
} }
@ -91,7 +90,7 @@ VideoPortReleaseSpinLock(
IN PSPIN_LOCK SpinLock, IN PSPIN_LOCK SpinLock,
IN UCHAR NewIrql) IN UCHAR NewIrql)
{ {
DPRINT("VideoPortReleaseSpinLock\n"); TRACE_(VIDEOPRT, "VideoPortReleaseSpinLock\n");
KeReleaseSpinLock((PKSPIN_LOCK)SpinLock, NewIrql); KeReleaseSpinLock((PKSPIN_LOCK)SpinLock, NewIrql);
} }
@ -104,6 +103,6 @@ VideoPortReleaseSpinLockFromDpcLevel(
IN PVOID HwDeviceExtension, IN PVOID HwDeviceExtension,
IN PSPIN_LOCK SpinLock) IN PSPIN_LOCK SpinLock)
{ {
DPRINT("VideoPortReleaseSpinLockFromDpcLevel\n"); TRACE_(VIDEOPRT, "VideoPortReleaseSpinLockFromDpcLevel\n");
KefReleaseSpinLockFromDpcLevel((PKSPIN_LOCK)SpinLock); KefReleaseSpinLockFromDpcLevel((PKSPIN_LOCK)SpinLock);
} }

View file

@ -18,7 +18,6 @@
* If not, write to the Free Software Foundation, * If not, write to the Free Software Foundation,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id: timer.c 21844 2006-05-07 19:34:23Z ion $
*/ */
#include "videoprt.h" #include "videoprt.h"
@ -50,7 +49,7 @@ IntVideoPortSetupTimer(
if (DriverExtension->InitializationData.HwTimer != NULL) if (DriverExtension->InitializationData.HwTimer != NULL)
{ {
DPRINT("Initializing timer\n"); INFO_(VIDEOPRT, "Initializing timer\n");
Status = IoInitializeTimer( Status = IoInitializeTimer(
DeviceObject, DeviceObject,
@ -59,7 +58,7 @@ IntVideoPortSetupTimer(
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("IoInitializeTimer failed with status 0x%08x\n", Status); WARN_(VIDEOPRT, "IoInitializeTimer failed with status 0x%08x\n", Status);
return FALSE; return FALSE;
} }
} }
@ -76,7 +75,7 @@ IntVideoPortSetupTimer(
VOID NTAPI VOID NTAPI
VideoPortStartTimer(IN PVOID HwDeviceExtension) VideoPortStartTimer(IN PVOID HwDeviceExtension)
{ {
DPRINT("VideoPortStartTimer\n"); TRACE_(VIDEOPRT, "VideoPortStartTimer\n");
IoStartTimer(VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension)->FunctionalDeviceObject); IoStartTimer(VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension)->FunctionalDeviceObject);
} }
@ -87,6 +86,6 @@ VideoPortStartTimer(IN PVOID HwDeviceExtension)
VOID NTAPI VOID NTAPI
VideoPortStopTimer(IN PVOID HwDeviceExtension) VideoPortStopTimer(IN PVOID HwDeviceExtension)
{ {
DPRINT("VideoPortStopTimer\n"); TRACE_(VIDEOPRT, "VideoPortStopTimer\n");
IoStopTimer(VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension)->FunctionalDeviceObject); IoStopTimer(VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension)->FunctionalDeviceObject);
} }

View file

@ -134,7 +134,7 @@ IntCreateRegistryPath(
} }
else else
{ {
DPRINT1("Unparsable registry path %wZ", DriverRegistryPath); WARN_(VIDEOPRT, "Unparsable registry path %wZ", DriverRegistryPath);
} }
if (Valid) if (Valid)
@ -190,7 +190,7 @@ IntVideoPortCreateAdapterDeviceObject(
DeviceNumber = VideoPortDeviceNumber++; DeviceNumber = VideoPortDeviceNumber++;
if (DeviceNumber == 0xFFFFFFFF) if (DeviceNumber == 0xFFFFFFFF)
{ {
DPRINT("Can't find free device number\n"); WARN_(VIDEOPRT, "Can't find free device number\n");
return STATUS_UNSUCCESSFUL; return STATUS_UNSUCCESSFUL;
} }
@ -202,7 +202,7 @@ IntVideoPortCreateAdapterDeviceObject(
swprintf(DeviceBuffer, L"\\Device\\Video%lu", DeviceNumber); swprintf(DeviceBuffer, L"\\Device\\Video%lu", DeviceNumber);
RtlInitUnicodeString(&DeviceName, DeviceBuffer); RtlInitUnicodeString(&DeviceName, DeviceBuffer);
DPRINT("HwDeviceExtension size is: 0x%x\n", INFO_(VIDEOPRT, "HwDeviceExtension size is: 0x%x\n",
DriverExtension->InitializationData.HwDeviceExtensionSize); DriverExtension->InitializationData.HwDeviceExtensionSize);
/* Create the device object. */ /* Create the device object. */
@ -218,7 +218,7 @@ IntVideoPortCreateAdapterDeviceObject(
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("IoCreateDevice call failed with status 0x%08x\n", Status); WARN_(VIDEOPRT, "IoCreateDevice call failed with status 0x%08x\n", Status);
return Status; return Status;
} }
@ -249,7 +249,7 @@ IntVideoPortCreateAdapterDeviceObject(
&DeviceExtension->RegistryPath); &DeviceExtension->RegistryPath);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("IntCreateRegistryPath() call failed with status 0x%08x\n", Status); WARN_(VIDEOPRT, "IntCreateRegistryPath() call failed with status 0x%08x\n", Status);
IoDeleteDevice(*DeviceObject); IoDeleteDevice(*DeviceObject);
*DeviceObject = NULL; *DeviceObject = NULL;
return Status; return Status;
@ -267,7 +267,7 @@ IntVideoPortCreateAdapterDeviceObject(
&Size); &Size);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("Couldn't get an information from bus driver. We will try to\n" WARN_(VIDEOPRT, "Couldn't get an information from bus driver. We will try to\n"
"use legacy detection method, but even that doesn't mean that\n" "use legacy detection method, but even that doesn't mean that\n"
"it will work.\n"); "it will work.\n");
DeviceExtension->PhysicalDeviceObject = NULL; DeviceExtension->PhysicalDeviceObject = NULL;
@ -422,7 +422,7 @@ IntVideoPortFindAdapter(
} }
else else
{ {
DPRINT("HwFindAdapter call failed with error 0x%X\n", Status); WARN_(VIDEOPRT, "HwFindAdapter call failed with error 0x%X\n", Status);
RtlFreeUnicodeString(&DeviceExtension->RegistryPath); RtlFreeUnicodeString(&DeviceExtension->RegistryPath);
IoDeleteDevice(DeviceObject); IoDeleteDevice(DeviceObject);
@ -443,7 +443,7 @@ IntVideoPortFindAdapter(
if (Status != NO_ERROR) if (Status != NO_ERROR)
{ {
DPRINT("HwFindAdapter call failed with error 0x%X\n", Status); WARN_(VIDEOPRT, "HwFindAdapter call failed with error 0x%X\n", Status);
RtlFreeUnicodeString(&DeviceExtension->RegistryPath); RtlFreeUnicodeString(&DeviceExtension->RegistryPath);
IoDeleteDevice(DeviceObject); IoDeleteDevice(DeviceObject);
return Status; return Status;
@ -504,7 +504,7 @@ IntVideoPortFindAdapter(
IoDisconnectInterrupt(DeviceExtension->InterruptObject); IoDisconnectInterrupt(DeviceExtension->InterruptObject);
RtlFreeUnicodeString(&DeviceExtension->RegistryPath); RtlFreeUnicodeString(&DeviceExtension->RegistryPath);
IoDeleteDevice(DeviceObject); IoDeleteDevice(DeviceObject);
DPRINT("STATUS_INSUFFICIENT_RESOURCES\n"); WARN_(VIDEOPRT, "STATUS_INSUFFICIENT_RESOURCES\n");
return STATUS_INSUFFICIENT_RESOURCES; return STATUS_INSUFFICIENT_RESOURCES;
} }
@ -513,7 +513,7 @@ IntVideoPortFindAdapter(
*/ */
VideoPortEnumerateChildren(&DeviceExtension->MiniPortDeviceExtension, NULL); VideoPortEnumerateChildren(&DeviceExtension->MiniPortDeviceExtension, NULL);
DPRINT("STATUS_SUCCESS\n"); INFO_(VIDEOPRT, "STATUS_SUCCESS\n");
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
@ -555,7 +555,7 @@ VideoPortInitialize(
PVIDEO_PORT_DRIVER_EXTENSION DriverExtension; PVIDEO_PORT_DRIVER_EXTENSION DriverExtension;
BOOLEAN PnpDriver = FALSE, LegacyDetection = FALSE; BOOLEAN PnpDriver = FALSE, LegacyDetection = FALSE;
DPRINT("VideoPortInitialize\n"); TRACE_(VIDEOPRT, "VideoPortInitialize\n");
/* /*
* As a first thing do parameter checks. * As a first thing do parameter checks.
@ -581,19 +581,19 @@ VideoPortInitialize(
*/ */
case SIZE_OF_NT4_VIDEO_HW_INITIALIZATION_DATA: case SIZE_OF_NT4_VIDEO_HW_INITIALIZATION_DATA:
DPRINT("We were loaded by a Windows NT miniport driver.\n"); INFO_(VIDEOPRT, "We were loaded by a Windows NT miniport driver.\n");
break; break;
case SIZE_OF_W2K_VIDEO_HW_INITIALIZATION_DATA: case SIZE_OF_W2K_VIDEO_HW_INITIALIZATION_DATA:
DPRINT("We were loaded by a Windows 2000 miniport driver.\n"); INFO_(VIDEOPRT, "We were loaded by a Windows 2000 miniport driver.\n");
break; break;
case sizeof(VIDEO_HW_INITIALIZATION_DATA): case sizeof(VIDEO_HW_INITIALIZATION_DATA):
DPRINT("We were loaded by a Windows XP or later miniport driver.\n"); INFO_(VIDEOPRT, "We were loaded by a Windows XP or later miniport driver.\n");
break; break;
default: default:
DPRINT("Invalid HwInitializationData size.\n"); WARN_(VIDEOPRT, "Invalid HwInitializationData size.\n");
return STATUS_UNSUCCESSFUL; return STATUS_UNSUCCESSFUL;
} }
@ -615,14 +615,14 @@ VideoPortInitialize(
&& HwInitializationData->HwGetPowerState && HwInitializationData->HwGetPowerState
&& HwInitializationData->HwGetVideoChildDescriptor) && HwInitializationData->HwGetVideoChildDescriptor)
{ {
DPRINT("The miniport is a PnP miniport driver\n"); INFO_(VIDEOPRT, "The miniport is a PnP miniport driver\n");
PnpDriver = TRUE; PnpDriver = TRUE;
} }
/* Check if legacy detection should be applied */ /* Check if legacy detection should be applied */
if (!PnpDriver || HwContext) if (!PnpDriver || HwContext)
{ {
DPRINT("Legacy detection for adapter interface %d\n", INFO_(VIDEOPRT, "Legacy detection for adapter interface %d\n",
HwInitializationData->AdapterInterfaceType); HwInitializationData->AdapterInterfaceType);
/* FIXME: Move the code for legacy detection /* FIXME: Move the code for legacy detection
@ -674,7 +674,7 @@ VideoPortInitialize(
} }
RtlCopyUnicodeString(&DriverExtension->RegistryPath, RegistryPath); RtlCopyUnicodeString(&DriverExtension->RegistryPath, RegistryPath);
DPRINT("RegistryPath: %wZ\n", &DriverExtension->RegistryPath); INFO_(VIDEOPRT, "RegistryPath: %wZ\n", &DriverExtension->RegistryPath);
} }
else else
{ {
@ -716,11 +716,11 @@ VideoPortInitialize(
} }
Status = IntVideoPortCreateAdapterDeviceObject(DriverObject, DriverExtension, Status = IntVideoPortCreateAdapterDeviceObject(DriverObject, DriverExtension,
NULL, &DeviceObject); NULL, &DeviceObject);
DPRINT("IntVideoPortCreateAdapterDeviceObject returned 0x%x\n", Status); INFO_(VIDEOPRT, "IntVideoPortCreateAdapterDeviceObject returned 0x%x\n", Status);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
return Status; return Status;
Status = IntVideoPortFindAdapter(DriverObject, DriverExtension, DeviceObject); Status = IntVideoPortFindAdapter(DriverObject, DriverExtension, DeviceObject);
DPRINT("IntVideoPortFindAdapter returned 0x%x\n", Status); INFO_(VIDEOPRT, "IntVideoPortFindAdapter returned 0x%x\n", Status);
return Status; return Status;
} }
else else
@ -743,14 +743,11 @@ VideoPortDebugPrint(
IN VIDEO_DEBUG_LEVEL DebugPrintLevel, IN VIDEO_DEBUG_LEVEL DebugPrintLevel,
IN PCHAR DebugMessage, ...) IN PCHAR DebugMessage, ...)
{ {
char Buffer[256];
va_list ap; va_list ap;
va_start(ap, DebugMessage); va_start(ap, DebugMessage);
vsprintf(Buffer, DebugMessage, ap); vDbgPrintEx(DPFLTR_IHVVIDEO_ID, DebugPrintLevel, DebugMessage, ap);
va_end(ap); va_end(ap);
DbgPrintEx(DPFLTR_IHVVIDEO_ID, DebugPrintLevel, Buffer);
} }
/* /*
@ -764,12 +761,12 @@ VideoPortLogError(
IN VP_STATUS ErrorCode, IN VP_STATUS ErrorCode,
IN ULONG UniqueId) IN ULONG UniqueId)
{ {
DPRINT1("VideoPortLogError ErrorCode %d (0x%x) UniqueId %lu (0x%lx)\n", UNIMPLEMENTED;
ErrorCode, ErrorCode, UniqueId, UniqueId);
if (NULL != Vrp) INFO_(VIDEOPRT, "VideoPortLogError ErrorCode %d (0x%x) UniqueId %lu (0x%lx)\n",
{ ErrorCode, ErrorCode, UniqueId, UniqueId);
DPRINT1("Vrp->IoControlCode %lu (0x%lx)\n", Vrp->IoControlCode, Vrp->IoControlCode); if (Vrp)
} INFO_(VIDEOPRT, "Vrp->IoControlCode %lu (0x%lx)\n", Vrp->IoControlCode, Vrp->IoControlCode);
} }
/* /*
@ -800,7 +797,7 @@ QueryRegistryCallback(
{ {
PQUERY_REGISTRY_CALLBACK_CONTEXT CallbackContext = (PQUERY_REGISTRY_CALLBACK_CONTEXT) Context; PQUERY_REGISTRY_CALLBACK_CONTEXT CallbackContext = (PQUERY_REGISTRY_CALLBACK_CONTEXT) Context;
DPRINT("Found registry value for name %S: type %d, length %d\n", INFO_(VIDEOPRT, "Found registry value for name %S: type %d, length %d\n",
ValueName, ValueType, ValueLength); ValueName, ValueType, ValueLength);
return (*(CallbackContext->HwGetRegistryRoutine))( return (*(CallbackContext->HwGetRegistryRoutine))(
CallbackContext->HwDeviceExtension, CallbackContext->HwDeviceExtension,
@ -828,7 +825,7 @@ VideoPortGetRegistryParameters(
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
DPRINT("VideoPortGetRegistryParameters ParameterName %S, RegPath: %wZ\n", TRACE_(VIDEOPRT, "VideoPortGetRegistryParameters ParameterName %S, RegPath: %wZ\n",
ParameterName, &DeviceExtension->RegistryPath); ParameterName, &DeviceExtension->RegistryPath);
Context.HwDeviceExtension = HwDeviceExtension; Context.HwDeviceExtension = HwDeviceExtension;
@ -846,7 +843,7 @@ VideoPortGetRegistryParameters(
&Context, &Context,
NULL))) NULL)))
{ {
DPRINT1("VideoPortGetRegistryParameters could not find the " WARN_(VIDEOPRT, "VideoPortGetRegistryParameters could not find the "
"requested parameter\n"); "requested parameter\n");
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
} }
@ -873,7 +870,7 @@ VideoPortSetRegistryParameters(
{ {
VP_STATUS Status; VP_STATUS Status;
DPRINT("VideoPortSetRegistryParameters ParameterName %S, RegPath: %wZ\n", TRACE_(VIDEOPRT, "VideoPortSetRegistryParameters ParameterName %S, RegPath: %wZ\n",
ValueName, ValueName,
&VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension)->RegistryPath); &VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension)->RegistryPath);
ASSERT_IRQL(PASSIVE_LEVEL); ASSERT_IRQL(PASSIVE_LEVEL);
@ -886,7 +883,7 @@ VideoPortSetRegistryParameters(
ValueLength); ValueLength);
if (Status != ERROR_SUCCESS) if (Status != ERROR_SUCCESS)
DPRINT1("VideoPortSetRegistryParameters error 0x%x\n", Status); WARN_(VIDEOPRT, "VideoPortSetRegistryParameters error 0x%x\n", Status);
return Status; return Status;
} }
@ -902,7 +899,7 @@ VideoPortGetVgaStatus(
{ {
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
DPRINT("VideoPortGetVgaStatus\n"); TRACE_(VIDEOPRT, "VideoPortGetVgaStatus\n");
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
if (KeGetCurrentIrql() == PASSIVE_LEVEL) if (KeGetCurrentIrql() == PASSIVE_LEVEL)
@ -934,7 +931,7 @@ VideoPortGetRomImage(
PKPROCESS CallingProcess; PKPROCESS CallingProcess;
KAPC_STATE ApcState; KAPC_STATE ApcState;
DPRINT("VideoPortGetRomImage(HwDeviceExtension 0x%X Length 0x%X)\n", TRACE_(VIDEOPRT, "VideoPortGetRomImage(HwDeviceExtension 0x%X Length 0x%X)\n",
HwDeviceExtension, Length); HwDeviceExtension, Length);
/* If the length is zero then free the existing buffer. */ /* If the length is zero then free the existing buffer. */
@ -992,7 +989,7 @@ VideoPortScanRom(
BOOLEAN Found; BOOLEAN Found;
PUCHAR SearchLocation; PUCHAR SearchLocation;
DPRINT("VideoPortScanRom RomBase %p RomLength 0x%x String %s\n", RomBase, RomLength, String); TRACE_(VIDEOPRT, "VideoPortScanRom RomBase %p RomLength 0x%x String %s\n", RomBase, RomLength, String);
StringLength = strlen((PCHAR)String); StringLength = strlen((PCHAR)String);
Found = FALSE; Found = FALSE;
@ -1004,7 +1001,7 @@ VideoPortScanRom(
Found = (RtlCompareMemory(SearchLocation, String, StringLength) == StringLength); Found = (RtlCompareMemory(SearchLocation, String, StringLength) == StringLength);
if (Found) if (Found)
{ {
DPRINT("Match found at %p\n", SearchLocation); INFO_(VIDEOPRT, "Match found at %p\n", SearchLocation);
} }
} }
@ -1084,7 +1081,7 @@ VideoPortEnumerateChildren(
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
if (DeviceExtension->DriverExtension->InitializationData.HwGetVideoChildDescriptor == NULL) if (DeviceExtension->DriverExtension->InitializationData.HwGetVideoChildDescriptor == NULL)
{ {
DPRINT("Miniport's HwGetVideoChildDescriptor is NULL!\n"); WARN_(VIDEOPRT, "Miniport's HwGetVideoChildDescriptor is NULL!\n");
return NO_ERROR; return NO_ERROR;
} }
@ -1126,7 +1123,7 @@ VideoPortEnumerateChildren(
// Compare the previous monitor ID with the current one, break the loop if they are identical // Compare the previous monitor ID with the current one, break the loop if they are identical
if (RtlCompareMemory(LastMonitorID, &ChildDescriptor[8], sizeof(LastMonitorID)) == sizeof(LastMonitorID)) if (RtlCompareMemory(LastMonitorID, &ChildDescriptor[8], sizeof(LastMonitorID)) == sizeof(LastMonitorID))
{ {
DPRINT("Found identical Monitor ID two times, stopping enumeration\n"); INFO_(VIDEOPRT, "Found identical Monitor ID two times, stopping enumeration\n");
break; break;
} }
} }
@ -1139,17 +1136,17 @@ VideoPortEnumerateChildren(
} }
else if (Status == VIDEO_ENUM_INVALID_DEVICE) else if (Status == VIDEO_ENUM_INVALID_DEVICE)
{ {
DPRINT("Child device %d is invalid!\n", ChildEnumInfo.ChildIndex); WARN_(VIDEOPRT, "Child device %d is invalid!\n", ChildEnumInfo.ChildIndex);
continue; continue;
} }
else if (Status == VIDEO_ENUM_NO_MORE_DEVICES) else if (Status == VIDEO_ENUM_NO_MORE_DEVICES)
{ {
DPRINT("End of child enumeration! (%d children enumerated)\n", i - 1); INFO_(VIDEOPRT, "End of child enumeration! (%d children enumerated)\n", i - 1);
break; break;
} }
else else
{ {
DPRINT("HwGetVideoChildDescriptor returned unknown status code 0x%x!\n", Status); WARN_(VIDEOPRT, "HwGetVideoChildDescriptor returned unknown status code 0x%x!\n", Status);
break; break;
} }
@ -1158,21 +1155,21 @@ VideoPortEnumerateChildren(
{ {
INT j; INT j;
PUCHAR p = ChildDescriptor; PUCHAR p = ChildDescriptor;
DPRINT("Monitor device enumerated! (ChildId = 0x%x)\n", ChildId); INFO_(VIDEOPRT, "Monitor device enumerated! (ChildId = 0x%x)\n", ChildId);
for (j = 0; j < sizeof (ChildDescriptor); j += 8) for (j = 0; j < sizeof (ChildDescriptor); j += 8)
{ {
DPRINT("%02x %02x %02x %02x %02x %02x %02x %02x\n", INFO_(VIDEOPRT, "%02x %02x %02x %02x %02x %02x %02x %02x\n",
p[j+0], p[j+1], p[j+2], p[j+3], p[j+0], p[j+1], p[j+2], p[j+3],
p[j+4], p[j+5], p[j+6], p[j+7]); p[j+4], p[j+5], p[j+6], p[j+7]);
} }
} }
else if (ChildType == Other) else if (ChildType == Other)
{ {
DPRINT("\"Other\" device enumerated: DeviceId = %S\n", (PWSTR)ChildDescriptor); INFO_(VIDEOPRT, "\"Other\" device enumerated: DeviceId = %S\n", (PWSTR)ChildDescriptor);
} }
else else
{ {
DPRINT("HwGetVideoChildDescriptor returned unsupported type: %d\n", ChildType); WARN_(VIDEOPRT, "HwGetVideoChildDescriptor returned unsupported type: %d\n", ChildType);
} }
#endif /* NDEBUG */ #endif /* NDEBUG */
@ -1191,8 +1188,8 @@ VideoPortCreateSecondaryDisplay(
IN OUT PVOID *SecondaryDeviceExtension, IN OUT PVOID *SecondaryDeviceExtension,
IN ULONG Flag) IN ULONG Flag)
{ {
DPRINT1("VideoPortCreateSecondaryDisplay: Unimplemented.\n"); UNIMPLEMENTED;
return ERROR_DEV_NOT_EXIST; return ERROR_DEV_NOT_EXIST;
} }
/* /*
@ -1220,7 +1217,7 @@ VideoPortGetAssociatedDeviceExtension(IN PVOID DeviceObject)
{ {
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
DPRINT("VideoPortGetAssociatedDeviceExtension\n"); TRACE_(VIDEOPRT, "VideoPortGetAssociatedDeviceExtension\n");
DeviceExtension = ((PDEVICE_OBJECT)DeviceObject)->DeviceExtension; DeviceExtension = ((PDEVICE_OBJECT)DeviceObject)->DeviceExtension;
if (!DeviceExtension) if (!DeviceExtension)
return NULL; return NULL;
@ -1287,11 +1284,11 @@ VideoPortCheckForDeviceExistence(
NTSTATUS Status; NTSTATUS Status;
BOOL DevicePresent; BOOL DevicePresent;
DPRINT("VideoPortCheckForDeviceExistence\n"); TRACE_(VIDEOPRT, "VideoPortCheckForDeviceExistence\n");
if (Flags & ~(CDE_USE_REVISION | CDE_USE_SUBSYSTEM_IDS)) if (Flags & ~(CDE_USE_REVISION | CDE_USE_SUBSYSTEM_IDS))
{ {
DPRINT1("VideoPortCheckForDeviceExistence: Unknown flags 0x%lx\n", Flags & ~(CDE_USE_REVISION | CDE_USE_SUBSYSTEM_IDS)); WARN_(VIDEOPRT, "VideoPortCheckForDeviceExistence: Unknown flags 0x%lx\n", Flags & ~(CDE_USE_REVISION | CDE_USE_SUBSYSTEM_IDS));
return FALSE; return FALSE;
} }
@ -1308,7 +1305,7 @@ VideoPortCheckForDeviceExistence(
&IoStatusBlock, IRP_MN_QUERY_INTERFACE, &IoStack); &IoStatusBlock, IRP_MN_QUERY_INTERFACE, &IoStack);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("IopInitiatePnpIrp() failed! (Status 0x%lx)\n", Status); WARN_(VIDEOPRT, "IopInitiatePnpIrp() failed! (Status 0x%lx)\n", Status);
return FALSE; return FALSE;
} }
@ -1337,8 +1334,8 @@ VideoPortRegisterBugcheckCallback(
IN PVOID Callback, IN PVOID Callback,
IN ULONG BugcheckDataSize) IN ULONG BugcheckDataSize)
{ {
DPRINT1("VideoPortRegisterBugcheckCallback(): Unimplemented.\n"); UNIMPLEMENTED;
return NO_ERROR; return NO_ERROR;
} }
/* /*
@ -1352,7 +1349,7 @@ VideoPortQueryPerformanceCounter(
{ {
LARGE_INTEGER Result; LARGE_INTEGER Result;
DPRINT("VideoPortQueryPerformanceCounter\n"); TRACE_(VIDEOPRT, "VideoPortQueryPerformanceCounter\n");
Result = KeQueryPerformanceCounter((PLARGE_INTEGER)PerformanceFrequency); Result = KeQueryPerformanceCounter((PLARGE_INTEGER)PerformanceFrequency);
return Result.QuadPart; return Result.QuadPart;
} }
@ -1369,7 +1366,7 @@ VideoPortAcquireDeviceLock(
NTSTATUS Status; NTSTATUS Status;
(void)Status; (void)Status;
DPRINT("VideoPortAcquireDeviceLock\n"); TRACE_(VIDEOPRT, "VideoPortAcquireDeviceLock\n");
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
Status = KeWaitForMutexObject(&DeviceExtension->DeviceLock, Executive, Status = KeWaitForMutexObject(&DeviceExtension->DeviceLock, Executive,
KernelMode, FALSE, NULL); KernelMode, FALSE, NULL);
@ -1388,10 +1385,10 @@ VideoPortReleaseDeviceLock(
LONG Status; LONG Status;
(void)Status; (void)Status;
DPRINT("VideoPortReleaseDeviceLock\n"); TRACE_(VIDEOPRT, "VideoPortReleaseDeviceLock\n");
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
Status = KeReleaseMutex(&DeviceExtension->DeviceLock, FALSE); Status = KeReleaseMutex(&DeviceExtension->DeviceLock, FALSE);
//ASSERT(Status == 0); //ASSERT(Status == STATUS_SUCCESS);
} }
/* /*
@ -1403,7 +1400,7 @@ VpNotifyEaData(
IN PDEVICE_OBJECT DeviceObject, IN PDEVICE_OBJECT DeviceObject,
IN PVOID Data) IN PVOID Data)
{ {
DPRINT1("unimplemented VpNotifyEaData\n"); UNIMPLEMENTED;
} }
/* /*

View file

@ -33,22 +33,11 @@
#include <ndk/ntndk.h> #include <ndk/ntndk.h>
#include <reactos/helper.h> #include <reactos/helper.h>
#define NDEBUG
#include <debug.h> #include <debug.h>
#define TAG_VIDEO_PORT TAG('V', 'I', 'D', 'P') #define TAG_VIDEO_PORT TAG('V', 'I', 'D', 'P')
#define TAG_VIDEO_PORT_BUFFER TAG('V', 'p', 'm', '\0' ) #define TAG_VIDEO_PORT_BUFFER TAG('V', 'p', 'm', '\0' )
#define DPFLTR_IHVVIDEO_ID 80 /* FIXME */
/* ROS Internal. Please deprecate */
NTHALAPI
VOID
NTAPI
HalReleaseDisplayOwnership(
VOID
);
typedef struct _VIDEO_PORT_ADDRESS_MAPPING typedef struct _VIDEO_PORT_ADDRESS_MAPPING
{ {
LIST_ENTRY List; LIST_ENTRY List;