blob: b0aeb9cbf000ed87efc3336cda5177c031239e82 [file] [log] [blame]
/*
* 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_bufmgr_gem_enable_reuse(struct mos_bufmgr *bufmgr)
{
LOG_VERBOSE("mos_bufmgr_gem_enable_reuse unimplemented");
}
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;
}
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_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;
}
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;
}
//////////////////////////////////////////////////////////////////////////////////////////////////
int bufmgr_bo_get_subdata(struct mos_linux_bo *bo, unsigned long offset,
unsigned long size, void *data)
{
LOG_VERBOSE("bufmgr_bo_get_subdata not implemented");
return 0;
}
void bufmgr_bo_wait_rendering(struct mos_linux_bo *bo)
{
LOG_VERBOSE("bufmgr_bo_wait_rendering not implemented");
}
int bufmgr_bo_pad_to_size(struct mos_linux_bo *bo, uint64_t pad_to_size)
{
LOG_VERBOSE("bufmgr_bo_pad_to_size not implemented");
return 0;
}
int bufmgr_bo_emit_reloc(struct mos_linux_bo *bo, uint32_t offset,
struct mos_linux_bo *target_bo, uint32_t target_offset,
uint32_t read_domains, uint32_t write_domain)
{
LOG_VERBOSE("bufmgr_bo_emit_reloc not implemented");
return 0;
}
int bufmgr_bo_emit_reloc2(struct mos_linux_bo *bo, uint32_t offset,
struct mos_linux_bo *target_bo, uint32_t target_offset,
uint32_t read_domains, uint32_t write_domain,
uint64_t presumed_offset)
{
LOG_VERBOSE("bufmgr_bo_emit_reloc2 not implemented");
return 0;
}
int bufmgr_bo_emit_reloc_fence(struct mos_linux_bo *bo, uint32_t offset,
struct mos_linux_bo *target_bo,
uint32_t target_offset,
uint32_t read_domains, uint32_t write_domain)
{
LOG_VERBOSE("bufmgr_bo_emit_reloc_fence not implemented");
return 0;
}
int bufmgr_bo_pin(struct mos_linux_bo *bo, uint32_t alignment)
{
LOG_VERBOSE("bufmgr_bo_pin not implemented");
return 0;
}
int bufmgr_bo_unpin(struct mos_linux_bo *bo)
{
LOG_VERBOSE("bufmgr_bo_unpin not implemented");
return 0;
}
int bufmgr_bo_get_tiling(struct mos_linux_bo *bo, uint32_t * tiling_mode,
uint32_t * swizzle_mode)
{
LOG_VERBOSE("bufmgr_bo_get_tiling not implemented");
return 0;
}
int bufmgr_bo_set_tiling(struct mos_linux_bo *bo, uint32_t * tiling_mode,
uint32_t stride)
{
LOG_VERBOSE("bufmgr_bo_set_tiling not implemented");
return 0;
}
int bufmgr_bo_flink(struct mos_linux_bo *bo, uint32_t * name)
{
LOG_VERBOSE("bufmgr_bo_flink not implemented");
return 0;
}
int bufmgr_bo_exec2(struct mos_linux_bo *bo, int used,
drm_clip_rect_t *cliprects, int num_cliprects,
int DR4)
{
LOG_VERBOSE("bufmgr_bo_exec2 not implemented");
return 0;
}
int bufmgr_bo_mrb_exec2(struct mos_linux_bo *bo, int used,
drm_clip_rect_t *cliprects, int num_cliprects, int DR4,
unsigned int flags)
{
LOG_VERBOSE("bufmgr_bo_mrb_exec2 not implemented");
return 0;
}
int bufmgr_bo_busy(struct mos_linux_bo *bo)
{
LOG_VERBOSE("bufmgr_bo_busy not implemented");
return 0;
}
int bufmgr_bo_madvise(struct mos_linux_bo *bo, int madv)
{
LOG_VERBOSE("bufmgr_bo_madvise not implemented");
return 0;
}
int bufmgr_check_aperture_space(struct mos_linux_bo **bo_array, int count)
{
LOG_VERBOSE("bufmgr_check_aperture_space not implemented");
return 0;
}
int bufmgr_bo_disable_reuse(struct mos_linux_bo *bo)
{
LOG_VERBOSE("bufmgr_bo_disable_reuse not implemented");
return 0;
}
int bufmgr_bo_is_reusable(struct mos_linux_bo *bo)
{
LOG_VERBOSE("bufmgr_bo_is_reusable not implemented");
return 0;
}
int bufmgr_get_pipe_from_crtc_id(struct mos_bufmgr *bufmgr, int crtc_id)
{
LOG_VERBOSE("bufmgr_get_pipe_from_crtc_id not implemented");
return 0;
}
int bufmgr_bo_references(struct mos_linux_bo *bo, struct mos_linux_bo *target_bo)
{
LOG_VERBOSE("bufmgr_bo_references not implemented");
return 0;
}