2004-01-19 15:56:53 +00:00
|
|
|
/*
|
|
|
|
* VideoPort driver
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002, 2003, 2004 ReactOS Team
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2009-10-27 10:34:16 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
2004-01-19 15:56:53 +00:00
|
|
|
* License as published by the Free Software Foundation; either
|
2009-10-27 10:34:16 +00:00
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2004-01-19 15:56:53 +00:00
|
|
|
*
|
|
|
|
* 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
|
2009-10-27 10:34:16 +00:00
|
|
|
* Lesser General Public License for more details.
|
2004-01-19 15:56:53 +00:00
|
|
|
*
|
2009-10-27 10:34:16 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2004-01-19 15:56:53 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "videoprt.h"
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
VOID NTAPI
|
2004-01-19 15:56:53 +00:00
|
|
|
IntInterfaceReference(PVOID Context)
|
|
|
|
{
|
|
|
|
/* Do nothing */
|
|
|
|
}
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
VOID NTAPI
|
2004-01-19 15:56:53 +00:00
|
|
|
IntInterfaceDereference(PVOID Context)
|
|
|
|
{
|
|
|
|
/* Do nothing */
|
|
|
|
}
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
VP_STATUS NTAPI
|
2004-01-19 15:56:53 +00:00
|
|
|
VideoPortQueryServices(
|
|
|
|
IN PVOID HwDeviceExtension,
|
|
|
|
IN VIDEO_PORT_SERVICES ServicesType,
|
|
|
|
IN OUT PINTERFACE Interface)
|
|
|
|
{
|
2007-12-28 14:47:03 +00:00
|
|
|
TRACE_(VIDEOPRT, "VideoPortQueryServices - ServicesType: 0x%x\n", ServicesType);
|
2005-01-07 01:03:34 +00:00
|
|
|
|
2004-01-19 15:56:53 +00:00
|
|
|
switch (ServicesType)
|
|
|
|
{
|
2010-03-25 05:03:29 +00:00
|
|
|
#if defined(_M_IX86)
|
2004-01-19 15:56:53 +00:00
|
|
|
case VideoPortServicesInt10:
|
|
|
|
if (Interface->Version >= VIDEO_PORT_INT10_INTERFACE_VERSION_1 ||
|
|
|
|
Interface->Size >= sizeof(VIDEO_PORT_INT10_INTERFACE))
|
|
|
|
{
|
|
|
|
VIDEO_PORT_INT10_INTERFACE *Int10Interface =
|
|
|
|
(VIDEO_PORT_INT10_INTERFACE *)Interface;
|
|
|
|
|
|
|
|
Interface->InterfaceReference = IntInterfaceReference;
|
|
|
|
Interface->InterfaceDereference = IntInterfaceDereference;
|
|
|
|
Int10Interface->Int10AllocateBuffer = IntInt10AllocateBuffer;
|
|
|
|
Int10Interface->Int10FreeBuffer = IntInt10FreeBuffer;
|
|
|
|
Int10Interface->Int10ReadMemory = IntInt10ReadMemory;
|
|
|
|
Int10Interface->Int10WriteMemory = IntInt10WriteMemory;
|
|
|
|
Int10Interface->Int10CallBios = IntInt10CallBios;
|
2004-03-19 20:58:32 +00:00
|
|
|
return NO_ERROR;
|
2004-01-19 15:56:53 +00:00
|
|
|
}
|
|
|
|
break;
|
2010-03-25 05:03:29 +00:00
|
|
|
#endif
|
2004-01-19 15:56:53 +00:00
|
|
|
case VideoPortServicesAGP:
|
2005-01-07 01:03:34 +00:00
|
|
|
if ((Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_2 &&
|
|
|
|
Interface->Size >= sizeof(VIDEO_PORT_AGP_INTERFACE_2)) ||
|
|
|
|
(Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_1 &&
|
|
|
|
Interface->Size >= sizeof(VIDEO_PORT_AGP_INTERFACE)))
|
|
|
|
{
|
|
|
|
if (NT_SUCCESS(IntAgpGetInterface(HwDeviceExtension, Interface)))
|
|
|
|
{
|
|
|
|
return NO_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2004-01-19 15:56:53 +00:00
|
|
|
case VideoPortServicesI2C:
|
2007-12-28 14:47:03 +00:00
|
|
|
UNIMPLEMENTED;
|
2008-11-27 20:05:12 +00:00
|
|
|
return ERROR_INVALID_FUNCTION;
|
2007-12-28 14:47:03 +00:00
|
|
|
|
2004-01-19 15:56:53 +00:00
|
|
|
case VideoPortServicesHeadless:
|
2007-12-28 14:47:03 +00:00
|
|
|
UNIMPLEMENTED;
|
2008-11-27 20:05:12 +00:00
|
|
|
return ERROR_INVALID_FUNCTION;
|
2004-01-19 15:56:53 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2004-03-19 20:58:32 +00:00
|
|
|
return ERROR_INVALID_FUNCTION;
|
2004-01-19 15:56:53 +00:00
|
|
|
}
|
2004-03-06 08:39:06 +00:00
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
BOOLEAN NTAPI
|
2004-03-19 20:58:32 +00:00
|
|
|
VideoPortGetAgpServices(
|
|
|
|
IN PVOID HwDeviceExtension,
|
2005-01-07 01:03:34 +00:00
|
|
|
OUT PVIDEO_PORT_AGP_SERVICES AgpServices)
|
2004-03-06 08:39:06 +00:00
|
|
|
{
|
2005-01-07 01:03:34 +00:00
|
|
|
VIDEO_PORT_AGP_INTERFACE Interface;
|
|
|
|
VP_STATUS Status;
|
|
|
|
|
2007-12-28 14:47:03 +00:00
|
|
|
TRACE_(VIDEOPRT, "VideoPortGetAgpServices\n");
|
2005-01-07 01:03:34 +00:00
|
|
|
|
|
|
|
Interface.Size = sizeof(Interface);
|
|
|
|
Interface.Version = VIDEO_PORT_AGP_INTERFACE_VERSION_1;
|
|
|
|
|
|
|
|
Status = VideoPortQueryServices(HwDeviceExtension, VideoPortServicesAGP,
|
|
|
|
(PINTERFACE)&Interface);
|
|
|
|
if (Status != NO_ERROR)
|
|
|
|
{
|
2007-12-28 14:47:03 +00:00
|
|
|
WARN_(VIDEOPRT, "VideoPortQueryServices() failed!\n");
|
2005-01-07 01:03:34 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
RtlCopyMemory(AgpServices, &Interface.AgpReservePhysical, sizeof(AgpServices));
|
|
|
|
return TRUE;
|
2004-03-06 08:39:06 +00:00
|
|
|
}
|