/* * Copyright 2012-15 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 __DAL_GRPH_OBJECT_ID_H__ #define __DAL_GRPH_OBJECT_ID_H__ /* Types of graphics objects */ enum object_type { … }; /* Enumeration inside one type of graphics objects */ enum object_enum_id { … }; /* Generic object ids */ enum generic_id { … }; /* Controller object ids */ enum controller_id { … }; #define IS_UNDERLAY_CONTROLLER(ctrlr_id) … /* * ClockSource object ids. * We maintain the order matching (more or less) ATOM BIOS * to improve optimized acquire */ enum clock_source_id { … }; /* Encoder object ids */ enum encoder_id { … }; /* Connector object ids */ enum connector_id { … }; /* Audio object ids */ enum audio_id { … }; /* Engine object ids */ enum engine_id { … }; enum transmitter_color_depth { … }; enum dp_alt_mode { … }; /* ***************************************************************************** * graphics_object_id struct * * graphics_object_id is a very simple struct wrapping 32bit Graphics * Object identication * * This struct should stay very simple * No dependencies at all (no includes) * No debug messages or asserts * No #ifndef and preprocessor directives * No grow in space (no more data member) ***************************************************************************** */ struct graphics_object_id { … }; /* some simple functions for convenient graphics_object_id handle */ static inline struct graphics_object_id dal_graphics_object_id_init( uint32_t id, enum object_enum_id enum_id, enum object_type type) { … } /* Based on internal data members memory layout */ static inline uint32_t dal_graphics_object_id_to_uint( struct graphics_object_id id) { … } static inline enum controller_id dal_graphics_object_id_get_controller_id( struct graphics_object_id id) { … } static inline enum clock_source_id dal_graphics_object_id_get_clock_source_id( struct graphics_object_id id) { … } static inline enum encoder_id dal_graphics_object_id_get_encoder_id( struct graphics_object_id id) { … } static inline enum connector_id dal_graphics_object_id_get_connector_id( struct graphics_object_id id) { … } static inline enum audio_id dal_graphics_object_id_get_audio_id( struct graphics_object_id id) { … } static inline enum engine_id dal_graphics_object_id_get_engine_id( struct graphics_object_id id) { … } static inline bool dal_graphics_object_id_equal( struct graphics_object_id id_1, struct graphics_object_id id_2) { … } #endif