aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0683-drm-amd-dal-Define-interface-for-External-VBIOS-part.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0683-drm-amd-dal-Define-interface-for-External-VBIOS-part.patch')
-rw-r--r--common/recipes-kernel/linux/files/0683-drm-amd-dal-Define-interface-for-External-VBIOS-part.patch354
1 files changed, 0 insertions, 354 deletions
diff --git a/common/recipes-kernel/linux/files/0683-drm-amd-dal-Define-interface-for-External-VBIOS-part.patch b/common/recipes-kernel/linux/files/0683-drm-amd-dal-Define-interface-for-External-VBIOS-part.patch
deleted file mode 100644
index 85c17bf2..00000000
--- a/common/recipes-kernel/linux/files/0683-drm-amd-dal-Define-interface-for-External-VBIOS-part.patch
+++ /dev/null
@@ -1,354 +0,0 @@
-From 028d2eb5ef5519c27bdbf497651faf9273559c0f Mon Sep 17 00:00:00 2001
-From: David Rokhvarg <David.Rokhvarg@amd.com>
-Date: Fri, 8 Jan 2016 15:40:44 -0500
-Subject: [PATCH 0683/1110] drm/amd/dal: Define interface for External VBIOS -
- part 1.
-
-Current use is to allow Diagnositcs/Validation of DCE on FPGA.
-
-Signed-off-by: David Rokhvarg <David.Rokhvarg@amd.com>
-Acked-by: Jordan Lazare <Jordan.Lazare@amd.com>
----
- .../gpu/drm/amd/dal/dc/adapter/adapter_service.c | 36 ++++++++++++++-----
- .../gpu/drm/amd/dal/dc/adapter/adapter_service.h | 3 +-
- drivers/gpu/drm/amd/dal/dc/bios/bios_parser.c | 14 +++++++-
- drivers/gpu/drm/amd/dal/dc/bios/bios_parser.h | 6 ++++
- drivers/gpu/drm/amd/dal/dc/core/dc.c | 9 +++--
- drivers/gpu/drm/amd/dal/dc/dc_bios_types.h | 40 ++++++++++++++++++++++
- .../amd/dal/include/adapter_service_interface.h | 1 +
- .../drm/amd/dal/include/bios_parser_interface.h | 7 ++--
- drivers/gpu/drm/amd/dal/include/dal_types.h | 4 +++
- 9 files changed, 104 insertions(+), 16 deletions(-)
- create mode 100644 drivers/gpu/drm/amd/dal/dc/dc_bios_types.h
-
-diff --git a/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c b/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c
-index 4f9a637..6084466 100644
---- a/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c
-+++ b/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c
-@@ -34,6 +34,7 @@
- #include "include/asic_capability_interface.h"
- #include "include/logger_interface.h"
-
-+#include "dc_bios_types.h"
- #include "adapter_service.h"
- #include "hw_ctx_adapter_service.h"
- #include "wireless_data_source.h"
-@@ -735,10 +736,16 @@ static bool adapter_service_construct(
- goto failed_to_generate_features;
- }
-
-- /* Create BIOS parser */
-- init_data->bp_init_data.ctx = init_data->ctx;
-- as->bios_parser =
-- dal_bios_parser_create(&init_data->bp_init_data, as);
-+ if (init_data->vbios_override) {
-+ /* TODO: remove the typecast */
-+ as->bios_parser = (struct bios_parser *)init_data->vbios_override;
-+ } else {
-+ /* Create BIOS parser */
-+ init_data->bp_init_data.ctx = init_data->ctx;
-+
-+ as->bios_parser =
-+ dal_bios_parser_create(&init_data->bp_init_data, as);
-+ }
-
- if (!as->bios_parser) {
- ASSERT_CRITICAL(false);
-@@ -905,7 +912,6 @@ uint8_t dal_adapter_service_get_controllers_num(
- return result;
- }
-
--
- /** Get total number of connectors.
- *
- * \param as Adapter Service
-@@ -918,9 +924,13 @@ uint8_t dal_adapter_service_get_connectors_num(
- {
- uint8_t vbios_connectors_num = 0;
- uint8_t wireless_connectors_num = 0;
-+ struct dc_bios *dcb;
-+
-+ /* TODO: remove type cast */
-+ dcb = (struct dc_bios*)dal_adapter_service_get_bios_parser(as);
-+
-+ vbios_connectors_num = dcb->funcs->get_connectors_number(dcb);
-
-- vbios_connectors_num = dal_bios_parser_get_connectors_number(
-- as->bios_parser);
- wireless_connectors_num = wireless_get_connectors_num(as);
-
- return vbios_connectors_num + wireless_connectors_num;
-@@ -1004,8 +1014,13 @@ struct graphics_object_id dal_adapter_service_get_connector_obj_id(
- struct adapter_service *as,
- uint8_t connector_index)
- {
-- uint8_t bios_connectors_num =
-- dal_bios_parser_get_connectors_number(as->bios_parser);
-+ struct dc_bios *dcb;
-+ uint8_t bios_connectors_num;
-+
-+ /* TODO: remove type cast */
-+ dcb = (struct dc_bios*)dal_adapter_service_get_bios_parser(as);
-+
-+ bios_connectors_num = dcb->funcs->get_connectors_number(dcb);
-
- if (connector_index >= bios_connectors_num)
- return wireless_get_connector_id(
-@@ -1651,9 +1666,12 @@ uint32_t dal_adapter_service_get_memory_type_multiplier(
- *
- * Get BIOS parser handler
- */
-+/* TODO: change return type to 'dc_bios'. */
- struct bios_parser *dal_adapter_service_get_bios_parser(
- struct adapter_service *as)
- {
-+ /* TODO: conditionally return 'override' or 'real'.
-+ * Works for now because 'base' is first member of 'bios parser' */
- return as->bios_parser;
- }
-
-diff --git a/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.h b/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.h
-index 25ac648..dd5bb00 100644
---- a/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.h
-+++ b/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.h
-@@ -35,12 +35,13 @@
- */
- struct gpio_service;
- struct asic_cap;
-+struct dc_bios;
-
- /* Adapter service */
- struct adapter_service {
- struct dc_context *ctx;
- struct asic_capability *asic_cap;
-- struct bios_parser *bios_parser;
-+ struct bios_parser *bios_parser;/* TODO: remove it. replace by struct dc_bios *dcb; */
- struct gpio_service *gpio_service;
- struct i2caux *i2caux;
- struct wireless_data wireless_data;
-diff --git a/drivers/gpu/drm/amd/dal/dc/bios/bios_parser.c b/drivers/gpu/drm/amd/dal/dc/bios/bios_parser.c
-index 1d02be9..3329322 100644
---- a/drivers/gpu/drm/amd/dal/dc/bios/bios_parser.c
-+++ b/drivers/gpu/drm/amd/dal/dc/bios/bios_parser.c
-@@ -27,6 +27,7 @@
-
- #include "atom.h"
-
-+#include "dc_bios_types.h"
- #include "include/adapter_service_interface.h"
- #include "include/grph_object_ctrl_defs.h"
- #include "include/bios_parser_interface.h"
-@@ -98,6 +99,13 @@ static void process_ext_display_connection_info(struct bios_parser *bp);
- #define BIOS_IMAGE_SIZE_OFFSET 2
- #define BIOS_IMAGE_SIZE_UNIT 512
-
-+/*****************************************************************************/
-+static uint8_t bios_parser_get_connectors_number(struct dc_bios *dcb);
-+
-+const struct dc_vbios_funcs vbios_funcs = {
-+ .get_connectors_number = bios_parser_get_connectors_number
-+};
-+
- static bool bios_parser_construct(
- struct bios_parser *bp,
- struct bp_init_data *init,
-@@ -117,6 +125,8 @@ static bool bios_parser_construct(
- if (!init->bios)
- return false;
-
-+ bp->base.funcs = &vbios_funcs;
-+
- dce_version = dal_adapter_service_get_dce_version(as);
- bp->ctx = init->ctx;
- bp->as = as;
-@@ -255,8 +265,10 @@ uint8_t dal_bios_parser_get_encoders_number(struct bios_parser *bp)
- le16_to_cpu(bp->object_info_tbl.v1_1->usEncoderObjectTableOffset));
- }
-
--uint8_t dal_bios_parser_get_connectors_number(struct bios_parser *bp)
-+static uint8_t bios_parser_get_connectors_number(struct dc_bios *dcb)
- {
-+ struct bios_parser *bp = BP_FROM_DCB(dcb);
-+
- return get_number_of_objects(bp,
- le16_to_cpu(bp->object_info_tbl.v1_1->usConnectorObjectTableOffset));
- }
-diff --git a/drivers/gpu/drm/amd/dal/dc/bios/bios_parser.h b/drivers/gpu/drm/amd/dal/dc/bios/bios_parser.h
-index db169f1..f8fa108 100644
---- a/drivers/gpu/drm/amd/dal/dc/bios/bios_parser.h
-+++ b/drivers/gpu/drm/amd/dal/dc/bios/bios_parser.h
-@@ -26,6 +26,7 @@
- #ifndef __DAL_BIOS_PARSER_H__
- #define __DAL_BIOS_PARSER_H__
-
-+#include "dc_bios_types.h"
- #include "bios_parser_helper.h"
-
- struct atom_data_revision {
-@@ -50,6 +51,7 @@ enum spread_spectrum_id {
- };
-
- struct bios_parser {
-+ struct dc_bios base;
- struct dc_context *ctx;
- struct adapter_service *as;
-
-@@ -75,4 +77,8 @@ struct bios_parser {
- bool headless_no_opm;
- };
-
-+/* Bios Parser from DC Bios */
-+#define BP_FROM_DCB(dc_bios) \
-+ container_of(dc_bios, struct bios_parser, base)
-+
- #endif
-diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c
-index e003f78..00a2453 100644
---- a/drivers/gpu/drm/amd/dal/dc/core/dc.c
-+++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c
-@@ -34,6 +34,7 @@
-
- #include "adapter_service_interface.h"
- #include "clock_source_interface.h"
-+#include "dc_bios_types.h"
-
- #include "include/irq_service_interface.h"
- #include "bandwidth_calcs.h"
-@@ -77,12 +78,13 @@ static bool create_links(struct dc *dc, const struct dc_init_data *init_params)
- {
- int i;
- int connectors_num;
-+ struct dc_bios *dcb;
-
- dc->link_count = 0;
-
-- connectors_num = dal_bios_parser_get_connectors_number(
-- dal_adapter_service_get_bios_parser(
-- init_params->adapter_srv));
-+ dcb = (struct dc_bios*)dal_adapter_service_get_bios_parser(init_params->adapter_srv);
-+
-+ connectors_num = dcb->funcs->get_connectors_number(dcb);
-
- if (0 == connectors_num || connectors_num > ENUM_ID_COUNT) {
- dal_error("DC: Invalid number of connectors!\n");
-@@ -224,6 +226,7 @@ static struct adapter_service *create_as(
- init_data.bdf_info = init->bdf_info;
-
- init_data.display_param = &init->display_param;
-+ init_data.vbios_override = init->vbios_override;
-
- as = dal_adapter_service_create(&init_data);
-
-diff --git a/drivers/gpu/drm/amd/dal/dc/dc_bios_types.h b/drivers/gpu/drm/amd/dal/dc/dc_bios_types.h
-new file mode 100644
-index 0000000..a82cbee
---- /dev/null
-+++ b/drivers/gpu/drm/amd/dal/dc/dc_bios_types.h
-@@ -0,0 +1,40 @@
-+/*
-+ * Copyright 2016 Advanced Micro Devices, Inc.
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a
-+ * copy of this software and associated documentation files (the "Software"),
-+ * to deal in the Software without restriction, including without limitation
-+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+ * and/or sell copies of the Software, and to permit persons to whom the
-+ * Software is furnished to do so, subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice shall be included in
-+ * all copies or substantial portions of the Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
-+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-+ * OTHER DEALINGS IN THE SOFTWARE.
-+ *
-+ * Authors: AMD
-+ *
-+ */
-+
-+#ifndef DC_BIOS_TYPES_H
-+#define DC_BIOS_TYPES_H
-+
-+struct dc_vbios_funcs;
-+
-+struct dc_bios {
-+ const struct dc_vbios_funcs *funcs;
-+};
-+
-+struct dc_vbios_funcs {
-+ uint8_t (*get_connectors_number)(struct dc_bios *bios);
-+};
-+
-+
-+#endif /* DC_BIOS_TYPES_H */
-diff --git a/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h b/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h
-index aa503a8..e449db6 100644
---- a/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h
-+++ b/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h
-@@ -322,6 +322,7 @@ struct as_init_data {
- struct dc_context *ctx;
- struct bdf_info bdf_info;
- const struct dal_override_parameters *display_param;
-+ struct dc_bios *vbios_override;
- };
-
- /* Create adapter service */
-diff --git a/drivers/gpu/drm/amd/dal/include/bios_parser_interface.h b/drivers/gpu/drm/amd/dal/include/bios_parser_interface.h
-index 13fa8ab..77999fc 100644
---- a/drivers/gpu/drm/amd/dal/include/bios_parser_interface.h
-+++ b/drivers/gpu/drm/amd/dal/include/bios_parser_interface.h
-@@ -57,6 +57,8 @@ struct bios_parser *dal_bios_parser_create(
- struct adapter_service *as);
- void dal_bios_parser_destroy(
- struct bios_parser **bp);
-+
-+
- void dal_bios_parser_power_down(
- struct bios_parser *bp);
- void dal_bios_parser_power_up(
-@@ -64,8 +66,6 @@ void dal_bios_parser_power_up(
-
- uint8_t dal_bios_parser_get_encoders_number(
- struct bios_parser *bp);
--uint8_t dal_bios_parser_get_connectors_number(
-- struct bios_parser *bp);
- uint32_t dal_bios_parser_get_oem_ddc_lines_number(
- struct bios_parser *bp);
- struct graphics_object_id dal_bios_parser_get_encoder_id(
-@@ -294,4 +294,7 @@ struct integrated_info *dal_bios_parser_create_integrated_info(
-
- /* Destroy provided integrated info */
- void dal_bios_parser_destroy_integrated_info(struct dc_context *ctx, struct integrated_info **info);
-+
-+
-+
- #endif
-diff --git a/drivers/gpu/drm/amd/dal/include/dal_types.h b/drivers/gpu/drm/amd/dal/include/dal_types.h
-index 5ec4784..caaacf6 100644
---- a/drivers/gpu/drm/amd/dal/include/dal_types.h
-+++ b/drivers/gpu/drm/amd/dal/include/dal_types.h
-@@ -30,6 +30,7 @@
- #include "dc_types.h"
-
- struct dal_logger;
-+struct dc_bios;
-
- enum dce_version {
- DCE_VERSION_UNKNOWN = (-1),
-@@ -137,6 +138,9 @@ struct dal_init_data {
- void *driver; /* ctx */
- void *cgs_device;
- uint8_t num_virtual_links;
-+ /* If 'vbios_override' not NULL, it will be called instead
-+ * of the real VBIOS. Intended use is Diagnostics on FPGA. */
-+ struct dc_bios *vbios_override;
- };
-
- struct dal_dc_init_data {
---
-2.7.4
-