Example #1
0
static int get_context_size(struct drm_device *dev)
{
    struct drm_i915_private *dev_priv = dev->dev_private;
    int ret;
    u32 reg;

    switch (INTEL_INFO(dev)->gen) {
    case 6:
        reg = I915_READ(CXT_SIZE);
        ret = GEN6_CXT_TOTAL_SIZE(reg) * 64;
        break;
    case 7:
        reg = I915_READ(GEN7_CXT_SIZE);
        if (IS_HASWELL(dev))
            ret = HSW_CXT_TOTAL_SIZE;
        else
            ret = GEN7_CXT_TOTAL_SIZE(reg) * 64;
        break;
    case 8:
        ret = GEN8_CXT_TOTAL_SIZE;
        break;
    default:
        BUG();
    }

    return ret;
}
Example #2
0
static int get_context_size(struct drm_device *dev)
{
	struct drm_i915_private *dev_priv = dev->dev_private;
	int ret;
	u32 reg;

	switch (INTEL_INFO(dev)->gen) {
	case 6:
		reg = I915_READ(CXT_SIZE);
		ret = GEN6_CXT_TOTAL_SIZE(reg) * 64;
		break;
	case 7:
		reg = I915_READ(GEN7_CXT_SIZE);
#ifdef FREEBSD_WIP
		if (IS_HASWELL(dev))
			ret = HSW_CXT_TOTAL_SIZE(reg) * 64;
		else
#endif
			ret = GEN7_CXT_TOTAL_SIZE(reg) * 64;
		break;
	default:
		panic("i915_gem_context: Unsupported Intel GPU generation %d",
		    INTEL_INFO(dev)->gen);
	}

	return ret;
}