mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 02:15:47 +00:00
- Fix broken VideoPortSignalDmaComplete definition
- Cleanup and reformat dma.c and add missing functions (not yet exported) svn path=/trunk/; revision=35009
This commit is contained in:
parent
6a23266635
commit
0ebeef15a1
2 changed files with 235 additions and 104 deletions
|
@ -1,143 +1,274 @@
|
||||||
/*
|
/*
|
||||||
* VideoPort driver
|
* PROJECT: ReactOS Videoport
|
||||||
*
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* Copyright (C) 2002, 2003, 2004 ReactOS Team
|
* FILE: drivers/video/videoprt/dma.c
|
||||||
*
|
* PURPOSE: Videoport Direct Memory Access Support
|
||||||
* This library is free software; you can redistribute it and/or
|
* PROGRAMMERS: ...
|
||||||
* modify it under the terms of the GNU Library General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Library General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Library General Public
|
|
||||||
* License along with this library; see the file COPYING.LIB.
|
|
||||||
* If not, write to the Free Software Foundation,
|
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "videoprt.h"
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
|
#include <videoprt.h>
|
||||||
|
#define NDEBUG
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
/* PUBLIC FUNCTIONS ***********************************************************/
|
/* PUBLIC FUNCTIONS ***********************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
PVOID
|
||||||
PVOID NTAPI
|
NTAPI
|
||||||
VideoPortAllocateCommonBuffer(
|
VideoPortAllocateCommonBuffer(IN PVOID HwDeviceExtension,
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVP_DMA_ADAPTER VpDmaAdapter,
|
||||||
IN PVP_DMA_ADAPTER VpDmaAdapter,
|
IN ULONG DesiredLength,
|
||||||
IN ULONG DesiredLength,
|
OUT PPHYSICAL_ADDRESS LogicalAddress,
|
||||||
OUT PPHYSICAL_ADDRESS LogicalAddress,
|
IN BOOLEAN CacheEnabled,
|
||||||
IN BOOLEAN CacheEnabled,
|
PVOID Reserved)
|
||||||
PVOID Reserved)
|
|
||||||
{
|
{
|
||||||
return HalAllocateCommonBuffer(
|
/* Forward to HAL */
|
||||||
(PADAPTER_OBJECT)VpDmaAdapter,
|
return HalAllocateCommonBuffer((PADAPTER_OBJECT)VpDmaAdapter,
|
||||||
DesiredLength,
|
DesiredLength,
|
||||||
LogicalAddress,
|
LogicalAddress,
|
||||||
CacheEnabled);
|
CacheEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
VOID
|
||||||
VOID NTAPI
|
NTAPI
|
||||||
VideoPortReleaseCommonBuffer(
|
VideoPortReleaseCommonBuffer(IN PVOID HwDeviceExtension,
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVP_DMA_ADAPTER VpDmaAdapter,
|
||||||
IN PVP_DMA_ADAPTER VpDmaAdapter,
|
IN ULONG Length,
|
||||||
IN ULONG Length,
|
IN PHYSICAL_ADDRESS LogicalAddress,
|
||||||
IN PHYSICAL_ADDRESS LogicalAddress,
|
IN PVOID VirtualAddress,
|
||||||
IN PVOID VirtualAddress,
|
IN BOOLEAN CacheEnabled)
|
||||||
IN BOOLEAN CacheEnabled)
|
|
||||||
{
|
{
|
||||||
HalFreeCommonBuffer(
|
/* Forward to HAL */
|
||||||
(PADAPTER_OBJECT)VpDmaAdapter,
|
HalFreeCommonBuffer((PADAPTER_OBJECT)VpDmaAdapter,
|
||||||
Length,
|
Length,
|
||||||
LogicalAddress,
|
LogicalAddress,
|
||||||
VirtualAddress,
|
VirtualAddress,
|
||||||
CacheEnabled);
|
CacheEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
VOID
|
||||||
VOID NTAPI
|
NTAPI
|
||||||
VideoPortPutDmaAdapter(
|
VideoPortPutDmaAdapter(IN PVOID HwDeviceExtension,
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVP_DMA_ADAPTER VpDmaAdapter)
|
||||||
IN PVP_DMA_ADAPTER VpDmaAdapter)
|
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
PVP_DMA_ADAPTER
|
||||||
PVP_DMA_ADAPTER NTAPI
|
NTAPI
|
||||||
VideoPortGetDmaAdapter(
|
VideoPortGetDmaAdapter(IN PVOID HwDeviceExtension,
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVP_DEVICE_DESCRIPTION VpDeviceExtension)
|
||||||
IN PVP_DEVICE_DESCRIPTION VpDeviceExtension)
|
|
||||||
{
|
{
|
||||||
DEVICE_DESCRIPTION DeviceDescription;
|
DEVICE_DESCRIPTION DeviceDescription;
|
||||||
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
|
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
|
||||||
ULONG NumberOfMapRegisters;
|
ULONG NumberOfMapRegisters;
|
||||||
PVP_DMA_ADAPTER Adapter;
|
|
||||||
|
|
||||||
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
|
/* Zero the structure */
|
||||||
|
RtlZeroMemory(&DeviceDescription,
|
||||||
|
sizeof(DEVICE_DESCRIPTION));
|
||||||
|
|
||||||
TRACE_(VIDEOPRT, "VideoPortGetDmaAdapter\n");
|
/* Initialize the structure */
|
||||||
|
DeviceDescription.Version = DEVICE_DESCRIPTION_VERSION;
|
||||||
|
DeviceDescription.Master = TRUE /* ?? */;
|
||||||
|
DeviceDescription.DmaWidth = Width8Bits;
|
||||||
|
DeviceDescription.DmaSpeed = Compatible;
|
||||||
|
|
||||||
DeviceDescription.Version = DEVICE_DESCRIPTION_VERSION;
|
/* Copy data from caller's device extension */
|
||||||
DeviceDescription.Master = TRUE /* ?? */;
|
DeviceDescription.ScatterGather = VpDeviceExtension->ScatterGather;
|
||||||
DeviceDescription.ScatterGather = VpDeviceExtension->ScatterGather;
|
DeviceDescription.Dma32BitAddresses = VpDeviceExtension->Dma32BitAddresses;
|
||||||
DeviceDescription.DemandMode = FALSE /* ?? */;
|
DeviceDescription.Dma64BitAddresses = VpDeviceExtension->Dma64BitAddresses;
|
||||||
DeviceDescription.AutoInitialize = FALSE /* ?? */;
|
DeviceDescription.MaximumLength = VpDeviceExtension->MaximumLength;
|
||||||
DeviceDescription.Dma32BitAddresses = VpDeviceExtension->Dma32BitAddresses;
|
|
||||||
DeviceDescription.IgnoreCount = FALSE /* ?? */;
|
|
||||||
DeviceDescription.Reserved1 = FALSE;
|
|
||||||
DeviceDescription.BusNumber = DeviceExtension->SystemIoBusNumber;
|
|
||||||
DeviceDescription.DmaChannel = 0 /* ?? */;
|
|
||||||
DeviceDescription.InterfaceType = DeviceExtension->AdapterInterfaceType;
|
|
||||||
DeviceDescription.DmaWidth = Width8Bits;
|
|
||||||
DeviceDescription.DmaSpeed = Compatible;
|
|
||||||
DeviceDescription.MaximumLength = VpDeviceExtension->MaximumLength;
|
|
||||||
DeviceDescription.DmaPort = 0;
|
|
||||||
|
|
||||||
Adapter =
|
/* Copy data from the internal device extension */
|
||||||
(PVP_DMA_ADAPTER)HalGetAdapter(&DeviceDescription, &NumberOfMapRegisters);
|
DeviceDescription.BusNumber = DeviceExtension->SystemIoBusNumber;
|
||||||
INFO_(VIDEOPRT, "Adapter %p\n", Adapter);
|
DeviceDescription.InterfaceType = DeviceExtension->AdapterInterfaceType;
|
||||||
return(Adapter);
|
|
||||||
|
return (PVP_DMA_ADAPTER)HalGetAdapter(&DeviceDescription,
|
||||||
|
&NumberOfMapRegisters);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
VOID NTAPI
|
VOID
|
||||||
VideoPortFreeCommonBuffer( IN PVOID HwDeviceExtension,
|
NTAPI
|
||||||
IN ULONG Length,
|
VideoPortFreeCommonBuffer(IN PVOID HwDeviceExtension,
|
||||||
IN PVOID VirtualAddress,
|
IN ULONG Length,
|
||||||
IN PHYSICAL_ADDRESS LogicalAddress,
|
IN PVOID VirtualAddress,
|
||||||
IN BOOLEAN CacheEnabled)
|
IN PHYSICAL_ADDRESS LogicalAddress,
|
||||||
|
IN BOOLEAN CacheEnabled)
|
||||||
{
|
{
|
||||||
DEVICE_DESCRIPTION DeviceDescription;
|
DEVICE_DESCRIPTION DeviceDescription;
|
||||||
PVP_DMA_ADAPTER VpDmaAdapter;
|
PVP_DMA_ADAPTER VpDmaAdapter;
|
||||||
|
|
||||||
VpDmaAdapter = VideoPortGetDmaAdapter(
|
/* FIXME: Broken code*/
|
||||||
HwDeviceExtension,
|
VpDmaAdapter = VideoPortGetDmaAdapter(HwDeviceExtension,
|
||||||
(PVP_DEVICE_DESCRIPTION)&DeviceDescription);
|
(PVP_DEVICE_DESCRIPTION)&DeviceDescription);
|
||||||
|
HalFreeCommonBuffer((PADAPTER_OBJECT)VpDmaAdapter,
|
||||||
HalFreeCommonBuffer(
|
Length,
|
||||||
(PADAPTER_OBJECT)VpDmaAdapter,
|
LogicalAddress,
|
||||||
Length,
|
VirtualAddress,
|
||||||
LogicalAddress,
|
CacheEnabled);
|
||||||
VirtualAddress,
|
}
|
||||||
CacheEnabled);
|
|
||||||
|
/*
|
||||||
|
* @unimplemented
|
||||||
|
*/
|
||||||
|
PVOID
|
||||||
|
NTAPI
|
||||||
|
VideoPortGetCommonBuffer(IN PVOID HwDeviceExtension,
|
||||||
|
IN ULONG DesiredLength,
|
||||||
|
IN ULONG Alignment,
|
||||||
|
OUT PPHYSICAL_ADDRESS LogicalAddress,
|
||||||
|
OUT PULONG pActualLength,
|
||||||
|
IN BOOLEAN CacheEnabled)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
VideoPortUnmapDmaMemory(
|
||||||
|
PVOID HwDeviceExtension,
|
||||||
|
PVOID VirtualAddress,
|
||||||
|
HANDLE ProcessHandle,
|
||||||
|
PDMA BoardMemoryHandle)
|
||||||
|
{
|
||||||
|
/* Deprecated */
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
PDMA
|
||||||
|
NTAPI
|
||||||
|
VideoPortMapDmaMemory(IN PVOID HwDeviceExtension,
|
||||||
|
IN PVIDEO_REQUEST_PACKET pVrp,
|
||||||
|
IN PHYSICAL_ADDRESS BoardAddress,
|
||||||
|
IN PULONG Length,
|
||||||
|
IN PULONG InIoSpace,
|
||||||
|
IN PVOID MappedUserEvent,
|
||||||
|
IN PVOID DisplayDriverEvent,
|
||||||
|
IN OUT PVOID *VirtualAddress)
|
||||||
|
{
|
||||||
|
/* Deprecated */
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
VideoPortSetDmaContext(IN PVOID HwDeviceExtension,
|
||||||
|
OUT PDMA pDma,
|
||||||
|
IN PVOID InstanceContext)
|
||||||
|
{
|
||||||
|
/* Deprecated */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
VideoPortSignalDmaComplete(IN PVOID HwDeviceExtension,
|
||||||
|
IN PDMA pDmaHandle)
|
||||||
|
{
|
||||||
|
/* Deprecated */
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @unimplemented
|
||||||
|
*/
|
||||||
|
VP_STATUS
|
||||||
|
NTAPI
|
||||||
|
VideoPortStartDma(IN PVOID HwDeviceExtension,
|
||||||
|
IN PVP_DMA_ADAPTER VpDmaAdapter,
|
||||||
|
IN PVOID Mdl,
|
||||||
|
IN ULONG Offset,
|
||||||
|
IN OUT PULONG pLength,
|
||||||
|
IN PEXECUTE_DMA ExecuteDmaRoutine,
|
||||||
|
IN PVOID Context,
|
||||||
|
IN BOOLEAN WriteToDevice)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
|
||||||
|
/* Lie and return success */
|
||||||
|
return NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
PVOID
|
||||||
|
NTAPI
|
||||||
|
VideoPortGetDmaContext(IN PVOID HwDeviceExtension,
|
||||||
|
IN PDMA pDma)
|
||||||
|
{
|
||||||
|
/* Deprecated */
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
PDMA
|
||||||
|
NTAPI
|
||||||
|
VideoPortDoDma(IN PVOID HwDeviceExtension,
|
||||||
|
IN PDMA pDma,
|
||||||
|
IN DMA_FLAGS DmaFlags)
|
||||||
|
{
|
||||||
|
/* Deprecated */
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @unimplemented
|
||||||
|
*/
|
||||||
|
PDMA
|
||||||
|
NTAPI
|
||||||
|
VideoPortAssociateEventsWithDmaHandle(IN PVOID HwDeviceExtension,
|
||||||
|
IN OUT PVIDEO_REQUEST_PACKET pVrp,
|
||||||
|
IN PVOID MappedUserEvent,
|
||||||
|
IN PVOID DisplayDriverEvent)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @unimplemented
|
||||||
|
*/
|
||||||
|
VP_STATUS
|
||||||
|
NTAPI
|
||||||
|
VideoPortCompleteDma(IN PVOID HwDeviceExtension,
|
||||||
|
IN PVP_DMA_ADAPTER VpDmaAdapter,
|
||||||
|
IN PVP_SCATTER_GATHER_LIST VpScatterGather,
|
||||||
|
IN BOOLEAN WriteToDevice)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
|
||||||
|
/* Lie and return success */
|
||||||
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1348,7 +1348,7 @@ BOOLEAN
|
||||||
DDKAPI
|
DDKAPI
|
||||||
VideoPortSignalDmaComplete(
|
VideoPortSignalDmaComplete(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN PVOID pDmaHandle);
|
IN PDMA pDmaHandle);
|
||||||
|
|
||||||
VPAPI
|
VPAPI
|
||||||
VOID
|
VOID
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue