summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-05-17drm_hwcomposer: Get KMS FD from gbm_grallocandroid-etnavivRobert Foss3-15/+35
Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-05-17drm_hwcomposer: Add gralloc perform method GRALLOC_MODULE_PERFORM_GET_DRM_FDRobert Foss1-0/+6
Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-04-10drm_hwcomposer: Use correct DRM event context versionDaniel Stone1-1/+1
Explicitly declare which DRM event context version we want to use, rather than just the latest one libdrm supports. New versions may change semantics, or extend the structure, in ways we're unaware of. Stick with version 2, which is the version that introduced page_flip_handler. Change-Id: I71e33f787b2b724596f8289d95311730f7aff8ff Signed-off-by: Daniel Stone <daniels@collabora.com>
2017-04-07HACK: Change the composition type of all layers to ClientTomeu Vizoso1-13/+2
2017-04-07HACK: Comment DPMS outTomeu Vizoso1-1/+1
2017-04-06Switch to gbm_gralloc repo instead of drm_grallocRob Herring1-1/+1
Change-Id: I13cb42e54e06492af14f964ee35c431044c378ae Signed-off-by: Rob Herring <robh@kernel.org>
2017-04-05Add explicit include of assert.hRob Herring1-0/+1
AOSP master broke as it seems an implicit include of assert.h got removed. Change-Id: If4e7ac035599c16071875862bf3d946bb385ba22 Signed-off-by: Rob Herring <robh@kernel.org>
2017-04-05HACK: Add HDMI connector as built-inRob Herring1-1/+2
Signed-off-by: Rob Herring <robh@kernel.org>
2017-04-05HACK: add rotation definesRob Herring1-0/+10
These should come from kernel headers
2017-03-24drm_hwcomposer: Remove vsyncworkerhwc2_fence_v4_vsyncworkerhwc2_fence_v4Robert Foss5-291/+41
Removes vsyncworker since it is no longer used. BUG=None TEST=make Change-Id: Iddfca031c88d39dc710980ba78f4cd5ebe9f0d7a Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-03-24drm_hwcomposer: Add support for VBlankHandler to DrmEventListenerRobert Foss3-22/+59
VBlankHandler is being introduced as an alternative to VSync callbacks, since the atomic API supports it better using the DRM_VBLANK_EVENT flag. BUG=None TEST=make Change-Id: Ib7e0cdbb576c10f00b587e618e973a037063f018 Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-03-22drm_hwcomposer: Removed Begin/EndContextRobert Foss2-40/+0
Functions are no longer used and can be removed. Change-Id: Ia917a95757c58269eeff810e21880236c346d983 Sign-off-by: Robert Foss <robert.foss@collabora.com>
2017-03-22drm_hwcomposer: Make GLWorkerCompositor a subclass of WorkerRobert Foss2-5/+83
Since compositions need to be executed on a seperate thread, make GLWorkerCompositor its own thread. Change-Id: I07a0fc7be1b549354158c6df4c5841ba8750c730 Sign-off-by: Robert Foss <robert.foss@collabora.com>
2017-03-22drm_hwcomposer: Add InitRoutine to WorkerRobert Foss4-0/+5
Due to Routine needing to be initialised seperately from the Init() call, provide a seperate init call to be run before Routine(). Change-Id: I0ea4f6105b0dbeeebb850859c5125e0535e55826 Sign-off-by: Robert Foss <robert.foss@collabora.com>
2017-03-22drm_hwcomposer: Provide internal version of glworker Commit()Robert Foss3-3/+21
In order to decouple Commit() calls from the issuing thread, provide the internal _Commit() call to be enable it to be run on its own thread. Change-Id: I0c4823c94d6555566cbf7edbb83e12d0aedaf772 Sign-off-by: Robert Foss <robert.foss@collabora.com>
2017-03-22drm_hwcomposer: Add HDMI connector as a valid typeRobert Foss3-4/+26
Accept DRM_MODE_CONNECTOR_HDMIA connector type. Look for primary DrmConnector amongst external connectors after looking for primary amongst internal ones first. Change-Id: I494bc5759cc699a83611374d3650d0c8625fedfb Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-03-22drm_hwcomposer: Fix invalid rotation valueRob Clark1-1/+3
Change-Id: If718d3eee03575e011ae5d13dc9088ed73fbeab6 Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-03-22drm_hwcomposer: Work around android fail with multiple modesRob Clark1-0/+5
When supplied with muliple modes, just select the first mode. Change-Id: I08cef186b4c08b9c5e993726b731f98929a2fb39 Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-03-22drm_hwcomposer: Track Cursor Layers/planes separatelyKalyan Kondapally6-6/+52
On IA platforms, we have a plane dedicated for Cursor. We should be using this to show cursor instead of an Overlay on IA platforms. This patch adds initial support to track Cursor layer and plane separately. BUG=None TEST=No Graphics regressions observed on Skylake platform. Change-Id: I800d0d5dda04be67cbab97272bd9723e6715a50d Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
2017-03-22drm_hwcomposer: Split FB creation and buffer importKalyan Kondapally8-4/+45
We currently import buffer for a given gralloc handle and also immediately create an FB for it. We may or may not end up using this buffer on a separate plane (layers could be squashed or need to fallback to GL composition). Hence, split this up and create FB for buffer only when we know that this is going to be used for scanout. We pass in plane_type which will be taken into use in future patches to determine the framebuffer formats to be used for Primary on IA. BUG=None TEST=No Graphics regressions observed on Skylake platform. Change-Id: I522b055ce6c989bdc04d48f2ad9b1791b31bceab Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
2017-03-22drm_hwcomposer: Add support for YUV to EGLImages importKalyan Kondapally6-25/+83
BUG=None TEST=Test Video works fine on Skylake. Change-Id: I43bedb095a19044d7c3c883c7fdde616461b8e50 Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
2017-03-22drm_hwcomposer: Add out-fence supportRobert Foss3-7/+27
Change-Id: I63f878efe2ac07f3a3d637cf08f1c220308182e8 Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-03-22drm_hwcomposer: Add GetCrtcCount functionRobert Foss2-0/+5
Change-Id: I93d7916805890a28bd649ac179478ac7b8ee6814 Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-03-22drm_hwcomposer: Add fence_out_ptr property to drmcrtcRobert Foss2-0/+12
Change-Id: I6892c1373ae735977a8f3ec5b67b8d1f748ac38c Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-03-22drm_hwcomposer: Submit in-fence to DRMRobert Foss1-19/+16
Add support for in-fences through the IN_FENCE_FD property. In-fences signal when their associated buffer may be read by DRM/KMS. BUG=None TEST=Tested on Qemu+drm_hwcomposer Change-Id: Iab76cf38fc7ce2472eefcdf49749009337f2e27a Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-03-22drm_hwcomposer: Add support for IN_FENCE_FD property to drmplaneRobert Foss2-0/+10
Add support for the IN_FENCE_FD property to DrmPlane. BUG=None TEST=Tested on Qemu+drm_hwcomposer Change-Id: I36b602879ea1ba2803f7a8c7f52e83e1f62f1c91 Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-03-22drm_hwcomposer: Remove threadingSean Paul17-1657/+90
Since HWC2 doesn't require the use of threads to implement correct synchronization, remove some of these threads. BUG=None TEST=Tested on Qemu+drm_hwcomposer Change-Id: Ia1cfb44648e0d85547cdff2e1a2f5e034bf5f110 Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-03-22drm_hwcomposer: Verify client_layer->buffer_ isn't nullRob Clark1-1/+1
BUG=None TEST=Tested on Qemu Change-Id: Ie5a639be456118006473244bb1b077d0f2a73669 Signed-off-by: Rob Clark <robdclark@gmail.com>
2017-03-22drm_hwcomposer: Change Cursor layer type to Device typeRob Clark1-1/+3
This works around an issue on db410c where the opacity of cursor layer cursor layer is handled incorrectly. Change-Id: Ie01c14bf66b30e9663f889b6dd471d00cd367a92
2017-03-20drm_hwcomposer: Add support for GetColorModes & SetCursorPositionKalyan Kondapally2-6/+15
For now we just return HAL_COLOR_MODE_NATIVE and store cursor position. Bug ID: #7 Test: None. Change-Id: Id6a7e157dbd9fc41fc53c0e33a6eb523632b9b7a Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
2017-03-20drm_hwcomposer: Partially implement HWC2 APISean Paul2-60/+831
Implement the HWC2 API for drm_hwcomposer. There are still a few TODOs sprinkled around, the biggest of which is virtual display support. Signed-off-by: Sean Paul <seanpaul@chromium.org> Change-Id: Ib3d48dabce1941b341d5a966d767baab8db1db10 Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-03-10drm_hwcomposer: Initial stub HWC2Sean Paul3-6/+589
This patch adds the HWC2 interface to drm_hwc, and stubs out all functionality. Change-Id: I65b09e7266e887dd184c0c345016d5a768f6349a Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-03-10drm_hwcomposer: Move eglCreateImageKHR into ImporterRob Clark8-13/+46
Since NV has a "special" nonstandard way to get an EGLImage from a handle, move this into Importer where the other NV specialness is abstracted. For the platformdrmgeneric case, use the dmabuf EGL Extension. Change-Id: I5353f4c95f55174df55ba92931cdc9a9eab80dca Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-02-28drm_hwcomposer: Move some utilities out of hwcomposer.cppSean Paul4-160/+205
There are some utility functions in hwcomposer.cpp that will be useful for hwc2. Move them into hwcutils.cpp so they can be used when hwcomposer.cpp is not compiled. Change-Id: I66a332e3e6afc4dc64217a528db50d5adbe02ef6 Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-02-28drm_hwcomposer: Remove source_damage from DrmHwcLayerSean Paul1-1/+0
We don't use it, so get rid of it. Change-Id: I63fc6bd06c0bfd4e7ad8315856e8f2372133624e Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-02-28drm_hwcomposer: Break out of sync_wait loop on successSean Paul1-1/+2
Don't call sync_wait kAcquireWaitTries times if it returns successfully. Change-Id: Iebdc2229966bfce4aaf35a07ef59aef405e301c6 Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-02-28drm_hwcomposer: Harvest min/max resolutions from drmSean Paul2-0/+16
Store the minimum and maximum resolutions from drm in DrmResources BUG=None TEST=None Change-Id: I21b9a3fc5f220585295733cc754fe0f6df0abae9 Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-02-28drm_hwcomposer: Don't pass hwc_procs_t to VsyncWorkerSean Paul3-13/+37
Introduce a new class to limit the hwc_procs_t callback structure scope to hwcomposer.cpp Change-Id: I68ec62e7947ca87702b3d6d0169ae850cfbf5d85 Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-02-28drm_hwcomposer: Clean up error conditionsSean Paul1-2/+6
Clean up error checking for some failure cases. BUG=None TEST=Tested on Qemu+drm_hwcomposer Change-Id: I98bca1aef09060b5a023375dce564252a6073b96 Signed-off-by: Robert Foss <robert.foss@collabora.com>
2017-02-20drm_hwcomposer: Add missing assert.h includeRobert Foss1-0/+1
drm_hwcomposer fails to compile on aosp/master due to assert.h not being included. This patch fixes this issue. BUG=None TEST=make Change-Id: Icb5d5d8a33c9898a5aefa00c1bdbf29965de62a7 Signed-off-by: Robert Foss <robert.foss@collabora.com>
2016-10-20drm_hwcomposer: fix type size check for separate rectsAdrian Salido1-1/+1
Bug: 32218819 Change-Id: Ic8f2c5d078a5ee9a48862a8e8faca051f199b78e Signed-off-by: Adrian Salido <salidoa@google.com>
2016-06-22drm_hwcomposer: Count all layers with content in SquashFrameSean Paul1-1/+1
SquashFrame previously didn't run if there was only one overlay layer in the layer stack. This would cause false failures when the incoming composition was composed of one or more layers with a precomposition or squash layer. To fix this, count all layers which are not disabled, and only skip squashing if there is just one content layer. BUG=b/29122961 TEST=Tested on smaug with vertical multi-window YouTube Change-Id: Icb175b7701928136730442a39c4717a780d34cfd Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-06-22drm_hwcomposer: On error, free active compositionSean Paul2-3/+24
If we drop a frame while compositing, free the active composition. Assume a frame pipeline of A->B->A. If we drop frame B, it will become the active composition, which means the fences for A will not be released, causing us to block A on A --> DEADLOCK. BUG=b/29122961 TEST=Tested on smaug, no longer hangs Change-Id: I98817bb361f1d0669395ddac5d96cf4f19d4b26a Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-05-16drm_hwcomposer: Use Planner interface to provision planesSean Paul7-172/+92
Use the new Planner interface to handle the layer->plane mapping. This allows us to simplify the Plan() function by offloading the plane provisioning to the platform specific code. BUG=b/28117135 TEST=Tested on ryu with a variety of window layouts/workloads Signed-off-by: Sean Paul <seanpaul@chromium.org> Change-Id: I75a0c5d87a9096e7a83ecbc848c75fee42ee1131
2016-05-16drm_hwcomposer: Introduce Planner interfaceSean Paul7-4/+401
This patch introduces a new Planner interface to the platform specific code. This new interface will allow for platform-specific plane provisioning decisions to cover various hardware quirks. Each platform must provide a Planner with one or more PlanStage steps. These stages are run in order and are used to move the given layers onto composition planes. There are two generic stages provided by the platform: - Protected: Places layers on dedicated planes - Greedy: Provisions as many layers to planes and sticks the rest in precomp There is also one platform-specific stage included: - ProtectedRotated: Places any protected & rotated layer on the primary plane BUG=b/28117135 TEST=Tested on ryu with a variety of window layouts Signed-off-by: Sean Paul <seanpaul@chromium.org> Change-Id: Ib6062ab4779166753afaf122450bb63126bf9161
2016-05-12drm_hwcomposer: Don't use Plan() in SquashAllSean Paul3-7/+25
Simplify the SquashAll() function by generating the composition without using Plan(). This allows us to specify exactly what we want on the screen without involving the normal plane provisioning code. BUG=b/28117135 TEST=Tested on ryu, squashing still works Signed-off-by: Sean Paul <seanpaul@chromium.org> Change-Id: Ieec9c323941e2a80252b33d14563c4d218d38dfb
2016-05-12drm_hwcomposer: Move SeparateLayers into a member functionSean Paul2-36/+50
Instead of passing a bunch of member data to a static function, make SeparateLayers a member of DrmDisplayComposition. This will be simplified further once the Planner interface is implemented. BUG=b/28117135 TEST=Tested on ryu Signed-off-by: Sean Paul <seanpaul@chromium.org> Change-Id: Ia4e15aa20b6dc14b044ee1dec7b5fce514278be7
2016-05-12drm_hwcomposer: Move DrmCompositionPlaneType into DrmCompositionPlaneSean Paul3-31/+30
Now that DrmCompositionPlane is classified, move the type into it as a subclass. BUG=b/28117135 TEST=Tested on ryu Signed-off-by: Sean Paul <seanpaul@chromium.org> Change-Id: I774f477e75b3a2e2916c5d98931730dac46d3877
2016-05-12drm_hwcomposer: Use a vector for composition source_layersSean Paul3-76/+148
Instead of a 1:1 mapping of layer:plane, use a vector to store source layers for a composition plane. This will allow us to represent squash compositions more easily by adding all source layers to the vector. This should also facilitate hardware which allows multiple fbs per plane. BUG=b/28117135 TEST=Tested on ryu Signed-off-by: Sean Paul <seanpaul@chromium.org> Change-Id: I5d4bfc6e9da022eaab047f948cc874d6a8a25746
2016-05-11drm_hwcomposer: Add type to DrmCompositionPlaneSean Paul3-117/+107
Instead of encoding the plane/composition type in source_layer, move it to its own explicit type. This will allow us to expand source_layer to include more than one layer. BUG=b/28117135 TEST=compiles and runs on smaug Change-Id: I19b1ed8e395347bbefb0fb6a0ab02d6ac0e5c1c1 Signed-off-by: Sean Paul <seanpaul@chromium.org>