From: Dave Airlie Date: Mon, 9 Mar 2015 09:58:30 +0000 (+1000) Subject: Merge tag 'v4.0-rc3' into drm-next X-Git-Tag: v4.1~277^2~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a8c6ecb3be7029881f7c95e5e201a629094a4e1a;p=platform%2Fkernel%2Flinux-amlogic.git Merge tag 'v4.0-rc3' into drm-next Linux 4.0-rc3 backmerge to fix two i915 conflicts, and get some mainline bug fixes needed for my testing box Conflicts: drivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/intel_display.c --- a8c6ecb3be7029881f7c95e5e201a629094a4e1a diff --cc drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index b81cea6,b3e3068..d55c0c2 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c @@@ -85,10 -153,10 +85,10 @@@ static void atmel_hlcdc_crtc_mode_set_n (adj->crtc_hdisplay - 1) | ((adj->crtc_vdisplay - 1) << 16)); - cfg = ATMEL_HLCDC_CLKPOL; + cfg = 0; prate = clk_get_rate(crtc->dc->hlcdc->sys_clk); - mode_rate = mode->crtc_clock * 1000; + mode_rate = adj->crtc_clock * 1000; if ((prate / 2) < mode_rate) { prate *= 2; cfg |= ATMEL_HLCDC_CLKSEL; diff --cc drivers/gpu/drm/i915/i915_drv.h index 2903090,8727086..ee5bc43 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@@ -2027,9 -2140,17 +2030,18 @@@ struct drm_i915_gem_request /** Position in the ringbuffer of the end of the whole request */ u32 tail; - /** Context and ring buffer related to this request */ + /** - * Context related to this request ++ * Context and ring buffer related to this request + * Contexts are refcounted, so when this request is associated with a + * context, we must increment the context's refcount, to guarantee that + * it persists while any request is linked to it. Requests themselves + * are also refcounted, so the request will only be freed when the last + * reference to it is dismissed, and the code in + * i915_gem_request_free() will then decrement the refcount on the + * context. + */ struct intel_context *ctx; + struct intel_ringbuffer *ringbuf; /** Batch buffer related to this request if any */ struct drm_i915_gem_object *batch_obj; diff --cc drivers/gpu/drm/i915/intel_display.c index dbd8179,e730789..31f3b11 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@@ -2415,8 -2371,11 +2415,12 @@@ intel_alloc_plane_obj(struct intel_crt struct drm_device *dev = crtc->base.dev; struct drm_i915_gem_object *obj = NULL; struct drm_mode_fb_cmd2 mode_cmd = { 0 }; + struct drm_framebuffer *fb = &plane_config->fb->base; - u32 base = plane_config->base; + u32 base_aligned = round_down(plane_config->base, PAGE_SIZE); + u32 size_aligned = round_up(plane_config->base + plane_config->size, + PAGE_SIZE); + + size_aligned -= base_aligned; if (plane_config->size == 0) return false; @@@ -6752,10 -6640,9 +6767,10 @@@ i9xx_get_initial_plane_config(struct in fb->pitches[0] = val & 0xffffffc0; aligned_height = intel_fb_align_height(dev, fb->height, - plane_config->tiling); + fb->pixel_format, + fb->modifier[0]); - plane_config->size = PAGE_ALIGN(fb->pitches[0] * aligned_height); + plane_config->size = fb->pitches[0] * aligned_height; DRM_DEBUG_KMS("pipe/plane %c/%d with fb: size=%dx%d@%d, offset=%x, pitch %d, size 0x%x\n", pipe_name(pipe), plane, fb->width, fb->height, @@@ -7801,10 -7677,9 +7816,10 @@@ skylake_get_initial_plane_config(struc fb->pitches[0] = (val & 0x3ff) * stride_mult; aligned_height = intel_fb_align_height(dev, fb->height, - plane_config->tiling); + fb->pixel_format, + fb->modifier[0]); - plane_config->size = ALIGN(fb->pitches[0] * aligned_height, PAGE_SIZE); + plane_config->size = fb->pitches[0] * aligned_height; DRM_DEBUG_KMS("pipe %c with fb: size=%dx%d@%d, offset=%x, pitch %d, size 0x%x\n", pipe_name(pipe), fb->width, fb->height, @@@ -7898,10 -7768,9 +7913,10 @@@ ironlake_get_initial_plane_config(struc fb->pitches[0] = val & 0xffffffc0; aligned_height = intel_fb_align_height(dev, fb->height, - plane_config->tiling); + fb->pixel_format, + fb->modifier[0]); - plane_config->size = PAGE_ALIGN(fb->pitches[0] * aligned_height); + plane_config->size = fb->pitches[0] * aligned_height; DRM_DEBUG_KMS("pipe %c with fb: size=%dx%d@%d, offset=%x, pitch %d, size 0x%x\n", pipe_name(pipe), fb->width, fb->height,