Coder Social home page Coder Social logo

microsoft / graphics-driver-samples Goto Github PK

View Code? Open in Web Editor NEW
370.0 70.0 130.0 8.87 MB

This repository contains graphics driver samples used to demonstrate how to write graphics driver for the windows platform.

License: Other

C++ 91.72% C 6.39% Batchfile 0.08% PowerShell 0.01% Assembly 0.11% HLSL 0.54% GLSL 0.28% LLVM 0.13% Visual Basic .NET 0.75%

graphics-driver-samples's Introduction

Overview

This project is focused on providing Windows graphics driver samples.

The first sample being developed is a Windows graphics driver for the Raspberry Pi 2. This is a sample driver intended to demonstrate how to write a graphics driver for the Windows platform. The driver is a functioning graphics driver on the Raspberry Pi 2 but it is not a fully featured driver.

Work on the driver was started in August 2015.

Anyone wishing to contribute to this project should recognize that this project is managed by a team of professional developers and there is an expectation that all contributing members of community should be be polite, respectful and honest.

All code within this project is covered by the MIT license with Microsoft as the copyright holder.

If you wish to get involved in the project, please email [email protected] and include how you wish to contribute.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Sample Graphics Driver Status

The sample driver builds and installs on a raspberry pi 2 and supports a variety of operations. The driver is still in the early stages of development. The driver is capable of some basic D3D rendering including the ability to run a canonical demo application called Dolphin.

Note, due to limitations of the Raspberry Pi 2 the sample driver running on the Raspberry Pi 2 will never be able to fully support D3D and any usage of the driver must take into account the limitations of the driver and the underlying hardware.

Roles

##Project Coordinator

There is only one active project coordinator who oversees all aspects of the project. This role is currently filled by a development engineer at Microsoft.

##Microsoft Developer

Individual Microsoft developers contribute source to the project following the submission process outlined below without further review.

##Solo Developer

Individuals not part of Microsoft contribute source to the project following the submission process outlined below but those submissions will be reviewed by the Project Coordinator before inclusion in the project. It is highly recommended that solo developers work with the project coordinator prior to submission to ensure that their contributions are in aligned with the goals of the project, not already being addressed by other contributors and are likely to be accepted once the work is complete.

Support

There is currently no active support for how to use the sample driver beyond what is documented in the Wiki.

Contribution Process By Microsoft Developers

Every Microsoft developer is expected to ensure that the driver compiles (X64&ARM) and successfully passes both RosTest and BasicTests when run on both within a virtual machine (X64) and a Raspberry Pi 2 (ARM).

Contribution Process By Solo Developers

Solo developers can contribute to the project in various ways including implementing unassigned tasks within an area of the driver, extending the existing testing coverage and adding additional documentation which helps describe the existing drivers functionality.

All submissions by solo developers should be done via a pull request submission that includes a description of the change and for code changes the set of tests that were run.

If a part or all of a submission is rejected, a clear explaination will be provided to the contributor along with guidance on what issues if any can be addressed in order for the submission to be accepted.

The ISO C++ Core guidelines are a good read for anyone hoping to contribute to the project, as we are attempting to follow the bulk of the recommendations especially with respect to resource management. This project uses exceptions and therefore also uses RIAA.

graphics-driver-samples's People

Contributors

barthouse avatar bhouse-microsoft avatar hideyukn88 avatar indygit avatar iotdan avatar jeffwick-msft avatar jordanrh1 avatar marekkedzierski avatar matangpanchal avatar microsoft-github-policy-service[bot] avatar msftgits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graphics-driver-samples's Issues

Access violation in rosumd!RosUmdResource::Form1kSubTileBlock

An access violation is seen in sihost.exe when IotShellExtension attemps to load the splash screen bitmap.

Repro steps:

  1. Copy over the stock IotShellExt.dll, not the one in render-only-sample/scripts

  2. Enable initial breakpoint in windbg (ctrl+alt+k)

  3. Boot machine. When initial breakpoint is hit, run the following windbg commands to enable break on usermode exceptions

    sxe eh
    sxe av
    !gflag +sue
    !gflag +soe
    

Resume booting (hit 'g'). The following access violation will occur

Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
VCRUNTIME140D!__memcpy_forward_large_neon+0x30:
752b1430 680c     ldr         r4,[r1]

1: kd> r
r0=01b80000  r1=00d55ae0  r2=00000008  r3=01b80000  r4=75427345  r5=00307010
r6=0008e800  r7=0008dd50  r8=002abc7c  r9=00307100 r10=002ac838 r11=0008dc60
r12=752c5004  sp=0008dc58  lr=754297c1  pc=752b1430 psr=20000030 --C-- Thumb
VCRUNTIME140D!__memcpy_forward_large_neon+0x30:
752b1430 680c     ldr         r4,[r1]                         00d55ae0=????????

1: kd> k
00 0008dca0 754298d4 rosumd!RosUmdResource::Form1kSubTileBlock [d:\workspace\graphics-driver-samples\render-only-sample\rosumd\rosumdresource.cpp @ 484]
01 0008dca0 75429748 rosumd!RosUmdResource::Form4kTileBlock+0xf0 [d:\workspace\graphics-driver-samples\render-only-sample\rosumd\rosumdresource.cpp @ 563]
02 0008dce0 75423c64 rosumd!RosUmdResource::ConvertBitmapTo4kTileBlocks+0xd4 [d:\workspace\graphics-driver-samples\render-only-sample\rosumd\rosumdresource.cpp @ 596]
03 0008dd28 75427372 rosumd!RosUmdDevice::CreateResource+0x3b0 [d:\workspace\graphics-driver-samples\render-only-sample\rosumd\rosumddevice.cpp @ 336]
04 0008de90 76016b3a rosumd!RosUmdDeviceDdi::DdiCreateResource+0x2e [d:\workspace\graphics-driver-samples\render-only-sample\rosumd\rosumddeviceddi.cpp @ 249]
[private symbols redacted]

getting graphics driver to install properly

I am trying to get the render only graphics sample project (development included some MS engineers), located here:
https://github.com/Microsoft/graphics-driver-samples/tree/master/render-only-sample
to work correctly. Does anybody here have experience with it? I followed the instructions here:
0b51c4f#diff-f2f6e5599ebefd9a87207862dce0e7b4
or
here:
https://github.com/Microsoft/graphics-driver-samples/wiki/Install-Driver-in-a-Windows-VM
but get the same result: after using devcon to install the driver which it reports it did successfully. When I checked the device in device manager, it reports device did not start and error code 31. The error status is: not_supported and when I look in: \windows\inf\setupapi.dev the render only sample device reports:
!!! dvi: Device not started: Device has problem: 0x1f (CM_PROB_FAILED_ADD), problem status: 0xc00000bb.
When kernel debugging it on boot I see that the addadapter function is called and no errors appear, and very shortly afterward the remove adaprter is called. Also, testsigning is on, and the binaries and cat file are signed and there is no errors reported about signing issues in the setupapi.dev. which there usually is if there is a signing issue. I can post the whole log if someone is interested.
Anybody have an idea what the problem could be? (The projects contributers include MS engineers so I hoped that one of them may read this)
thanks for any assistance

Implement raspberry pi specific resource size calculations

This work will need to get done with each release where we add additional format support.

We should review the size calculations that are being done for R0 and verify that this is work is complete for R0 and then move the work item to R1.

Implement basic validation of command submission to hardware on raspberry pi

This test should submit a GPU operation upon receiving a DMA command buffer submission. The driver should be notified by hardware when the GPU operation is completed. Upon notification of GPU command completion, the driver should notify DXGKrnl of the DMA command buffer completion as appropriate.

Ideally, the GPU operation should be some very trivial operation (such as a NOP command submission).

This should be the first step towards handling an actual GPU submission.

Design and implement hardware abstraction layer

This was partially done. We are still working out whether we will split the driver into a software only driver and the raspberry pi driver. When this decision is made, we will revisit this work.

Shader compiler support for Dolphin

The dolphin demo will require byte code support.

This includes support for instructions madd, maddot3, maddot 4. General (non 1.0) w support. Suport for the modifiers neg, abs, negabs.

Hideyuki is in the process of adding this support now.

How to use this ?

Hey Senior Programmers,
I am not sure , if this is the right place to discuss this or not, please forgive if I am wrong somewhere.

I build this drivers and installed on raspberry pi 2 as per the instructions given on wiki page.
Then I deployed my app with some storyboard animation like scale, translate , fade animations , but not able to see any difference yet.
Should I see any difference in my above scenerio ? or this Drivers are ment for something else ?
If this is for my purpose , how can I take advantage of this ?

Please guide me.

Regards,
Matang

SetScissorRects support needs to be expanded

Further support for SetScissorRects needs to be implemented in the Raspberry Pi driver in order to support Windows Shell (SIHost). Currently, the assert in RosUmdDevice::SetScissorRects is being hit with parameters:

ClearScissorRects = 0x10 = all clear.

and

NumScissorRects = 1
ClearScissorRects = 0xf

Implement raspberry pi cubemap texture

This involves:

  1. Change RosUmdDevice::CreateResource to allocate memory correctly for cubemap texture
  2. Change shader compiler and RosUmdDevice::WriteUniforms() to properly set up Texture Config Parameters 2 and 3 (VC4 spec Section 4, Table 17)
  3. Make sure the cubemap are correctly sampled.

Using the second GPU block for geometry shaders and such

In the VC4 design, there is two completely separate GPUs. The VPU is a full-featured CPU with 16way SIMD extensions(the SIMD extensions can be used for 8,16 and 32-bit values processing) and is dual-core with SMP enabled(and start.elf runs fully on the VPU). The QPU is what you use actually. The VPU is quite powerful.
https://github.com/hermanhermitage/videocoreiv/wiki/VideoCore-IV-Performance-Considerations , https://github.com/hermanhermitage/videocoreiv/wiki/VideoCore-IV-Kernels-under-Linux . The ISA have been reverse-engineered in the https://github.com/hermanhermitage/videocoreiv/wiki/VideoCore-IV-Programmers-Manual .

VideoCore IV shader compiler optimization

This is bucket work item has to be breakdown to smaller real items once direction is finalized, and forked "optimized_compiler" branch to be used for work.

As many might noticed, today’s shader compiler is not really “compiler”, but more like just “translator” from HLSL to QPU instructions for quick ramp up and scoped purpose, thus outcome is not really optimized to VC4/QPU architecture.

At "optimized_compiler" branch, we can look into …

• High IR or possible LLVM
• Architecture specific IR
• Dynamic register (accumulator/register file) assignment
• Dependency based dead code removal and reordering
• Optimized to add/mul simultaneous pipeline
• Reduce duplicated constant access
• and more.

And all contributor are welcomed to have discussion/proposal here.

KeInvalidateAllCaches() alternative for ARM64

The driver can't be compiled on ARM64 because of the missing KeInvalidateAllCaches().
Can someone provide an alternative using KeInvalidateRangeAllCaches() ?

File: RosKmdRapAdapter.cpp, line 445

Crash on RP3 windows startup

Hey,

I've tried running driver + dolphin app on Windows 10 IoT 14931 Insider Preview on RP3 using both Debug and Release builds and Windows is always crashing during startup.

I've been following steps on how to install driver from Wiki and this is what I'm doing:

  1. Get latest on driver code, build it for ARM
  2. Install driver package on RP3 running W10 using devcon. Installation is succesful according to log: "Driver package 'oem0.inf' added"
  3. Set driver to render-only mode by changing registry keys (it doesn't seem to matter to the result)
  4. Install Dolphin App Package using Device Panel and set it to default app on startup.
  5. Copy iotshell.exe to system32 directory.
  6. Perform shutdown /r /t 0
    Result: Windows crashes on first boot after installing driver.

Dolphin app works on Basic Driver that is supplied with W10 IoT.

My question is, is that a known issue with latest code, rp3 and/or W10 build that I'm using? Is there any step that I'm missing to get it to work?

Any help would be appreciated.

Thanks

Implement raspberry pi tiled texture

  1. At resource creation time, load the linear initial data into the GPU memory in tiled format (VC4 spec Section 11)
  2. Make sure the texture sampling continues to work
  3. We can start with the R8G8B8A8 and then move onto other formats.

Present failure from sihost

Windows Shell (SIHost)'s attempt to Present results in a failure, which then leads to a fast fail exception on the app side. This Present failure needs to be root caused.

Constant buffer remapping

The constant buffer must be laid out to conform to how the constants will be read by the shader(s).

The work to provide the layout by the shaders has been done. The driver now must consume the shader layout and compose the constant buffer placing the composed buffer inline with the command buffer for consumption by the shader at execution.

Wiki improvements

Have the wiki pages hosted within the repository. Link the home page appropriately to underlying pages.

Project Status

Clearly this project stalled. What is the status and is microsoft planning to spend any more development time on this project? The Windows on RPI project has really advanced the usability of rPI as a windows desktop. This driver would vastly improve the project.

How wddm registers interrupts

I want to know how the wddm interrupt is registered. In this sample, I don't see the place where the interrupt is registered. I only see the enable and disable interrupt, and the interrupt processing. I guess whether the wddm interrupt is done for us by windows dxgkrnl , the process I guess is to add the interrupt information to the dsdt table in uefi, after windows dxgkrnl obtains the dsdt table, it registers the interrupt by itself, and registers the DxgkDdiInterruptRoutine function as a callback function, and the mini port driver is only responsible for enable and close and process interrupt, Not sure if my assumption is right, can someone tell me the answer?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.