aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0536-drm-amd-dal-refactor-helpers-to-use-dc-types.patch
diff options
context:
space:
mode:
authorAwais Belal <awais_belal@mentor.com>2016-10-13 14:39:46 +0500
committerAwais Belal <awais_belal@mentor.com>2016-10-14 15:22:00 +0500
commit912c1466ad973230fcdd08b07f766d291a6c13a4 (patch)
tree3e7a0bdfdf033d61c2212f66c19bf192d41e49b2 /common/recipes-kernel/linux/files/0536-drm-amd-dal-refactor-helpers-to-use-dc-types.patch
parentb701f13977df4dd34e618e7d074220782b27dd34 (diff)
downloadmeta-amd-912c1466ad973230fcdd08b07f766d291a6c13a4.tar.gz
meta-amd-912c1466ad973230fcdd08b07f766d291a6c13a4.tar.bz2
meta-amd-912c1466ad973230fcdd08b07f766d291a6c13a4.zip
SE/BE: move to 4.4 kernel
This commit does a few things which cannot be separated easily so it cannot be split in to separate commits. * Drops all 4.1 kernel bits. * Moves all common patches from meta-amdfalconx86 to common. * Moves SE/BE builds to 4.4 kernel. Signed-off-by: Awais Belal <awais_belal@mentor.com>
Diffstat (limited to 'common/recipes-kernel/linux/files/0536-drm-amd-dal-refactor-helpers-to-use-dc-types.patch')
-rw-r--r--common/recipes-kernel/linux/files/0536-drm-amd-dal-refactor-helpers-to-use-dc-types.patch208
1 files changed, 208 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0536-drm-amd-dal-refactor-helpers-to-use-dc-types.patch b/common/recipes-kernel/linux/files/0536-drm-amd-dal-refactor-helpers-to-use-dc-types.patch
new file mode 100644
index 00000000..7bc77984
--- /dev/null
+++ b/common/recipes-kernel/linux/files/0536-drm-amd-dal-refactor-helpers-to-use-dc-types.patch
@@ -0,0 +1,208 @@
+From 185d80bfd5cedb4bc951562f008bc80da3788128 Mon Sep 17 00:00:00 2001
+From: Jordan Lazare <Jordan.Lazare@amd.com>
+Date: Mon, 30 Nov 2015 13:15:47 -0500
+Subject: [PATCH 0536/1110] drm/amd/dal: refactor helpers to use dc types
+
+We should not access core types from DM
+
+Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
+Signed-off-by: Harry Wentland <harry.wentland@amd.com>
+Acked-by: Harry Wentland <harry.wentland@amd.com>
+---
+ .../gpu/drm/amd/dal/amdgpu_dm/amdgpu_dc_helpers.c | 103 +++++++++++----------
+ drivers/gpu/drm/amd/dal/dc/core/dc_target.c | 1 +
+ drivers/gpu/drm/amd/dal/dc/dc.h | 2 +-
+ .../gpu/drm/amd/dal/include/link_service_types.h | 2 +-
+ 4 files changed, 56 insertions(+), 52 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dc_helpers.c b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dc_helpers.c
+index 7a07af5..5b780e1 100644
+--- a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dc_helpers.c
++++ b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dc_helpers.c
+@@ -31,9 +31,6 @@
+ #include <drm/amdgpu_drm.h>
+ #include <drm/drm_edid.h>
+
+-#include "dc_types.h"
+-#include "core_types.h"
+-#include "stream_encoder_types.h"
+ #include "amdgpu.h"
+ #include "dc.h"
+ #include "dc_services.h"
+@@ -234,22 +231,27 @@ bool dc_helpers_dp_mst_write_payload_allocation_table(
+ for (i = 0; i < mst_mgr->max_payloads; i++) {
+ if (mst_mgr->payloads[i].num_slots == 0)
+ break;
+- table->stream_count++;
+ }
+
++ table->stream_count = i;
++
+ for (i = 0; i < table->stream_count; i++) {
+ table->stream_allocations[i].slot_count =
+ mst_mgr->proposed_vcpis[i]->num_slots;
+- /* mst_mgr->pbn_div is fixed value after link training for
+- * current link PHY */
++ /*
++ * mst_mgr->pbn_div is fixed value after link training for
++ * current link PHY
++ */
+ table->stream_allocations[i].pbn_per_slot = mst_mgr->pbn_div;
+
+- /* find which payload is for current stream
+- * after drm_dp_update_payload_part1, payload and proposed_vcpis
++ /*
++ * find which payload is for current stream after
++ * drm_dp_update_payload_part1, payload and proposed_vcpis
+ * are sync to the same allocation sequence. vcpi is not saved
+ * into payload by drm_dp_update_payload_part1. In order to
+ * find sequence of a payload within allocation sequence, we
+- * need check vcpi from proposed_vcpis*/
++ * need check vcpi from proposed_vcpis
++ */
+
+ table->stream_allocations[i].pbn =
+ mst_mgr->proposed_vcpis[i]->pbn;
+@@ -259,59 +261,60 @@ bool dc_helpers_dp_mst_write_payload_allocation_table(
+
+ find_stream_for_sink = false;
+
+- list_for_each_entry(connector,
+- &dev->mode_config.connector_list, head) {
++ list_for_each_entry(
++ connector,
++ &dev->mode_config.connector_list,
++ head) {
++ const struct dc_sink *dc_sink_connector;
++ struct dc_target *dc_target;
++ uint8_t j;
+
+ aconnector = to_amdgpu_connector(connector);
+
+ /* not mst connector */
+ if (!aconnector->mst_port)
+ continue;
++
+ mst_port = aconnector->port;
+
+- if (mst_port->vcpi.vcpi ==
+- mst_mgr->proposed_vcpis[i]->vcpi) {
+- /* find connector with same vcid as payload */
+-
+- const struct dc_sink *dc_sink_connector;
+- struct core_sink *core_sink;
+- struct dc_target *dc_target;
+- struct core_target *core_target;
+- struct stream_encoder *stream_enc;
+- uint8_t j;
+-
+- dc_sink_connector = aconnector->dc_sink;
+- core_sink = DC_SINK_TO_CORE(dc_sink_connector);
+-
+- /* find stream to drive this sink
+- * crtc -> target -> stream -> sink */
+- crtc = aconnector->base.state->crtc;
+- amdgpu_crtc = to_amdgpu_crtc(crtc);
+- dc_target = amdgpu_crtc->target;
+- core_target = DC_TARGET_TO_CORE(dc_target);
+-
+- for (j = 0; j < core_target->stream_count;
+- j++) {
+- if (core_target->streams[j]->sink ==
+- core_sink)
+- break;
+- }
+-
+- if (j < core_target->stream_count) {
+- /* find sink --> stream --> target -->
+- * connector*/
+- stream_enc =
+- core_target->streams[j]->stream_enc;
+- table->stream_allocations[i].engine =
+- stream_enc->id;
+- /* exit loop connector */
+- find_stream_for_sink = true;
++ if (mst_port->vcpi.vcpi !=
++ mst_mgr->proposed_vcpis[i]->vcpi)
++ continue;
++
++ /* find connector with same vcid as payload */
++
++ dc_sink_connector = aconnector->dc_sink;
++
++ /*
++ * find stream to drive this sink
++ * crtc -> target -> stream -> sink
++ */
++ crtc = aconnector->base.state->crtc;
++ amdgpu_crtc = to_amdgpu_crtc(crtc);
++ dc_target = amdgpu_crtc->target;
++
++ for (j = 0; j < dc_target->stream_count; j++) {
++ if (dc_target->streams[j]->sink ==
++ dc_sink_connector)
+ break;
+- }
++ }
++
++ if (j < dc_target->stream_count) {
++ /*
++ * find sink --> stream --> target -->
++ * connector
++ */
++ table->stream_allocations[i].engine =
++ dc_target->streams[j];
++ /* exit loop connector */
++ find_stream_for_sink = true;
++ break;
+ }
+ }
++
+ if (!find_stream_for_sink) {
+- /* TODO: do not find stream for sink. This should not
++ /*
++ * TODO: do not find stream for sink. This should not
+ * happen
+ */
+ ASSERT(0);
+diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_target.c b/drivers/gpu/drm/amd/dal/dc/core/dc_target.c
+index 9243c01..1a8d8d6 100644
+--- a/drivers/gpu/drm/amd/dal/dc/core/dc_target.c
++++ b/drivers/gpu/drm/amd/dal/dc/core/dc_target.c
+@@ -59,6 +59,7 @@ static void construct(
+
+ target->ctx = ctx;
+ target->stream_count = stream_count;
++ target->public.stream_count = stream_count;
+ }
+
+ static void destruct(struct core_target *core_target)
+diff --git a/drivers/gpu/drm/amd/dal/dc/dc.h b/drivers/gpu/drm/amd/dal/dc/dc.h
+index 0cb9d77..77fa4c8 100644
+--- a/drivers/gpu/drm/amd/dal/dc/dc.h
++++ b/drivers/gpu/drm/amd/dal/dc/dc.h
+@@ -145,7 +145,7 @@ bool dc_commit_surfaces_to_target(
+ #define MAX_STREAM_NUM 1
+
+ struct dc_target {
+- uint32_t temp;
++ uint8_t stream_count;
+ const struct dc_stream *streams[MAX_STREAM_NUM];
+ };
+
+diff --git a/drivers/gpu/drm/amd/dal/include/link_service_types.h b/drivers/gpu/drm/amd/dal/include/link_service_types.h
+index bd3dd6d..796c1ea 100644
+--- a/drivers/gpu/drm/amd/dal/include/link_service_types.h
++++ b/drivers/gpu/drm/amd/dal/include/link_service_types.h
+@@ -392,7 +392,7 @@ struct mst_device_info {
+ /* DP MST stream allocation (payload bandwidth number) */
+ struct dp_mst_stream_allocation {
+ /* stream engine id (DIG) */
+- enum engine_id engine;
++ const struct dc_stream *engine;
+ /* number of slots required for the DP stream in
+ * transport packet */
+ uint32_t slot_count;
+--
+2.7.4
+