Rev 2332 | Rev 2336 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2332 | Rev 2335 | ||
---|---|---|---|
Line 1918... | Line 1918... | ||
1918 | DRM_DEBUG_KMS("unsupported config, disabling FBC\n"); |
1918 | DRM_DEBUG_KMS("unsupported config, disabling FBC\n"); |
1919 | intel_disable_fbc(dev); |
1919 | intel_disable_fbc(dev); |
1920 | } |
1920 | } |
1921 | } |
1921 | } |
Line -... | Line 1922... | ||
- | 1922 | ||
- | 1923 | int |
|
- | 1924 | intel_pin_and_fence_fb_obj(struct drm_device *dev, |
|
- | 1925 | struct drm_i915_gem_object *obj, |
|
- | 1926 | struct intel_ring_buffer *pipelined) |
|
- | 1927 | { |
|
- | 1928 | struct drm_i915_private *dev_priv = dev->dev_private; |
|
- | 1929 | u32 alignment; |
|
Line -... | Line 1930... | ||
- | 1930 | int ret; |
|
- | 1931 | ||
- | 1932 | switch (obj->tiling_mode) { |
|
- | 1933 | case I915_TILING_NONE: |
|
- | 1934 | if (IS_BROADWATER(dev) || IS_CRESTLINE(dev)) |
|
- | 1935 | alignment = 128 * 1024; |
|
- | 1936 | else if (INTEL_INFO(dev)->gen >= 4) |
|
- | 1937 | alignment = 4 * 1024; |
|
- | 1938 | else |
|
- | 1939 | alignment = 64 * 1024; |
|
- | 1940 | break; |
|
- | 1941 | case I915_TILING_X: |
|
- | 1942 | /* pin() will align the object as required by fence */ |
|
- | 1943 | alignment = 0; |
|
- | 1944 | break; |
|
- | 1945 | case I915_TILING_Y: |
|
- | 1946 | /* FIXME: Is this true? */ |
|
- | 1947 | DRM_ERROR("Y tiled not allowed for scan out buffers\n"); |
|
- | 1948 | return -EINVAL; |
|
- | 1949 | default: |
|
Line -... | Line 1950... | ||
- | 1950 | BUG(); |
|
- | 1951 | } |
|
- | 1952 | ||
- | 1953 | dev_priv->mm.interruptible = false; |
|
Line -... | Line 1954... | ||
- | 1954 | ret = i915_gem_object_pin_to_display_plane(obj, alignment, pipelined); |
|
- | 1955 | if (ret) |
|
- | 1956 | goto err_interruptible; |
|
- | 1957 | ||
- | 1958 | /* Install a fence for tiled scan-out. Pre-i965 always needs a |
|
- | 1959 | * fence, whereas 965+ only requires a fence if using |
|
- | 1960 | * framebuffer compression. For simplicity, we always install |
|
- | 1961 | * a fence as the cost is not that onerous. |
|
- | 1962 | */ |
|
- | 1963 | // if (obj->tiling_mode != I915_TILING_NONE) { |
|
Line -... | Line 1964... | ||
- | 1964 | // ret = i915_gem_object_get_fence(obj, pipelined); |
|
- | 1965 | // if (ret) |
|
Line 1922... | Line 1966... | ||
1922 | 1966 | // goto err_unpin; |
|
- | 1967 | // } |
|
- | 1968 | ||
- | 1969 | dev_priv->mm.interruptible = true; |
|
- | 1970 | return 0; |
|
1923 | 1971 | ||
Line 1924... | Line 1972... | ||
1924 | 1972 | err_unpin: |
|
1925 | 1973 | // i915_gem_object_unpin(obj); |
|
1926 | 1974 | err_interruptible: |
|
1927 | 1975 | dev_priv->mm.interruptible = true; |
|
Line -... | Line 6554... | ||
- | 6554 | ||
- | 6555 | ||
- | 6556 | ||
- | 6557 | ||
Line -... | Line 6558... | ||
- | 6558 | ||
- | 6559 | static const struct drm_framebuffer_funcs intel_fb_funcs = { |
|
- | 6560 | // .destroy = intel_user_framebuffer_destroy, |
|
- | 6561 | // .create_handle = intel_user_framebuffer_create_handle, |
|
- | 6562 | }; |
|
- | 6563 | ||
Line -... | Line 6564... | ||
- | 6564 | int intel_framebuffer_init(struct drm_device *dev, |
|
- | 6565 | struct intel_framebuffer *intel_fb, |
|
Line -... | Line 6566... | ||
- | 6566 | struct drm_mode_fb_cmd *mode_cmd, |
|
- | 6567 | struct drm_i915_gem_object *obj) |
|
Line -... | Line 6568... | ||
- | 6568 | { |
|
- | 6569 | int ret; |
|
- | 6570 | ||
- | 6571 | if (obj->tiling_mode == I915_TILING_Y) |
|
- | 6572 | return -EINVAL; |
|
- | 6573 | ||
- | 6574 | if (mode_cmd->pitch & 63) |
|
Line -... | Line 6575... | ||
- | 6575 | return -EINVAL; |
|
- | 6576 | ||
- | 6577 | switch (mode_cmd->bpp) { |
|
- | 6578 | case 8: |
|
- | 6579 | case 16: |
|
- | 6580 | /* Only pre-ILK can handle 5:5:5 */ |
|
Line -... | Line 6581... | ||
- | 6581 | if (mode_cmd->depth == 15 && !HAS_PCH_SPLIT(dev)) |
|
- | 6582 | return -EINVAL; |
|
- | 6583 | break; |
|
- | 6584 | ||
- | 6585 | case 24: |
|
Line -... | Line 6586... | ||
- | 6586 | case 32: |
|
- | 6587 | break; |
|
- | 6588 | default: |
|
- | 6589 | return -EINVAL; |
|
Line 7526... | Line 7610... | ||
7526 | dev->mode_config.max_height = 4096; |
7610 | dev->mode_config.max_height = 4096; |
7527 | } else { |
7611 | } else { |
7528 | dev->mode_config.max_width = 8192; |
7612 | dev->mode_config.max_width = 8192; |
7529 | dev->mode_config.max_height = 8192; |
7613 | dev->mode_config.max_height = 8192; |
7530 | } |
7614 | } |
7531 | - | ||
7532 | dev->mode_config.fb_base = get_bus_addr(); |
7615 | dev->mode_config.fb_base = get_bus_addr(); |
Line 7533... | Line 7616... | ||
7533 | 7616 | ||
7534 | DRM_DEBUG_KMS("%d display pipe%s available.\n", |
7617 | DRM_DEBUG_KMS("%d display pipe%s available.\n", |