Rev 6088 | Rev 6296 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6088 | Rev 6283 | ||
---|---|---|---|
Line 3203... | Line 3203... | ||
3203 | dev_priv->display.update_primary_plane(crtc, fb, x, y); |
3203 | dev_priv->display.update_primary_plane(crtc, fb, x, y); |
Line 3204... | Line 3204... | ||
3204 | 3204 | ||
3205 | return 0; |
3205 | return 0; |
Line 3206... | Line -... | ||
3206 | } |
- | |
3207 | 3206 | } |
|
3208 | #if 0 |
3207 | |
3209 | static void intel_complete_page_flips(struct drm_device *dev) |
3208 | static void intel_complete_page_flips(struct drm_device *dev) |
Line 3210... | Line 3209... | ||
3210 | { |
3209 | { |
Line 3300... | Line 3299... | ||
3300 | dev_priv->display.hpd_irq_setup(dev); |
3299 | dev_priv->display.hpd_irq_setup(dev); |
3301 | spin_unlock_irq(&dev_priv->irq_lock); |
3300 | spin_unlock_irq(&dev_priv->irq_lock); |
Line 3302... | Line 3301... | ||
3302 | 3301 | ||
Line 3303... | Line 3302... | ||
3303 | intel_display_resume(dev); |
3302 | intel_display_resume(dev); |
Line 3304... | Line 3303... | ||
3304 | 3303 | ||
3305 | intel_hpd_init(dev_priv); |
3304 | // intel_hpd_init(dev_priv); |
Line 3306... | Line 3305... | ||
3306 | 3305 | ||
Line 3348... | Line 3347... | ||
3348 | pending = to_intel_crtc(crtc)->unpin_work != NULL; |
3347 | pending = to_intel_crtc(crtc)->unpin_work != NULL; |
3349 | spin_unlock_irq(&dev->event_lock); |
3348 | spin_unlock_irq(&dev->event_lock); |
Line 3350... | Line 3349... | ||
3350 | 3349 | ||
3351 | return pending; |
3350 | return pending; |
3352 | } |
- | |
Line 3353... | Line 3351... | ||
3353 | #endif |
3351 | } |
3354 | 3352 | ||
3355 | static void intel_update_pipe_config(struct intel_crtc *crtc, |
3353 | static void intel_update_pipe_config(struct intel_crtc *crtc, |
3356 | struct intel_crtc_state *old_crtc_state) |
3354 | struct intel_crtc_state *old_crtc_state) |
Line 3929... | Line 3927... | ||
3929 | } |
3927 | } |
Line 3930... | Line 3928... | ||
3930 | 3928 | ||
3931 | return false; |
3929 | return false; |
Line -... | Line 3930... | ||
- | 3930 | } |
|
- | 3931 | ||
- | 3932 | static void page_flip_completed(struct intel_crtc *intel_crtc) |
|
- | 3933 | { |
|
- | 3934 | struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev); |
|
- | 3935 | struct intel_unpin_work *work = intel_crtc->unpin_work; |
|
- | 3936 | ||
- | 3937 | /* ensure that the unpin work is consistent wrt ->pending. */ |
|
- | 3938 | smp_rmb(); |
|
- | 3939 | intel_crtc->unpin_work = NULL; |
|
- | 3940 | ||
- | 3941 | if (work->event) |
|
- | 3942 | drm_send_vblank_event(intel_crtc->base.dev, |
|
- | 3943 | intel_crtc->pipe, |
|
- | 3944 | work->event); |
|
- | 3945 | ||
- | 3946 | drm_crtc_vblank_put(&intel_crtc->base); |
|
- | 3947 | ||
- | 3948 | // wake_up_all(&dev_priv->pending_flip_queue); |
|
- | 3949 | // queue_work(dev_priv->wq, &work->work); |
|
- | 3950 | ||
- | 3951 | // trace_i915_flip_complete(intel_crtc->plane, |
|
3932 | } |
3952 | // work->pending_flip_obj); |
3933 | 3953 | } |
|
3934 | #if 0 |
3954 | #if 0 |
3935 | void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc) |
3955 | void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc) |
3936 | { |
3956 | { |
Line 8055... | Line 8075... | ||
8055 | val = I915_READ(PIPESRC(pipe)); |
8075 | val = I915_READ(PIPESRC(pipe)); |
8056 | fb->width = ((val >> 16) & 0xfff) + 1; |
8076 | fb->width = ((val >> 16) & 0xfff) + 1; |
8057 | fb->height = ((val >> 0) & 0xfff) + 1; |
8077 | fb->height = ((val >> 0) & 0xfff) + 1; |
Line 8058... | Line 8078... | ||
8058 | 8078 | ||
8059 | val = I915_READ(DSPSTRIDE(pipe)); |
8079 | val = I915_READ(DSPSTRIDE(pipe)); |
8060 | // fb->pitches[0] = val & 0xffffffc0; |
- | |
Line 8061... | Line 8080... | ||
8061 | fb->pitches[0] = 2560*4; |
8080 | fb->pitches[0] = val & 0xffffffc0; |
8062 | 8081 | ||
8063 | aligned_height = intel_fb_align_height(dev, fb->height, |
8082 | aligned_height = intel_fb_align_height(dev, fb->height, |
Line 8064... | Line 8083... | ||
8064 | fb->pixel_format, |
8083 | fb->pixel_format, |
8065 | fb->modifier[0]); |
- | |
Line 8066... | Line 8084... | ||
8066 | 8084 | fb->modifier[0]); |
|
8067 | // plane_config->size = fb->pitches[0] * aligned_height; |
8085 | |
8068 | plane_config->size = i915.fbsize*1024*1024; |
8086 | plane_config->size = fb->pitches[0] * aligned_height; |
8069 | 8087 | ||
Line 9121... | Line 9139... | ||
9121 | fb->width = ((val >> 0) & 0x1fff) + 1; |
9139 | fb->width = ((val >> 0) & 0x1fff) + 1; |
Line 9122... | Line 9140... | ||
9122 | 9140 | ||
9123 | val = I915_READ(PLANE_STRIDE(pipe, 0)); |
9141 | val = I915_READ(PLANE_STRIDE(pipe, 0)); |
9124 | stride_mult = intel_fb_stride_alignment(dev, fb->modifier[0], |
9142 | stride_mult = intel_fb_stride_alignment(dev, fb->modifier[0], |
9125 | fb->pixel_format); |
9143 | fb->pixel_format); |
9126 | // fb->pitches[0] = (val & 0x3ff) * stride_mult; |
- | |
Line 9127... | Line 9144... | ||
9127 | fb->pitches[0] = 2560*4; |
9144 | fb->pitches[0] = (val & 0x3ff) * stride_mult; |
9128 | 9145 | ||
9129 | aligned_height = intel_fb_align_height(dev, fb->height, |
9146 | aligned_height = intel_fb_align_height(dev, fb->height, |
Line 9130... | Line 9147... | ||
9130 | fb->pixel_format, |
9147 | fb->pixel_format, |
9131 | fb->modifier[0]); |
- | |
Line 9132... | Line 9148... | ||
9132 | 9148 | fb->modifier[0]); |
|
9133 | // plane_config->size = fb->pitches[0] * aligned_height; |
9149 | |
9134 | plane_config->size = i915.fbsize*1024*1024; |
9150 | plane_config->size = fb->pitches[0] * aligned_height; |
9135 | 9151 | ||
Line 9220... | Line 9236... | ||
9220 | val = I915_READ(PIPESRC(pipe)); |
9236 | val = I915_READ(PIPESRC(pipe)); |
9221 | fb->width = ((val >> 16) & 0xfff) + 1; |
9237 | fb->width = ((val >> 16) & 0xfff) + 1; |
9222 | fb->height = ((val >> 0) & 0xfff) + 1; |
9238 | fb->height = ((val >> 0) & 0xfff) + 1; |
Line 9223... | Line 9239... | ||
9223 | 9239 | ||
9224 | val = I915_READ(DSPSTRIDE(pipe)); |
9240 | val = I915_READ(DSPSTRIDE(pipe)); |
9225 | // fb->pitches[0] = val & 0xffffffc0; |
- | |
Line 9226... | Line 9241... | ||
9226 | fb->pitches[0] = 2560*4; |
9241 | fb->pitches[0] = val & 0xffffffc0; |
9227 | 9242 | ||
9228 | aligned_height = intel_fb_align_height(dev, fb->height, |
9243 | aligned_height = intel_fb_align_height(dev, fb->height, |
Line 9229... | Line 9244... | ||
9229 | fb->pixel_format, |
9244 | fb->pixel_format, |
9230 | fb->modifier[0]); |
- | |
Line 9231... | Line 9245... | ||
9231 | 9245 | fb->modifier[0]); |
|
9232 | // plane_config->size = fb->pitches[0] * aligned_height; |
9246 | |
9233 | plane_config->size = i915.fbsize*1024*1024; |
9247 | plane_config->size = fb->pitches[0] * aligned_height; |
9234 | 9248 | ||
Line 10746... | Line 10760... | ||
10746 | drm_crtc_cleanup(crtc); |
10760 | drm_crtc_cleanup(crtc); |
Line 10747... | Line 10761... | ||
10747 | 10761 | ||
10748 | kfree(intel_crtc); |
10762 | kfree(intel_crtc); |
Line 10749... | Line -... | ||
10749 | } |
- | |
10750 | 10763 | } |
|
10751 | #if 0 |
10764 | |
10752 | static void intel_unpin_work_fn(struct work_struct *__work) |
10765 | static void intel_unpin_work_fn(struct work_struct *__work) |
10753 | { |
10766 | { |
10754 | struct intel_unpin_work *work = |
10767 | struct intel_unpin_work *work = |
Line 10895... | Line 10908... | ||
10895 | smp_wmb(); |
10908 | smp_wmb(); |
10896 | atomic_set(&work->pending, INTEL_FLIP_PENDING); |
10909 | atomic_set(&work->pending, INTEL_FLIP_PENDING); |
10897 | /* and that it is marked active as soon as the irq could fire. */ |
10910 | /* and that it is marked active as soon as the irq could fire. */ |
10898 | smp_wmb(); |
10911 | smp_wmb(); |
10899 | } |
10912 | } |
10900 | 10913 | #if 0 |
|
10901 | static int intel_gen2_queue_flip(struct drm_device *dev, |
10914 | static int intel_gen2_queue_flip(struct drm_device *dev, |
10902 | struct drm_crtc *crtc, |
10915 | struct drm_crtc *crtc, |
10903 | struct drm_framebuffer *fb, |
10916 | struct drm_framebuffer *fb, |
10904 | struct drm_i915_gem_object *obj, |
10917 | struct drm_i915_gem_object *obj, |
10905 | struct drm_i915_gem_request *req, |
10918 | struct drm_i915_gem_request *req, |
Line 11376... | Line 11389... | ||
11376 | if (work != NULL && |
11389 | if (work != NULL && |
11377 | drm_vblank_count(dev, pipe) - work->flip_queued_vblank > 1) |
11390 | drm_vblank_count(dev, pipe) - work->flip_queued_vblank > 1) |
11378 | intel_queue_rps_boost_for_request(dev, work->flip_queued_req); |
11391 | intel_queue_rps_boost_for_request(dev, work->flip_queued_req); |
11379 | spin_unlock(&dev->event_lock); |
11392 | spin_unlock(&dev->event_lock); |
11380 | } |
11393 | } |
11381 | 11394 | #endif |
|
11382 | static int intel_crtc_page_flip(struct drm_crtc *crtc, |
11395 | static int intel_crtc_page_flip(struct drm_crtc *crtc, |
11383 | struct drm_framebuffer *fb, |
11396 | struct drm_framebuffer *fb, |
11384 | struct drm_pending_vblank_event *event, |
11397 | struct drm_pending_vblank_event *event, |
11385 | uint32_t page_flip_flags) |
11398 | uint32_t page_flip_flags) |
11386 | { |
11399 | { |
Line 11426... | Line 11439... | ||
11426 | return -ENOMEM; |
11439 | return -ENOMEM; |
Line 11427... | Line 11440... | ||
11427 | 11440 | ||
11428 | work->event = event; |
11441 | work->event = event; |
11429 | work->crtc = crtc; |
11442 | work->crtc = crtc; |
11430 | work->old_fb = old_fb; |
11443 | work->old_fb = old_fb; |
Line 11431... | Line 11444... | ||
11431 | INIT_WORK(&work->work, intel_unpin_work_fn); |
11444 | // INIT_WORK(&work->work, intel_unpin_work_fn); |
11432 | 11445 | ||
11433 | ret = drm_crtc_vblank_get(crtc); |
11446 | ret = drm_crtc_vblank_get(crtc); |
Line 11608... | Line 11621... | ||
11608 | spin_unlock_irq(&dev->event_lock); |
11621 | spin_unlock_irq(&dev->event_lock); |
11609 | } |
11622 | } |
11610 | } |
11623 | } |
11611 | return ret; |
11624 | return ret; |
11612 | } |
11625 | } |
11613 | #endif |
- | |
Line 11614... | Line 11626... | ||
11614 | 11626 | ||
11615 | 11627 | ||
11616 | /** |
11628 | /** |
Line 14427... | Line 14439... | ||
14427 | ret = drm_framebuffer_init(dev, &intel_fb->base, &intel_fb_funcs); |
14439 | ret = drm_framebuffer_init(dev, &intel_fb->base, &intel_fb_funcs); |
14428 | if (ret) { |
14440 | if (ret) { |
14429 | DRM_ERROR("framebuffer init failed %d\n", ret); |
14441 | DRM_ERROR("framebuffer init failed %d\n", ret); |
14430 | return ret; |
14442 | return ret; |
14431 | } |
14443 | } |
- | 14444 | kolibri_framebuffer_init(intel_fb); |
|
Line 14432... | Line 14445... | ||
14432 | 14445 | ||
14433 | return 0; |
14446 | return 0; |
Line 14434... | Line 14447... | ||
14434 | } |
14447 | } |
Line 14935... | Line 14948... | ||
14935 | /* |
14948 | /* |
14936 | * If the fb is shared between multiple heads, we'll |
14949 | * If the fb is shared between multiple heads, we'll |
14937 | * just get the first one. |
14950 | * just get the first one. |
14938 | */ |
14951 | */ |
14939 | intel_find_initial_plane_obj(crtc, &plane_config); |
14952 | intel_find_initial_plane_obj(crtc, &plane_config); |
14940 | if(!main_fb_obj) |
- | |
14941 | { |
- | |
14942 | struct drm_framebuffer *fb; |
- | |
14943 | - | ||
14944 | fb = crtc->base.primary->fb; |
- | |
14945 | main_fb_obj = intel_fb_obj(fb); |
- | |
14946 | main_fb_obj->map_and_fenceable=true; |
- | |
14947 | DRM_DEBUG_KMS("main_fb_obj %p gtt_offset 0x%08lx\n", main_fb_obj, i915_gem_obj_ggtt_offset(main_fb_obj)); |
- | |
14948 | } |
- | |
14949 | - | ||
14950 | } |
14953 | } |
14951 | } |
14954 | } |
Line 14952... | Line 14955... | ||
14952 | 14955 | ||
14953 | static void intel_enable_pipe_a(struct drm_device *dev) |
14956 | static void intel_enable_pipe_a(struct drm_device *dev) |