| /* |
| * Copyright © 2021 The Fuchsia Authors |
| * |
| * 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 (including the next |
| * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. |
| * |
| */ |
| |
| #include "mos_bufmgr.h" |
| #include "mos_bufmgr_priv.h" |
| #include <assert.h> |
| #include <stdio.h> |
| |
| #define LOG_VERBOSE(msg, ...) do { \ |
| if (true) \ |
| fprintf(stderr, "%s:%d " msg "\n", __FILE__, __LINE__, ##__VA_ARGS__); \ |
| fflush(stderr); \ |
| } while (0) |
| |
| int mos_gem_bo_wait(struct mos_linux_bo *bo, int64_t timeout_ns) |
| { |
| LOG_VERBOSE("mos_gem_bo_wait unimplemented"); |
| return 0; |
| } |
| |
| void mos_gem_bo_clear_relocs(struct mos_linux_bo *bo, int start) |
| { |
| LOG_VERBOSE("mos_gem_bo_clear_relocs unimplemented"); |
| } |
| |
| struct mos_bufmgr* mos_bufmgr_gem_init(int fd, int batch_size) |
| { |
| LOG_VERBOSE("mos_bufmgr_gem_init unimplemented"); |
| return NULL; |
| } |
| |
| void mos_bufmgr_gem_enable_reuse(struct mos_bufmgr *bufmgr) |
| { |
| LOG_VERBOSE("mos_bufmgr_gem_enable_reuse unimplemented"); |
| } |
| |
| int mos_bufmgr_gem_get_devid(struct mos_bufmgr *bufmgr) |
| { |
| LOG_VERBOSE("mos_bufmgr_gem_get_devid unimplemented"); |
| return 0; |
| } |
| |
| int mos_bo_gem_export_to_prime(struct mos_linux_bo *bo, int *prime_fd) |
| { |
| LOG_VERBOSE("mos_bo_gem_export_to_prime unimplemented"); |
| return 0; |
| } |
| |
| struct mos_linux_bo * mos_bo_gem_create_from_name(struct mos_bufmgr *bufmgr, |
| const char *name, |
| unsigned int handle) |
| { |
| LOG_VERBOSE("mos_bo_gem_create_from_name unimplemented"); |
| return NULL; |
| } |
| |
| void mos_gem_context_destroy(struct mos_linux_context *ctx) |
| { |
| LOG_VERBOSE("mos_gem_context_destroy unimplemented"); |
| } |
| |
| int mos_gem_bo_map_wc(struct mos_linux_bo *bo) { |
| LOG_VERBOSE("mos_gem_bo_map_wc unimplemented"); |
| return 0; |
| } |
| |
| struct mos_linux_bo *mos_bo_gem_create_from_prime(struct mos_bufmgr *bufmgr, int prime_fd, int size) |
| { |
| LOG_VERBOSE("mos_bo_gem_create_from_prime unimplemented"); |
| return 0; |
| } |
| |
| int mos_gem_bo_map_gtt(struct mos_linux_bo *bo) |
| { |
| LOG_VERBOSE("mos_gem_bo_map_gtt unimplemented"); |
| return 0; |
| } |
| |
| int mos_gem_bo_map_unsynchronized(struct mos_linux_bo *bo) |
| { |
| LOG_VERBOSE("mos_gem_bo_map_unsynchronized unimplemented"); |
| return 0; |
| } |
| |
| void mos_gem_bo_start_gtt_access(struct mos_linux_bo *bo, int write_enable) |
| { |
| LOG_VERBOSE("mos_gem_bo_start_gtt_access unimplemented"); |
| } |
| |
| int mos_gem_bo_unmap_gtt(struct mos_linux_bo *bo) |
| { |
| LOG_VERBOSE("mos_gem_bo_unmap_gtt unimplemented"); |
| return 0; |
| } |
| |
| int mos_query_device_blob(int fd, MEDIA_SYSTEM_INFO* gfx_info) |
| { |
| LOG_VERBOSE("mos_query_device_blob unimplemented"); |
| return -1; |
| } |
| |
| int mos_query_engines_count(struct mos_bufmgr *bufmgr, |
| unsigned int *nengine) |
| |
| { |
| LOG_VERBOSE("mos_query_engines_count unimplemented"); |
| return 0; |
| } |
| |
| int mos_query_engines(struct mos_bufmgr *bufmgr, |
| __u16 engine_class, |
| __u64 caps, |
| unsigned int *nengine, |
| struct i915_engine_class_instance *ci) |
| { |
| LOG_VERBOSE("mos_query_engines unimplemented"); |
| return 0; |
| } |
| |
| int mos_get_context_param(struct mos_linux_context *ctx, |
| uint32_t size, |
| uint64_t param, |
| uint64_t *value) |
| { |
| LOG_VERBOSE("mos_get_context_param unimplemented"); |
| return 0; |
| } |
| |
| int mos_set_context_param(struct mos_linux_context *ctx, |
| uint32_t size, |
| uint64_t param, |
| uint64_t value) |
| { |
| LOG_VERBOSE("mos_set_context_param unimplemented"); |
| return 0; |
| } |
| |
| struct mos_linux_context * mos_gem_context_create(struct mos_bufmgr *bufmgr) |
| { |
| LOG_VERBOSE("mos_gem_context_create_ext unimplemented"); |
| return NULL; |
| } |
| |
| struct mos_linux_context *mos_gem_context_create_ext(struct mos_bufmgr *bufmgr, __u32 flags) |
| { |
| LOG_VERBOSE("mos_gem_context_create_ext unimplemented"); |
| return NULL; |
| } |
| |
| struct drm_i915_gem_vm_control* mos_gem_vm_create(struct mos_bufmgr *bufmgr) |
| { |
| LOG_VERBOSE("mos_gem_vm_create unimplemented"); |
| return NULL; |
| } |
| |
| struct mos_linux_context * |
| mos_gem_context_create_shared(struct mos_bufmgr *bufmgr, mos_linux_context* ctx, __u32 flags) |
| { |
| LOG_VERBOSE("mos_gem_context_create_shared unimplemented"); |
| return NULL; |
| } |
| |
| int |
| mos_get_reset_stats(struct mos_linux_context *ctx, |
| uint32_t *reset_count, |
| uint32_t *active, |
| uint32_t *pending) |
| { |
| LOG_VERBOSE("mos_get_reset_stats unimplemented"); |
| return 0; |
| } |
| |
| void mos_gem_vm_destroy(struct mos_bufmgr *bufmgr, struct drm_i915_gem_vm_control* vm) |
| { |
| LOG_VERBOSE("mos_gem_vm_destroy unimplemented"); |
| } |
| |
| int mos_gem_bo_unmap_wc(struct mos_linux_bo *bo) |
| { |
| LOG_VERBOSE("mos_gem_bo_unmap_wc unimplemented"); |
| return 0; |
| } |
| |
| bool mos_gem_bo_is_softpin(struct mos_linux_bo *bo) |
| { |
| LOG_VERBOSE("mos_gem_bo_is_softpin unimplemented"); |
| return false; |
| } |
| |
| int mos_gem_bo_context_exec2(struct mos_linux_bo *bo, int used, struct mos_linux_context *ctx, |
| drm_clip_rect_t *cliprects, int num_cliprects, int DR4, |
| unsigned int flags, int *fence) { |
| LOG_VERBOSE("mos_gem_bo_context_exec2 unimplemented"); |
| return 0; |
| } |
| |
| int mos_get_context_param_sseu(struct mos_linux_context *ctx, |
| struct drm_i915_gem_context_param_sseu *sseu) { |
| LOG_VERBOSE("mos_get_context_param_sseu unimplemented"); |
| return 0; |
| } |
| |
| unsigned int mos_hweight8(uint8_t w) |
| { |
| LOG_VERBOSE("mos_hweight8 unimplemented"); |
| return 0; |
| } |
| |
| uint8_t mos_switch_off_n_bits(uint8_t in_mask, int n) |
| { |
| LOG_VERBOSE("mos_switch_off_n_bits unimplemented"); |
| return 0; |
| } |
| |
| int mos_set_context_param_sseu(struct mos_linux_context *ctx, |
| struct drm_i915_gem_context_param_sseu sseu) { |
| LOG_VERBOSE("mos_set_context_param_sseu unimplemented"); |
| return 0; |
| } |
| |
| int mos_set_context_param_load_balance(struct mos_linux_context *ctx, |
| struct i915_engine_class_instance *ci, |
| unsigned int count) |
| { |
| LOG_VERBOSE("mos_set_context_param_load_balance unimplemented"); |
| return 0; |
| } |
| |
| int mos_set_context_param_bond(struct mos_linux_context *ctx, |
| struct i915_engine_class_instance master_ci, |
| struct i915_engine_class_instance *bond_ci, |
| unsigned int bond_count) |
| { |
| LOG_VERBOSE("mos_set_context_param_bond unimplemented"); |
| return 0; |
| } |
| |
| int mos_set_context_param_parallel(struct mos_linux_context *ctx, |
| struct i915_engine_class_instance *ci, |
| unsigned int count) |
| { |
| LOG_VERBOSE("mos_set_context_param_parallel unimplemented"); |
| return 0; |
| } |
| |
| bool mos_gem_bo_is_exec_object_async(struct mos_linux_bo *bo) |
| { |
| LOG_VERBOSE("mos_gem_bo_is_exec_object_async unimplemented"); |
| return 0; |
| } |
| |
| int mos_gem_bo_context_exec3(struct mos_linux_bo **bo, int num_bo, struct mos_linux_context *ctx, |
| struct drm_clip_rect *cliprects, int num_cliprects, int DR4, |
| unsigned int flags, int *fence) |
| { |
| LOG_VERBOSE("mos_gem_bo_context_exec3 unimplemented"); |
| return 0; |
| } |