#define HAS_VC1(ctx) (IS_GEN6((ctx)->intel.device_id))
+/* Defined to 1 if GPU supports H.264 decoding */
+/* XXX: drop IS_IRONLAKE(ctx) check once G4X support is available */
+#define HAS_H264(ctx) (IS_GEN6((ctx)->intel.device_id) || \
+ (IS_IRONLAKE((ctx)->intel.device_id) && \
+ (ctx)->intel.has_bsd))
+
enum {
I965_SURFACETYPE_RGBA = 1,
I965_SURFACETYPE_YUV,
profile_list[i++] = VAProfileMPEG2Simple;
profile_list[i++] = VAProfileMPEG2Main;
- profile_list[i++] = VAProfileH264Baseline;
- profile_list[i++] = VAProfileH264Main;
- profile_list[i++] = VAProfileH264High;
+
+ if (HAS_H264(i965)) {
+ profile_list[i++] = VAProfileH264Baseline;
+ profile_list[i++] = VAProfileH264Main;
+ profile_list[i++] = VAProfileH264High;
+ }
if (HAS_VC1(i965)) {
profile_list[i++] = VAProfileVC1Simple;
case VAProfileH264Baseline:
case VAProfileH264Main:
case VAProfileH264High:
- entrypoint_list[n++] = VAEntrypointVLD;
+ if (HAS_H264(i965))
+ entrypoint_list[n++] = VAEntrypointVLD;
break;
case VAProfileVC1Simple:
case VAProfileH264Baseline:
case VAProfileH264Main:
case VAProfileH264High:
- if (VAEntrypointVLD == entrypoint) {
+ if (HAS_H264(i965) && VAEntrypointVLD == entrypoint) {
vaStatus = VA_STATUS_SUCCESS;
} else {
vaStatus = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
VAStatus
i965_DestroyConfig(VADriverContextP ctx, VAConfigID config_id)
{
+ struct intel_driver_data * const intel = intel_driver_data(ctx);
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct object_config *obj_config = CONFIG(config_id);
VAStatus vaStatus;
return vaStatus;
}
- if (IS_GEN6(i965->intel.device_id))
+ switch (obj_config->profile) {
+ case VAProfileH264Baseline:
+ case VAProfileH264Main:
+ case VAProfileH264High:
+ if (!HAS_H264(i965))
+ return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
render_state->interleaved_uv = 1;
- else {
- switch (obj_config->profile) {
- case VAProfileH264Baseline:
- case VAProfileH264Main:
- case VAProfileH264High:
- render_state->interleaved_uv = 1;
- break;
- default:
- render_state->interleaved_uv = 0;
- }
+ break;
+ default:
+ render_state->interleaved_uv = !!IS_GEN6(i965->intel.device_id);
+ break;
}
obj_context->context_id = contextID;
VAContextID context,
VASurfaceID render_target)
{
+ struct intel_driver_data * const intel = intel_driver_data(ctx);
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct object_context *obj_context = CONTEXT(context);
struct object_surface *obj_surface = SURFACE(render_target);
intel->batch->run = drm_intel_bo_mrb_exec;
intel_batchbuffer_reset(intel->batch);
- intel->batch_bcs = calloc(1, sizeof(*(intel->batch_bcs)));
- assert(intel->batch_bcs);
- intel->batch_bcs->intel = intel;
- intel->batch_bcs->flag = I915_EXEC_BSD;
- intel->batch_bcs->run = drm_intel_bo_mrb_exec;
- intel_batchbuffer_reset(intel->batch_bcs);
+ if (intel->has_bsd) {
+ intel->batch_bcs = calloc(1, sizeof(*(intel->batch_bcs)));
+ assert(intel->batch_bcs);
+ intel->batch_bcs->intel = intel;
+ intel->batch_bcs->flag = I915_EXEC_BSD;
+ intel->batch_bcs->run = drm_intel_bo_mrb_exec;
+ intel_batchbuffer_reset(intel->batch_bcs);
+ }
return True;
}
static Bool
intel_driver_get_param(struct intel_driver_data *intel, int param, int *value)
{
- int ret;
struct drm_i915_getparam gp;
gp.param = param;
gp.value = value;
- ret = drmCommandWriteRead(intel->fd, DRM_I915_GETPARAM, &gp, sizeof(gp));
- assert(ret == 0);
-
- return True;
+ return drmCommandWriteRead(intel->fd, DRM_I915_GETPARAM, &gp, sizeof(gp)) == 0;
}
Bool
{
struct intel_driver_data *intel = intel_driver_data(ctx);
struct dri_state *dri_state = (struct dri_state *)ctx->dri_state;
+ int has_exec2, has_bsd, has_blt;
assert(dri_state);
assert(dri_state->driConnectedFlag == VA_DRI2 ||
pthread_mutex_init(&intel->ctxmutex, NULL);
intel_driver_get_param(intel, I915_PARAM_CHIPSET_ID, &intel->device_id);
+ if (intel_driver_get_param(intel, I915_PARAM_HAS_EXECBUF2, &has_exec2))
+ intel->has_exec2 = has_exec2;
+ if (intel_driver_get_param(intel, I915_PARAM_HAS_BSD, &has_bsd))
+ intel->has_bsd = has_bsd;
+ if (intel_driver_get_param(intel, I915_PARAM_HAS_BLT, &has_blt))
+ intel->has_blt = has_blt;
+
intel_memman_init(intel);
intel_batchbuffer_init(intel);