diff options
Diffstat (limited to 'lib/mesa')
-rw-r--r-- | lib/mesa/src/egl/main/egl.def | 12 | ||||
-rw-r--r-- | lib/mesa/src/gallium/auxiliary/rbug/README | 2 | ||||
-rw-r--r-- | lib/mesa/src/gallium/auxiliary/rtasm/rtasm_cpu.c | 6 | ||||
-rw-r--r-- | lib/mesa/src/gallium/auxiliary/util/u_dl.c | 2 | ||||
-rw-r--r-- | lib/mesa/src/gallium/auxiliary/util/u_dl.h | 6 | ||||
-rw-r--r-- | lib/mesa/src/gallium/drivers/radeon/radeon_vce.h | 485 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/clear.c | 10 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/fragment-shader/frag-cb-1d.sh | 8 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/graw_util.h | 59 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/vertex-shader/vert-cb-1d.sh | 8 | ||||
-rw-r--r-- | lib/mesa/src/util/simple_list.h | 12 |
11 files changed, 138 insertions, 472 deletions
diff --git a/lib/mesa/src/egl/main/egl.def b/lib/mesa/src/egl/main/egl.def index 54ae76b33..0cfe920e0 100644 --- a/lib/mesa/src/egl/main/egl.def +++ b/lib/mesa/src/egl/main/egl.def @@ -2,21 +2,14 @@ EXPORTS eglBindAPI eglBindTexImage eglChooseConfig - eglClientWaitSync eglCopyBuffers eglCreateContext - eglCreateImage eglCreatePbufferFromClientBuffer eglCreatePbufferSurface eglCreatePixmapSurface - eglCreatePlatformPixmapSurface - eglCreatePlatformWindowSurface - eglCreateSync eglCreateWindowSurface eglDestroyContext - eglDestroyImage eglDestroySurface - eglDestroySync eglGetConfigAttrib eglGetConfigs eglGetCurrentContext @@ -24,9 +17,7 @@ EXPORTS eglGetCurrentSurface eglGetDisplay eglGetError - eglGetPlatformDisplay eglGetProcAddress - eglGetSyncAttrib eglInitialize eglMakeCurrent eglQueryAPI @@ -42,6 +33,3 @@ EXPORTS eglWaitClient eglWaitGL eglWaitNative - eglWaitSync - MesaGLInteropEGLQueryDeviceInfo - MesaGLInteropEGLExportObject diff --git a/lib/mesa/src/gallium/auxiliary/rbug/README b/lib/mesa/src/gallium/auxiliary/rbug/README index 0c41c8c3f..c5156438a 100644 --- a/lib/mesa/src/gallium/auxiliary/rbug/README +++ b/lib/mesa/src/gallium/auxiliary/rbug/README @@ -10,7 +10,7 @@ The code currently uses tcp and ip4v for connections. Information about driver integration can be found in: -src/gallium/auxiliary/driver_rbug/README +src/gallium/drivers/rbug/README for information about applications look in: diff --git a/lib/mesa/src/gallium/auxiliary/rtasm/rtasm_cpu.c b/lib/mesa/src/gallium/auxiliary/rtasm/rtasm_cpu.c index 03b11f914..9856fc3fe 100644 --- a/lib/mesa/src/gallium/auxiliary/rtasm/rtasm_cpu.c +++ b/lib/mesa/src/gallium/auxiliary/rtasm/rtasm_cpu.c @@ -33,12 +33,12 @@ #include "util/u_debug.h" #include "util/u_cpu_detect.h" -DEBUG_GET_ONCE_BOOL_OPTION(nosse, "GALLIUM_NOSSE", false); +DEBUG_GET_ONCE_BOOL_OPTION(nosse, "GALLIUM_NOSSE", FALSE); -static const struct util_cpu_caps_t *get_cpu_caps(void) +static struct util_cpu_caps *get_cpu_caps(void) { util_cpu_detect(); - return util_get_cpu_caps(); + return &util_cpu_caps; } int rtasm_cpu_has_sse(void) diff --git a/lib/mesa/src/gallium/auxiliary/util/u_dl.c b/lib/mesa/src/gallium/auxiliary/util/u_dl.c index 9b97d8dc4..aca435d6c 100644 --- a/lib/mesa/src/gallium/auxiliary/util/u_dl.c +++ b/lib/mesa/src/gallium/auxiliary/util/u_dl.c @@ -45,7 +45,7 @@ struct util_dl_library * util_dl_open(const char *filename) { #if defined(PIPE_OS_UNIX) - return (struct util_dl_library *)dlopen(filename, RTLD_LAZY | RTLD_LOCAL); + return (struct util_dl_library *)dlopen(filename, RTLD_LAZY | RTLD_GLOBAL); #elif defined(PIPE_OS_WINDOWS) return (struct util_dl_library *)LoadLibraryA(filename); #else diff --git a/lib/mesa/src/gallium/auxiliary/util/u_dl.h b/lib/mesa/src/gallium/auxiliary/util/u_dl.h index d2f4737d4..80a00ed67 100644 --- a/lib/mesa/src/gallium/auxiliary/util/u_dl.h +++ b/lib/mesa/src/gallium/auxiliary/util/u_dl.h @@ -32,9 +32,6 @@ #include "pipe/p_config.h" -#ifdef __cplusplus -extern "C" { -#endif #if defined(PIPE_OS_WINDOWS) # define UTIL_DL_EXT ".dll" @@ -82,8 +79,5 @@ util_dl_close(struct util_dl_library *library); const char * util_dl_error(void); -#ifdef __cplusplus -} -#endif #endif /* U_DL_H_ */ diff --git a/lib/mesa/src/gallium/drivers/radeon/radeon_vce.h b/lib/mesa/src/gallium/drivers/radeon/radeon_vce.h index 6b1b00da2..624bda479 100644 --- a/lib/mesa/src/gallium/drivers/radeon/radeon_vce.h +++ b/lib/mesa/src/gallium/drivers/radeon/radeon_vce.h @@ -25,432 +25,119 @@ * **************************************************************************/ +/* + * Authors: + * Christian König <christian.koenig@amd.com> + * + */ + #ifndef RADEON_VCE_H #define RADEON_VCE_H -#include "radeon_video.h" #include "util/list.h" -#define RVCE_CS(value) (enc->cs.current.buf[enc->cs.current.cdw++] = (value)) -#define RVCE_BEGIN(cmd) \ - { \ - uint32_t *begin = &enc->cs.current.buf[enc->cs.current.cdw++]; \ - RVCE_CS(cmd) -#define RVCE_READ(buf, domain, off) \ - si_vce_add_buffer(enc, (buf), RADEON_USAGE_READ, (domain), (off)) -#define RVCE_WRITE(buf, domain, off) \ - si_vce_add_buffer(enc, (buf), RADEON_USAGE_WRITE, (domain), (off)) -#define RVCE_READWRITE(buf, domain, off) \ - si_vce_add_buffer(enc, (buf), RADEON_USAGE_READWRITE, (domain), (off)) -#define RVCE_END() \ - *begin = (&enc->cs.current.buf[enc->cs.current.cdw] - begin) * 4; \ - } +#define RVCE_CS(value) (enc->cs->buf[enc->cs->cdw++] = (value)) +#define RVCE_BEGIN(cmd) { uint32_t *begin = &enc->cs->buf[enc->cs->cdw++]; RVCE_CS(cmd) +#define RVCE_READ(buf, domain, off) rvce_add_buffer(enc, (buf), RADEON_USAGE_READ, (domain), (off)) +#define RVCE_WRITE(buf, domain, off) rvce_add_buffer(enc, (buf), RADEON_USAGE_WRITE, (domain), (off)) +#define RVCE_READWRITE(buf, domain, off) rvce_add_buffer(enc, (buf), RADEON_USAGE_READWRITE, (domain), (off)) +#define RVCE_END() *begin = (&enc->cs->buf[enc->cs->cdw] - begin) * 4; } #define RVCE_MAX_BITSTREAM_OUTPUT_ROW_SIZE (4096 * 16 * 2.5) -#define RVCE_MAX_AUX_BUFFER_NUM 4 +#define RVCE_MAX_AUX_BUFFER_NUM 4 -struct si_screen; +struct r600_common_screen; /* driver dependent callback */ -typedef void (*rvce_get_buffer)(struct pipe_resource *resource, struct pb_buffer **handle, - struct radeon_surf **surface); +typedef void (*rvce_get_buffer)(struct pipe_resource *resource, + struct radeon_winsys_cs_handle **handle, + struct radeon_surf **surface); /* Coded picture buffer slot */ struct rvce_cpb_slot { - struct list_head list; - - unsigned index; - enum pipe_h2645_enc_picture_type picture_type; - unsigned frame_num; - unsigned pic_order_cnt; -}; - -struct rvce_rate_control { - uint32_t rc_method; - uint32_t target_bitrate; - uint32_t peak_bitrate; - uint32_t frame_rate_num; - uint32_t gop_size; - uint32_t quant_i_frames; - uint32_t quant_p_frames; - uint32_t quant_b_frames; - uint32_t vbv_buffer_size; - uint32_t frame_rate_den; - uint32_t vbv_buf_lv; - uint32_t max_au_size; - uint32_t qp_initial_mode; - uint32_t target_bits_picture; - uint32_t peak_bits_picture_integer; - uint32_t peak_bits_picture_fraction; - uint32_t min_qp; - uint32_t max_qp; - uint32_t skip_frame_enable; - uint32_t fill_data_enable; - uint32_t enforce_hrd; - uint32_t b_pics_delta_qp; - uint32_t ref_b_pics_delta_qp; - uint32_t rc_reinit_disable; - uint32_t enc_lcvbr_init_qp_flag; - uint32_t lcvbrsatd_based_nonlinear_bit_budget_flag; -}; + struct list_head list; -struct rvce_motion_estimation { - uint32_t enc_ime_decimation_search; - uint32_t motion_est_half_pixel; - uint32_t motion_est_quarter_pixel; - uint32_t disable_favor_pmv_point; - uint32_t force_zero_point_center; - uint32_t lsmvert; - uint32_t enc_search_range_x; - uint32_t enc_search_range_y; - uint32_t enc_search1_range_x; - uint32_t enc_search1_range_y; - uint32_t disable_16x16_frame1; - uint32_t disable_satd; - uint32_t enable_amd; - uint32_t enc_disable_sub_mode; - uint32_t enc_ime_skip_x; - uint32_t enc_ime_skip_y; - uint32_t enc_en_ime_overw_dis_subm; - uint32_t enc_ime_overw_dis_subm_no; - uint32_t enc_ime2_search_range_x; - uint32_t enc_ime2_search_range_y; - uint32_t parallel_mode_speedup_enable; - uint32_t fme0_enc_disable_sub_mode; - uint32_t fme1_enc_disable_sub_mode; - uint32_t ime_sw_speedup_enable; -}; - -struct rvce_pic_control { - uint32_t enc_use_constrained_intra_pred; - uint32_t enc_cabac_enable; - uint32_t enc_cabac_idc; - uint32_t enc_loop_filter_disable; - int32_t enc_lf_beta_offset; - int32_t enc_lf_alpha_c0_offset; - uint32_t enc_crop_left_offset; - uint32_t enc_crop_right_offset; - uint32_t enc_crop_top_offset; - uint32_t enc_crop_bottom_offset; - uint32_t enc_num_mbs_per_slice; - uint32_t enc_intra_refresh_num_mbs_per_slot; - uint32_t enc_force_intra_refresh; - uint32_t enc_force_imb_period; - uint32_t enc_pic_order_cnt_type; - uint32_t log2_max_pic_order_cnt_lsb_minus4; - uint32_t enc_sps_id; - uint32_t enc_pps_id; - uint32_t enc_constraint_set_flags; - uint32_t enc_b_pic_pattern; - uint32_t weight_pred_mode_b_picture; - uint32_t enc_number_of_reference_frames; - uint32_t enc_max_num_ref_frames; - uint32_t enc_num_default_active_ref_l0; - uint32_t enc_num_default_active_ref_l1; - uint32_t enc_slice_mode; - uint32_t enc_max_slice_size; -}; - -struct rvce_task_info { - uint32_t offset_of_next_task_info; - uint32_t task_operation; - uint32_t reference_picture_dependency; - uint32_t collocate_flag_dependency; - uint32_t feedback_index; - uint32_t video_bitstream_ring_index; -}; - -struct rvce_feedback_buf_pkg { - uint32_t feedback_ring_address_hi; - uint32_t feedback_ring_address_lo; - uint32_t feedback_ring_size; -}; - -struct rvce_rdo { - uint32_t enc_disable_tbe_pred_i_frame; - uint32_t enc_disable_tbe_pred_p_frame; - uint32_t use_fme_interpol_y; - uint32_t use_fme_interpol_uv; - uint32_t use_fme_intrapol_y; - uint32_t use_fme_intrapol_uv; - uint32_t use_fme_interpol_y_1; - uint32_t use_fme_interpol_uv_1; - uint32_t use_fme_intrapol_y_1; - uint32_t use_fme_intrapol_uv_1; - uint32_t enc_16x16_cost_adj; - uint32_t enc_skip_cost_adj; - uint32_t enc_force_16x16_skip; - uint32_t enc_disable_threshold_calc_a; - uint32_t enc_luma_coeff_cost; - uint32_t enc_luma_mb_coeff_cost; - uint32_t enc_chroma_coeff_cost; -}; - -struct rvce_vui { - uint32_t aspect_ratio_info_present_flag; - uint32_t aspect_ratio_idc; - uint32_t sar_width; - uint32_t sar_height; - uint32_t overscan_info_present_flag; - uint32_t overscan_Approp_flag; - uint32_t video_signal_type_present_flag; - uint32_t video_format; - uint32_t video_full_range_flag; - uint32_t color_description_present_flag; - uint32_t color_prim; - uint32_t transfer_char; - uint32_t matrix_coef; - uint32_t chroma_loc_info_present_flag; - uint32_t chroma_loc_top; - uint32_t chroma_loc_bottom; - uint32_t timing_info_present_flag; - uint32_t num_units_in_tick; - uint32_t time_scale; - uint32_t fixed_frame_rate_flag; - uint32_t nal_hrd_parameters_present_flag; - uint32_t cpb_cnt_minus1; - uint32_t bit_rate_scale; - uint32_t cpb_size_scale; - uint32_t bit_rate_value_minus; - uint32_t cpb_size_value_minus; - uint32_t cbr_flag; - uint32_t initial_cpb_removal_delay_length_minus1; - uint32_t cpb_removal_delay_length_minus1; - uint32_t dpb_output_delay_length_minus1; - uint32_t time_offset_length; - uint32_t low_delay_hrd_flag; - uint32_t pic_struct_present_flag; - uint32_t bitstream_restriction_present_flag; - uint32_t motion_vectors_over_pic_boundaries_flag; - uint32_t max_bytes_per_pic_denom; - uint32_t max_bits_per_mb_denom; - uint32_t log2_max_mv_length_hori; - uint32_t log2_max_mv_length_vert; - uint32_t num_reorder_frames; - uint32_t max_dec_frame_buffering; -}; - -struct rvce_enc_operation { - uint32_t insert_headers; - uint32_t picture_structure; - uint32_t allowed_max_bitstream_size; - uint32_t force_refresh_map; - uint32_t insert_aud; - uint32_t end_of_sequence; - uint32_t end_of_stream; - uint32_t input_picture_luma_address_hi; - uint32_t input_picture_luma_address_lo; - uint32_t input_picture_chroma_address_hi; - uint32_t input_picture_chroma_address_lo; - uint32_t enc_input_frame_y_pitch; - uint32_t enc_input_pic_luma_pitch; - uint32_t enc_input_pic_chroma_pitch; - ; - uint32_t enc_input_pic_addr_array; - uint32_t enc_input_pic_addr_array_disable2pipe_disablemboffload; - uint32_t enc_input_pic_tile_config; - uint32_t enc_pic_type; - uint32_t enc_idr_flag; - uint32_t enc_idr_pic_id; - uint32_t enc_mgs_key_pic; - uint32_t enc_reference_flag; - uint32_t enc_temporal_layer_index; - uint32_t num_ref_idx_active_override_flag; - uint32_t num_ref_idx_l0_active_minus1; - uint32_t num_ref_idx_l1_active_minus1; - uint32_t enc_ref_list_modification_op; - uint32_t enc_ref_list_modification_num; - uint32_t enc_decoded_picture_marking_op; - uint32_t enc_decoded_picture_marking_num; - uint32_t enc_decoded_picture_marking_idx; - uint32_t enc_decoded_ref_base_picture_marking_op; - uint32_t enc_decoded_ref_base_picture_marking_num; - uint32_t l0_picture_structure; - uint32_t l0_enc_pic_type; - uint32_t l0_frame_number; - uint32_t l0_picture_order_count; - uint32_t l0_luma_offset; - uint32_t l0_chroma_offset; - uint32_t l1_picture_structure; - uint32_t l1_enc_pic_type; - uint32_t l1_frame_number; - uint32_t l1_picture_order_count; - uint32_t l1_luma_offset; - uint32_t l1_chroma_offset; - uint32_t enc_reconstructed_luma_offset; - uint32_t enc_reconstructed_chroma_offset; - ; - uint32_t enc_coloc_buffer_offset; - uint32_t enc_reconstructed_ref_base_picture_luma_offset; - uint32_t enc_reconstructed_ref_base_picture_chroma_offset; - uint32_t enc_reference_ref_base_picture_luma_offset; - uint32_t enc_reference_ref_base_picture_chroma_offset; - uint32_t picture_count; - uint32_t frame_number; - uint32_t picture_order_count; - uint32_t num_i_pic_remain_in_rcgop; - uint32_t num_p_pic_remain_in_rcgop; - uint32_t num_b_pic_remain_in_rcgop; - uint32_t num_ir_pic_remain_in_rcgop; - uint32_t enable_intra_refresh; - uint32_t aq_variance_en; - uint32_t aq_block_size; - uint32_t aq_mb_variance_sel; - uint32_t aq_frame_variance_sel; - uint32_t aq_param_a; - uint32_t aq_param_b; - uint32_t aq_param_c; - uint32_t aq_param_d; - uint32_t aq_param_e; - uint32_t context_in_sfb; -}; - -struct rvce_enc_create { - uint32_t enc_use_circular_buffer; - uint32_t enc_profile; - uint32_t enc_level; - uint32_t enc_pic_struct_restriction; - uint32_t enc_image_width; - uint32_t enc_image_height; - uint32_t enc_ref_pic_luma_pitch; - uint32_t enc_ref_pic_chroma_pitch; - uint32_t enc_ref_y_height_in_qw; - uint32_t enc_ref_pic_addr_array_enc_pic_struct_restriction_disable_rdo; - uint32_t enc_pre_encode_context_buffer_offset; - uint32_t enc_pre_encode_input_luma_buffer_offset; - uint32_t enc_pre_encode_input_chroma_buffer_offset; - uint32_t enc_pre_encode_mode_chromaflag_vbaqmode_scenechangesensitivity; -}; - -struct rvce_config_ext { - uint32_t enc_enable_perf_logging; -}; - -struct rvce_h264_enc_pic { - struct rvce_rate_control rc; - struct rvce_motion_estimation me; - struct rvce_pic_control pc; - struct rvce_task_info ti; - struct rvce_feedback_buf_pkg fb; - struct rvce_rdo rdo; - struct rvce_vui vui; - struct rvce_enc_operation eo; - struct rvce_enc_create ec; - struct rvce_config_ext ce; - - unsigned quant_i_frames; - unsigned quant_p_frames; - unsigned quant_b_frames; - - enum pipe_h2645_enc_picture_type picture_type; - unsigned frame_num; - unsigned frame_num_cnt; - unsigned p_remain; - unsigned i_remain; - unsigned idr_pic_id; - unsigned gop_cnt; - unsigned gop_size; - unsigned pic_order_cnt; - unsigned ref_idx_l0; - unsigned ref_idx_l1; - unsigned addrmode_arraymode_disrdo_distwoinstants; - - bool not_referenced; - bool is_idr; - bool has_ref_pic_list; - bool enable_vui; - unsigned int ref_pic_list_0[32]; - unsigned int ref_pic_list_1[32]; - unsigned int frame_idx[32]; + unsigned index; + enum pipe_h264_enc_picture_type picture_type; + unsigned frame_num; + unsigned pic_order_cnt; }; /* VCE encoder representation */ struct rvce_encoder { - struct pipe_video_codec base; - - /* version specific packets */ - void (*session)(struct rvce_encoder *enc); - void (*create)(struct rvce_encoder *enc); - void (*feedback)(struct rvce_encoder *enc); - void (*rate_control)(struct rvce_encoder *enc); - void (*config_extension)(struct rvce_encoder *enc); - void (*pic_control)(struct rvce_encoder *enc); - void (*motion_estimation)(struct rvce_encoder *enc); - void (*rdo)(struct rvce_encoder *enc); - void (*vui)(struct rvce_encoder *enc); - void (*config)(struct rvce_encoder *enc); - void (*encode)(struct rvce_encoder *enc); - void (*destroy)(struct rvce_encoder *enc); - void (*task_info)(struct rvce_encoder *enc, uint32_t op, uint32_t dep, uint32_t fb_idx, - uint32_t ring_idx); - void (*si_get_pic_param)(struct rvce_encoder *enc, struct pipe_h264_enc_picture_desc *pic); - - unsigned stream_handle; - - struct pipe_screen *screen; - struct radeon_winsys *ws; - struct radeon_cmdbuf cs; - - rvce_get_buffer get_buffer; - - struct pb_buffer *handle; - struct radeon_surf *luma; - struct radeon_surf *chroma; - - struct pb_buffer *bs_handle; - unsigned bs_size; - - struct rvce_cpb_slot *cpb_array; - struct list_head cpb_slots; - unsigned cpb_num; - - struct rvid_buffer *fb; - struct rvid_buffer cpb; - struct pipe_h264_enc_picture_desc pic; - struct rvce_h264_enc_pic enc_pic; - - unsigned task_info_idx; - unsigned bs_idx; - - bool use_vm; - bool use_vui; - bool dual_pipe; - bool dual_inst; + struct pipe_video_codec base; + + /* version specific packets */ + void (*session)(struct rvce_encoder *enc); + void (*create)(struct rvce_encoder *enc); + void (*feedback)(struct rvce_encoder *enc); + void (*rate_control)(struct rvce_encoder *enc); + void (*config_extension)(struct rvce_encoder *enc); + void (*pic_control)(struct rvce_encoder *enc); + void (*motion_estimation)(struct rvce_encoder *enc); + void (*rdo)(struct rvce_encoder *enc); + void (*vui)(struct rvce_encoder *enc); + void (*config)(struct rvce_encoder *enc); + void (*encode)(struct rvce_encoder *enc); + void (*destroy)(struct rvce_encoder *enc); + void (*task_info)(struct rvce_encoder *enc, uint32_t op, + uint32_t dep, uint32_t fb_idx, + uint32_t ring_idx); + + unsigned stream_handle; + + struct pipe_screen *screen; + struct radeon_winsys* ws; + struct radeon_winsys_cs* cs; + + rvce_get_buffer get_buffer; + + struct radeon_winsys_cs_handle* handle; + struct radeon_surf* luma; + struct radeon_surf* chroma; + + struct radeon_winsys_cs_handle* bs_handle; + unsigned bs_size; + + struct rvce_cpb_slot *cpb_array; + struct list_head cpb_slots; + unsigned cpb_num; + + struct rvid_buffer *fb; + struct rvid_buffer cpb; + struct pipe_h264_enc_picture_desc pic; + + unsigned task_info_idx; + unsigned bs_idx; + + bool use_vm; + bool use_vui; + bool dual_pipe; + bool dual_inst; }; /* CPB handling functions */ -struct rvce_cpb_slot *si_current_slot(struct rvce_encoder *enc); -struct rvce_cpb_slot *si_l0_slot(struct rvce_encoder *enc); -struct rvce_cpb_slot *si_l1_slot(struct rvce_encoder *enc); -void si_vce_frame_offset(struct rvce_encoder *enc, struct rvce_cpb_slot *slot, signed *luma_offset, - signed *chroma_offset); +struct rvce_cpb_slot *current_slot(struct rvce_encoder *enc); +struct rvce_cpb_slot *l0_slot(struct rvce_encoder *enc); +struct rvce_cpb_slot *l1_slot(struct rvce_encoder *enc); +void rvce_frame_offset(struct rvce_encoder *enc, struct rvce_cpb_slot *slot, + signed *luma_offset, signed *chroma_offset); -struct pipe_video_codec *si_vce_create_encoder(struct pipe_context *context, - const struct pipe_video_codec *templat, - struct radeon_winsys *ws, - rvce_get_buffer get_buffer); +struct pipe_video_codec *rvce_create_encoder(struct pipe_context *context, + const struct pipe_video_codec *templat, + struct radeon_winsys* ws, + rvce_get_buffer get_buffer); -bool si_vce_is_fw_version_supported(struct si_screen *sscreen); +bool rvce_is_fw_version_supported(struct r600_common_screen *rscreen); -void si_vce_add_buffer(struct rvce_encoder *enc, struct pb_buffer *buf, unsigned usage, - enum radeon_bo_domain domain, signed offset); +void rvce_add_buffer(struct rvce_encoder *enc, struct radeon_winsys_cs_handle *buf, + enum radeon_bo_usage usage, enum radeon_bo_domain domain, + signed offset); /* init vce fw 40.2.2 specific callbacks */ -void si_vce_40_2_2_init(struct rvce_encoder *enc); +void radeon_vce_40_2_2_init(struct rvce_encoder *enc); /* init vce fw 50 specific callbacks */ -void si_vce_50_init(struct rvce_encoder *enc); - -/* init vce fw 52 specific callbacks */ -void si_vce_52_init(struct rvce_encoder *enc); - -/* get parameters for vce 40.2.2 */ -void si_vce_40_2_2_get_param(struct rvce_encoder *enc, struct pipe_h264_enc_picture_desc *pic); - -/* get parameters for vce 50 */ -void si_vce_50_get_param(struct rvce_encoder *enc, struct pipe_h264_enc_picture_desc *pic); - -/* get parameters for vce 52 */ -void si_vce_52_get_param(struct rvce_encoder *enc, struct pipe_h264_enc_picture_desc *pic); +void radeon_vce_50_init(struct rvce_encoder *enc); #endif diff --git a/lib/mesa/src/gallium/tests/graw/clear.c b/lib/mesa/src/gallium/tests/graw/clear.c index d46b9c90c..f38da4740 100644 --- a/lib/mesa/src/gallium/tests/graw/clear.c +++ b/lib/mesa/src/gallium/tests/graw/clear.c @@ -3,7 +3,7 @@ */ #include <stdio.h> -#include "frontend/graw.h" +#include "state_tracker/graw.h" #include "pipe/p_screen.h" #include "pipe/p_context.h" #include "pipe/p_state.h" @@ -28,12 +28,12 @@ static void draw( void ) { union pipe_color_union clear_color = { {1, 0, 1, 1} }; - ctx->clear(ctx, PIPE_CLEAR_COLOR, NULL, &clear_color, 0, 0); + ctx->clear(ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0); ctx->flush(ctx, NULL, 0); graw_save_surface_to_file(ctx, surf, NULL); - screen->flush_frontbuffer(screen, ctx, tex, 0, 0, window, NULL); + screen->flush_frontbuffer(screen, tex, 0, 0, window, NULL); } static void init( void ) @@ -61,11 +61,10 @@ static void init( void ) exit(1); } - ctx = screen->context_create(screen, NULL, 0); + ctx = screen->context_create(screen, NULL); if (ctx == NULL) exit(3); - memset(&templat, 0, sizeof(templat)); templat.target = PIPE_TEXTURE_2D; templat.format = formats[i]; templat.width0 = WIDTH; @@ -73,6 +72,7 @@ static void init( void ) templat.depth0 = 1; templat.array_size = 1; templat.last_level = 0; + templat.nr_samples = 1; templat.bind = (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET); diff --git a/lib/mesa/src/gallium/tests/graw/fragment-shader/frag-cb-1d.sh b/lib/mesa/src/gallium/tests/graw/fragment-shader/frag-cb-1d.sh index 097774336..85fb9ea4e 100644 --- a/lib/mesa/src/gallium/tests/graw/fragment-shader/frag-cb-1d.sh +++ b/lib/mesa/src/gallium/tests/graw/fragment-shader/frag-cb-1d.sh @@ -2,12 +2,12 @@ FRAG DCL IN[0], COLOR, LINEAR DCL OUT[0], COLOR -DCL CONST[0][1] -DCL CONST[0][3] +DCL CONST[1] +DCL CONST[3] DCL TEMP[0..1] -ADD TEMP[0], IN[0], CONST[0][1] -RCP TEMP[1], CONST[0][3].xxxx +ADD TEMP[0], IN[0], CONST[1] +RCP TEMP[1], CONST[3].xxxx MUL OUT[0], TEMP[0], TEMP[1] END diff --git a/lib/mesa/src/gallium/tests/graw/graw_util.h b/lib/mesa/src/gallium/tests/graw/graw_util.h index 3ea2c482d..e7cd0aa3a 100644 --- a/lib/mesa/src/gallium/tests/graw/graw_util.h +++ b/lib/mesa/src/gallium/tests/graw/graw_util.h @@ -1,5 +1,5 @@ -#include "frontend/graw.h" +#include "state_tracker/graw.h" #include "pipe/p_context.h" #include "pipe/p_defines.h" @@ -9,9 +9,8 @@ #include "util/u_box.h" #include "util/u_debug.h" -#include "util/u_debug_image.h" #include "util/u_draw_quad.h" -#include "util/format/u_format.h" +#include "util/u_format.h" #include "util/u_inlines.h" #include "util/u_memory.h" @@ -43,7 +42,6 @@ graw_util_create_window(struct graw_info *info, int i; memset(info, 0, sizeof(*info)); - memset(&resource_temp, 0, sizeof(resource_temp)); /* It's hard to say whether window or screen should be created * first. Different environments would prefer one or the other. @@ -62,7 +60,7 @@ graw_util_create_window(struct graw_info *info, return FALSE; } - info->ctx = info->screen->context_create(info->screen, NULL, 0); + info->ctx = info->screen->context_create(info->screen, NULL); if (info->ctx == NULL) { debug_printf("graw: Failed to create context\n"); return FALSE; @@ -77,6 +75,7 @@ graw_util_create_window(struct graw_info *info, resource_temp.depth0 = 1; resource_temp.array_size = 1; resource_temp.last_level = 0; + resource_temp.nr_samples = 1; resource_temp.bind = (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET); info->color_buf[i] = info->screen->resource_create(info->screen, @@ -108,6 +107,7 @@ graw_util_create_window(struct graw_info *info, resource_temp.depth0 = 1; resource_temp.array_size = 1; resource_temp.last_level = 0; + resource_temp.nr_samples = 1; resource_temp.bind = PIPE_BIND_DEPTH_STENCIL; info->zs_buf = info->screen->resource_create(info->screen, &resource_temp); if (!info->zs_buf) { @@ -160,9 +160,9 @@ graw_util_default_state(struct graw_info *info, boolean depth_test) struct pipe_depth_stencil_alpha_state depthStencilAlpha; void *handle; memset(&depthStencilAlpha, 0, sizeof depthStencilAlpha); - depthStencilAlpha.depth_enabled = depth_test; - depthStencilAlpha.depth_writemask = 1; - depthStencilAlpha.depth_func = PIPE_FUNC_LESS; + depthStencilAlpha.depth.enabled = depth_test; + depthStencilAlpha.depth.writemask = 1; + depthStencilAlpha.depth.func = PIPE_FUNC_LESS; handle = info->ctx->create_depth_stencil_alpha_state(info->ctx, &depthStencilAlpha); info->ctx->bind_depth_stencil_alpha_state(info->ctx, handle); @@ -201,11 +201,6 @@ graw_util_viewport(struct graw_info *info, vp.translate[1] = half_height + y; vp.translate[2] = half_depth + z; - vp.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X; - vp.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y; - vp.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z; - vp.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W; - info->ctx->set_viewport_states(info->ctx, 0, 1, &vp); } @@ -213,7 +208,7 @@ graw_util_viewport(struct graw_info *info, static inline void graw_util_flush_front(const struct graw_info *info) { - info->screen->flush_frontbuffer(info->screen, info->ctx, info->color_buf[0], + info->screen->flush_frontbuffer(info->screen, info->color_buf[0], 0, 0, info->window, NULL); } @@ -228,7 +223,6 @@ graw_util_create_tex2d(const struct graw_info *info, struct pipe_resource temp, *tex; struct pipe_box box; - memset(&temp, 0, sizeof(temp)); temp.target = PIPE_TEXTURE_2D; temp.format = format; temp.width0 = width; @@ -236,6 +230,7 @@ graw_util_create_tex2d(const struct graw_info *info, temp.depth0 = 1; temp.last_level = 0; temp.array_size = 1; + temp.nr_samples = 1; temp.bind = PIPE_BIND_SAMPLER_VIEW; tex = info->screen->resource_create(info->screen, &temp); @@ -246,14 +241,14 @@ graw_util_create_tex2d(const struct graw_info *info, u_box_2d(0, 0, width, height, &box); - info->ctx->texture_subdata(info->ctx, - tex, - 0, - PIPE_MAP_WRITE, - &box, - data, - row_stride, - image_bytes); + info->ctx->transfer_inline_write(info->ctx, + tex, + 0, + PIPE_TRANSFER_WRITE, + &box, + data, + row_stride, + image_bytes); /* Possibly read back & compare against original data: */ @@ -261,19 +256,21 @@ graw_util_create_tex2d(const struct graw_info *info, { struct pipe_transfer *t; uint32_t *ptr; - t = pipe_texture_map(info->ctx, samptex, + t = pipe_transfer_map(info->ctx, samptex, 0, 0, /* level, layer */ - PIPE_MAP_READ, + PIPE_TRANSFER_READ, 0, 0, SIZE, SIZE); /* x, y, width, height */ - ptr = info->ctx->texture_map(info->ctx, t); + ptr = info->ctx->transfer_map(info->ctx, t); if (memcmp(ptr, tex2d, sizeof tex2d) != 0) { assert(0); exit(9); } - info->ctx->texture_unmap(info->ctx, t); + info->ctx->transfer_unmap(info->ctx, t); + + info->ctx->transfer_destroy(info->ctx, t); } #endif @@ -317,10 +314,10 @@ graw_util_create_simple_sampler_view(const struct graw_info *info, memset(&sv_temp, 0, sizeof(sv_temp)); sv_temp.format = texture->format; sv_temp.texture = texture; - sv_temp.swizzle_r = PIPE_SWIZZLE_X; - sv_temp.swizzle_g = PIPE_SWIZZLE_Y; - sv_temp.swizzle_b = PIPE_SWIZZLE_Z; - sv_temp.swizzle_a = PIPE_SWIZZLE_W; + sv_temp.swizzle_r = PIPE_SWIZZLE_RED; + sv_temp.swizzle_g = PIPE_SWIZZLE_GREEN; + sv_temp.swizzle_b = PIPE_SWIZZLE_BLUE; + sv_temp.swizzle_a = PIPE_SWIZZLE_ALPHA; sv = info->ctx->create_sampler_view(info->ctx, texture, &sv_temp); diff --git a/lib/mesa/src/gallium/tests/graw/vertex-shader/vert-cb-1d.sh b/lib/mesa/src/gallium/tests/graw/vertex-shader/vert-cb-1d.sh index 0b05ca8b6..e227917fd 100644 --- a/lib/mesa/src/gallium/tests/graw/vertex-shader/vert-cb-1d.sh +++ b/lib/mesa/src/gallium/tests/graw/vertex-shader/vert-cb-1d.sh @@ -4,13 +4,13 @@ DCL IN[0] DCL IN[1] DCL OUT[0], POSITION DCL OUT[1], COLOR -DCL CONST[0][1] -DCL CONST[0][3] +DCL CONST[1] +DCL CONST[3] DCL TEMP[0..1] MOV OUT[0], IN[0] -ADD TEMP[0], IN[1], CONST[0][1] -RCP TEMP[1], CONST[0][3].xxxx +ADD TEMP[0], IN[1], CONST[1] +RCP TEMP[1], CONST[3].xxxx MUL OUT[1], TEMP[0], TEMP[1] END diff --git a/lib/mesa/src/util/simple_list.h b/lib/mesa/src/util/simple_list.h index 709915b27..5f261612a 100644 --- a/lib/mesa/src/util/simple_list.h +++ b/lib/mesa/src/util/simple_list.h @@ -4,7 +4,7 @@ * * Intended to work with a list sentinal which is created as an empty * list. Insert & delete are O(1). - * + * * \author * (C) 1997, Keith Whitwell */ @@ -159,19 +159,19 @@ do { \ /** * Test whether element is at end of the list. - * + * * \param list list. * \param elem element. - * + * * \return non-zero if element is at end of list, or zero otherwise. */ #define at_end(list, elem) ((elem) == (list)) /** * Test if a list is empty. - * + * * \param list list. - * + * * \return non-zero if list empty, or zero otherwise. */ #define is_empty_list(list) ((list)->next == (list)) @@ -193,7 +193,7 @@ do { \ * * Same as #foreach but lets you unlink the current value during a list * traversal. Useful for freeing a list, element by element. - * + * * \param ptr pointer to the current element. * \param t temporary pointer. * \param list list. |