4 * Copyright (C) 2002, 2003, 2004 ReactOS Team
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28 IntInterfaceReference(PVOID Context
)
34 IntInterfaceDereference(PVOID Context
)
40 VideoPortQueryServices(
41 IN PVOID HwDeviceExtension
,
42 IN VIDEO_PORT_SERVICES ServicesType
,
43 IN OUT PINTERFACE Interface
)
45 TRACE_(VIDEOPRT
, "VideoPortQueryServices - ServicesType: 0x%x\n", ServicesType
);
49 case VideoPortServicesInt10
:
50 if (Interface
->Version
>= VIDEO_PORT_INT10_INTERFACE_VERSION_1
||
51 Interface
->Size
>= sizeof(VIDEO_PORT_INT10_INTERFACE
))
53 VIDEO_PORT_INT10_INTERFACE
*Int10Interface
=
54 (VIDEO_PORT_INT10_INTERFACE
*)Interface
;
56 Interface
->InterfaceReference
= IntInterfaceReference
;
57 Interface
->InterfaceDereference
= IntInterfaceDereference
;
58 Int10Interface
->Int10AllocateBuffer
= IntInt10AllocateBuffer
;
59 Int10Interface
->Int10FreeBuffer
= IntInt10FreeBuffer
;
60 Int10Interface
->Int10ReadMemory
= IntInt10ReadMemory
;
61 Int10Interface
->Int10WriteMemory
= IntInt10WriteMemory
;
62 Int10Interface
->Int10CallBios
= IntInt10CallBios
;
67 case VideoPortServicesAGP
:
68 if ((Interface
->Version
== VIDEO_PORT_AGP_INTERFACE_VERSION_2
&&
69 Interface
->Size
>= sizeof(VIDEO_PORT_AGP_INTERFACE_2
)) ||
70 (Interface
->Version
== VIDEO_PORT_AGP_INTERFACE_VERSION_1
&&
71 Interface
->Size
>= sizeof(VIDEO_PORT_AGP_INTERFACE
)))
73 if (NT_SUCCESS(IntAgpGetInterface(HwDeviceExtension
, Interface
)))
80 case VideoPortServicesI2C
:
82 return ERROR_INVALID_FUNCTION
;
84 case VideoPortServicesHeadless
:
86 return ERROR_INVALID_FUNCTION
;
92 return ERROR_INVALID_FUNCTION
;
96 VideoPortGetAgpServices(
97 IN PVOID HwDeviceExtension
,
98 OUT PVIDEO_PORT_AGP_SERVICES AgpServices
)
100 VIDEO_PORT_AGP_INTERFACE Interface
;
103 TRACE_(VIDEOPRT
, "VideoPortGetAgpServices\n");
105 Interface
.Size
= sizeof(Interface
);
106 Interface
.Version
= VIDEO_PORT_AGP_INTERFACE_VERSION_1
;
108 Status
= VideoPortQueryServices(HwDeviceExtension
, VideoPortServicesAGP
,
109 (PINTERFACE
)&Interface
);
110 if (Status
!= NO_ERROR
)
112 WARN_(VIDEOPRT
, "VideoPortQueryServices() failed!\n");
116 RtlCopyMemory(AgpServices
, &Interface
.AgpReservePhysical
, sizeof(VIDEO_PORT_AGP_SERVICES
));