Commit graph

93 commits

Author SHA1 Message Date
Serge Gautherie 889b077b23
[REACTOS] *.spec: Fix some function/parameter types (#3154) 2020-09-20 19:21:11 +02:00
Dmitry Borisov 0dfc7f06b7
[VIDEOPRT] Add global variable for debugging video drivers (#3080)
Reference: https://docs.microsoft.com/en-us/previous-versions/ff570170(v=vs.85)
2020-09-15 15:24:42 +03:00
Stanislav Motylkov 2a77e359e4
[XBOX] Move NV2A XGPU definitions into header file
TODO: helper functions should be also moved. CORE-16216
2020-08-26 16:58:01 +03:00
Dmitry Borisov 27cd9eaf1a
[PC98VID] Add framebuffer video miniport driver for NEC PC-98 series (#3040)
This adds generic graphics support on PC-9821.
2020-08-19 00:50:08 +03:00
Serge Gautherie fb023adf5a
[VIDEOPRT] IntVideoPortCreateAdapterDeviceObject(): 1+1 trivial fixes
Detected by Cppcheck: funcArgOrderDifferent, redundantAssignment.
2020-06-18 10:31:27 +02:00
Amine Khaldi 139a3d6661
[CMAKE] Implement PCH builds with target_precompile_headers. CORE-16905 2020-06-06 21:58:41 +03:00
Stanislav Motylkov f87a695b35
[XBOXVMP] Work with Xbox GPU registers properly
Bug was noticed with GCC 8.4
2020-05-02 23:24:36 +03:00
Victor Perevertkin 019f21ee1d
[MEDIA][CMAKE] Create add_driver_inf cmake function
*.inf files for drivers can now be placed along with the driver code
2020-04-26 20:28:04 +03:00
Timo Kreuzer b82bf8ce16
[NTOS:IO] Fix parsing of resource lists
Also add a hack to avoid failing on now occurring resource conflict detection and try to fix at least one resource in ACPI hal.

CORE-10146
CORE-12892
2020-04-24 13:58:09 +03:00
Hervé Poussineau 340d9360c3 [VIDEOPRT] Workaround bug CORE-16695 (infinite loop when reading EDID on LiveCD in QEMU)
For some reason, we don't get valid EDIDs when using LiveCD on QEMU.
We ignore them, and try to read the one of the next child.
This leads to a infinite loop and then, an out of memory error.

As it can also happen in other circonstances, stop enumeration as soon
as an invalid EDID is detected.

This breaks configurations with graphic cards with 2+ outputs, where
the first one is not plugged to a monitor, and the second one is plugged
to a monitor.

CORE-16695
2020-03-01 10:12:13 +01:00
Stanislav Motylkov afdb42023c [FREELDR][XBOXVMP] Check only low 28 bits for framebuffer address (#2249)
Fixes framebuffer detection on real hardware Xbox.
2020-01-14 20:20:22 +01:00
Hermès Bélusca-Maïto 0fe71544d2
[VIDEOPRT] Complete dispatch IOCTL with IO_VIDEO_INCREMENT priority boost. 2019-12-24 18:34:19 +01:00
Hermès Bélusca-Maïto 18a51dc7f5
[VIDEOPRT][WIN32K] Use a Windows-compatible way of communicating the 'BaseVideo' state from VIDEOPRT to WIN32K.
This is done by creating the volatile key
\Registry\Machine\System\CurrentControlSet\Control\GraphicsDrivers\BaseVideo .

Also cache during first initialization of VIDEOPRT the state of the boot
options BASEVIDEO and NOVESA, so that they can be readily retrieved later
(for example, in VideoPortIsNoVesa()).
2019-12-24 13:51:20 +01:00
Serge Gautherie cfdd483c0e [VGA_NEW] Fix 2 'MAX_USHORT' typos in commented code (#2145) 2019-12-10 13:17:17 +01:00
Hermès Bélusca-Maïto 4431418999
[VIDEOPRT] Protect access to HwResetAdaptersList with spinlock. 2019-12-03 02:46:38 +01:00
Hermès Bélusca-Maïto 0ad65796bb
[WIN32K][VIDEOPRT] Improve initialization and interfacing with INBV.
CORE-12149

VIDEOPRT:
=========

Improve interfacing with INBV, so as to detect when an external module
acquired INBV display ownership, and whether ownership is being released
later on. (This does NOT rely on hooking!)

For this purpose we improve the IntVideoPortResetDisplayParameters(Ex)
callback that gets registered with an InbvNotifyDisplayOwnershipLost()
call during initialization, and we add a monitoring thread.

The callback is called whenever an external module calls
InbvAcquireDisplayOwnership(), for example the bugcheck code or the KDBG
debugger in SCREEN mode. When this happens, a flag that tells the
monitoring thread to start monitoring INBV is set (ReactOS-specific),
and the display adapters get reset with HwResetHw() (as done on Windows).

Due to the fact that this INBV callback can be called at *ANY* IRQL, we
cannot use dispatcher synchronization mechanisms such as events to tell
the INBV monitoring thread to start its operations, so we need to rely
instead on a flag to be set. And, since INBV doesn't provide with any
proper callback/notification system either, we need to actively monitor
its state by pooling. To reduce the load on the system the monitoring
thread performs 1-second waits between each check for the flag set by
the INBV callback, and during checking the INBV ownership status.

When the INBV ownership is detected to be released by an external module,
the INBV callback is re-registered (this is *MANDATORY* since the
external module has called InbvNotifyDisplayOwnershipLost() with a
different callback parameter!), and then we callout to Win32k for
re-enabling the display.

This has the virtue of correctly resetting the display once the KDBG
debugger in SCREEN mode is being exited, and fixes CORE-12149 .

The following additional fixes were needed:

VIDEOPRT & WIN32K:
==================

Remove the registration with INBV that was previously done in a ReactOS-
specific hacked IRP_MJ_WRITE call; it is now done correctly during the
video device opening done by EngpRegisterGraphicsDevice() in the VIDEOPRT's
IRP_MJ_CREATE handler, as done on Windows.

WIN32K:
=======

- Stub the VideoPortCallout() support, for VIDEOPRT -> WIN32 callbacks.
  This function gets registered with VIDEOPRT through an
  IOCTL_VIDEO_INIT_WIN32K_CALLBACKS call in EngpRegisterGraphicsDevice().

- Only partially implement the 'VideoFindAdapterCallout' case, that just
  re-enables the primary display by refreshing it (using the new function
  UserRefreshDisplay()).

VIDEOPRT:
=========

- PVIDEO_WIN32K_CALLOUT is an NTAPI (stdcall) callback.

- In the IntVideoPortResetDisplayParameters(Ex) callback, reset all the
  "resettable" adapters registered in the HwResetAdaptersList list.
  We thus get rid of the global ResetDisplayParametersDeviceExtension.

- Make the IntVideoPortResetDisplayParameters(Ex) callback slightly more
  robust (using SEH) against potential HwResetListEntry list corruption
  or invalid DriverExtension->InitializationData.HwResetHw() that would
  otherwise trigger a BSOD, and this would be disastrous since that
  callback is precisely called when INBV is acquired, typically when the
  BSOD code initializes the display for displaying its information...

Extras:
- Validate the IrpStack->MajorFunction in IntVideoPortDispatchDeviceControl()
  and implement IRP_MJ_SHUTDOWN handling. Stub out the other IOCTLs that
  are handled by VIDEOPRT only (and not by the miniports).

- VIDEOPRT doesn't require IRP_MJ_INTERNAL_DEVICE_CONTROL (unused).

- Implement IOCTL_VIDEO_PREPARE_FOR_EARECOVERY that just resets the
  display to standard VGA 80x25 text mode.
2019-12-02 02:33:20 +01:00
Hermès Bélusca-Maïto 66909fa9d5
[VIDEOPRT] Implement VideoPortReadStateEvent(). 2019-11-25 00:41:53 +01:00
Hermès Bélusca-Maïto bf74f101c2
[VIDEOPRT] Use ExFreePoolWithTag() + Add some ASSERTs. 2019-11-25 00:41:53 +01:00
Hermès Bélusca-Maïto e930b868a0
[VIDEOPRT] Code formatting only. 2019-11-25 00:41:52 +01:00
Stanislav Motylkov 297abde716 [FREELDR][XBOXVMP] Retrieve screen resolution directly from NV2A GPU (#1962)
CORE-16216
2019-10-09 23:27:22 +02:00
Stanislav Motylkov b3301df570 [XBOXVMP] Fix broken pixels and general refactoring (#1896)
- Remove old hacky code based on MmHighestPhysicalPage.
- Split I2C SMBus code into a separate source file.

CORE-16216 CORE-16357
2019-10-08 17:08:44 +02:00
Stanislav Motylkov b54a38b8c0 [XBOXVMP] Improve debugging prints 2019-09-01 23:01:57 +02:00
Stanislav Motylkov 816149e0c3 [XBOXVMP] Code formatting only 2019-09-01 23:01:57 +02:00
Stanislav Motylkov 32fb2e7b5f [VIDEOPRT] Fix uninitialized Reserved bit field in PciSlotNumber
CORE-16317
2019-08-31 00:19:03 +02:00
Stanislav Motylkov 8c36145087 [XBOXVMP] Add Xbox video miniport driver
Also make XboxVmp driver compatible with Video Port driver, specify
vendor id and device id explicitly in VideoPortGetAccessRanges() call

CORE-16317
2019-08-31 00:19:03 +02:00
Victor Perevertkin 09abc443b1 [VIDEOPRT] Fix RtlCopyMemory sizeof usage
Spotted by GCC8
2019-08-20 15:05:47 +02:00
Timo Kreuzer 93028748c9 [VIDEOPRT] Fix order of some exports 2019-08-15 18:04:57 +02:00
Timo Kreuzer 7611cc2b12 [REACTOS] Fix SIZE_T related warnings 2019-08-15 14:20:00 +02:00
Timo Kreuzer 826704ba6b [VIDEOPRT] Implement support for INT10 on x64 using the newly implemented HAL functions. 2019-08-15 14:13:54 +02:00
Timo Kreuzer eba27d5856 [VIDEOPRT] Fixes for x64 2019-08-15 14:13:54 +02:00
Timo Kreuzer 832f8863be [VIDEOPRT] Call IntInt10CallBios from VideoPortInt10, instead of code duplication 2019-08-15 14:13:54 +02:00
Timo Kreuzer e7b3c66a42 [VIDEOPRT] [FORMATTING] No code change 2019-08-15 14:13:54 +02:00
Timo Kreuzer 08c6d21e1f [REACTOS] Fix warning C4146: unary minus operator applied to unsigned type, result still unsigned 2019-07-27 11:21:28 +02:00
Hermès Bélusca-Maïto 0f3f8b2a35
[VGA_NEW] Fix confusion between CRTC Controller and Graphics Controller registers. 2019-06-23 02:12:24 +02:00
Jérôme Gardou 23373acbb9 [CMAKE] Use modules instead of shared libraries
There is no need to compile our DLLs as shared libraries since we are
managing symbols exports and imports through spec files.

On my system, this reduces the configure-time by a factor of two.
2019-04-06 17:43:38 +02:00
Timo Kreuzer 72e43c4b33 [VGA_NEW] Fix 64 bit issues 2019-03-04 21:58:42 +01:00
Pierre Schweitzer 0996dac683
[VIDEOPRT] Don't return uninitialized memory 2019-02-20 21:02:11 +01:00
Timo Kreuzer cfd1647914
[REACTOS] Fix misc 64 bit issues (#783)
* [WIN32K] Fix handle calculation in DbgGdiHTIntegrityCheck
* [NOTEPAD] Fix MSVC warnings
* [PSDK] Simplify *PROC definitions in windef.h
* [VIDEOPRT] Don't try to use NtVdmControl on x64
* [FREELDR] Fix some macros
* [CRT] Make qsort 64 bit compatible
* [NTOS] Use #ifndef _WIN64 instead of #ifdef _M_IX86 around C_ASSERTs
* [FAST486] Fix 64 bit warnings and change DWORD to ULONG, so it can be used in kernel mode
* [APPHELP_APITEST] Fix 64 bit issue
2019-01-05 10:50:11 +01:00
Hermès Bélusca-Maïto 3f716870ca
[FRAMEBUF] Correctly check the return value of the EngDeviceIoControl() call and return adequate value in DrvAssertMode(). 2019-01-02 21:12:19 +01:00
Timo Kreuzer cf77354dce [REACTOS] Fix 64 bit issues 2018-08-04 19:19:34 +02:00
Serge Gautherie a0b5b47352 [WIN32SS:FRAMEBUF] Improve/Fix DrvSetPointerShape(), from r7864 (#457)
- Fix a copypasta.
- Remove dead code.

Thanks to mudhead, who spotted most of these.

NB:
This EXPERIMENTAL_MOUSE_CURSOR_SUPPORT code isn't compiled by default since r7865.

CORE-14511
2018-04-01 18:51:54 +02:00
Amine Khaldi a308735be6 [VGA] Correct VgaInterpretCmdStream() declaration. 2017-12-09 13:11:45 +01:00
Colin Finck c2c66aff7d Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00