@@ -254,46 +254,48 @@ static int sti_crtc_set_property(struct drm_crtc *crtc,
254
254
int sti_crtc_vblank_cb (struct notifier_block * nb ,
255
255
unsigned long event , void * data )
256
256
{
257
- struct drm_device * drm_dev ;
258
257
struct sti_compositor * compo =
259
258
container_of (nb , struct sti_compositor , vtg_vblank_nb );
260
- int * crtc = data ;
259
+ struct drm_crtc * crtc = data ;
260
+ struct sti_mixer * mixer ;
261
261
unsigned long flags ;
262
262
struct sti_private * priv ;
263
+ unsigned int pipe ;
263
264
264
- drm_dev = compo -> mixer [* crtc ]-> drm_crtc .dev ;
265
- priv = drm_dev -> dev_private ;
265
+ priv = crtc -> dev -> dev_private ;
266
+ pipe = drm_crtc_index (crtc );
267
+ mixer = compo -> mixer [pipe ];
266
268
267
269
if ((event != VTG_TOP_FIELD_EVENT ) &&
268
270
(event != VTG_BOTTOM_FIELD_EVENT )) {
269
271
DRM_ERROR ("unknown event: %lu\n" , event );
270
272
return - EINVAL ;
271
273
}
272
274
273
- drm_handle_vblank ( drm_dev , * crtc );
275
+ drm_crtc_handle_vblank ( crtc );
274
276
275
- spin_lock_irqsave (& drm_dev -> event_lock , flags );
276
- if (compo -> mixer [* crtc ]-> pending_event ) {
277
- drm_send_vblank_event (drm_dev , * crtc ,
278
- compo -> mixer [* crtc ]-> pending_event );
279
- drm_vblank_put (drm_dev , * crtc );
280
- compo -> mixer [* crtc ]-> pending_event = NULL ;
277
+ spin_lock_irqsave (& crtc -> dev -> event_lock , flags );
278
+ if (mixer -> pending_event ) {
279
+ drm_crtc_send_vblank_event (crtc , mixer -> pending_event );
280
+ drm_crtc_vblank_put (crtc );
281
+ mixer -> pending_event = NULL ;
281
282
}
282
- spin_unlock_irqrestore (& drm_dev -> event_lock , flags );
283
+ spin_unlock_irqrestore (& crtc -> dev -> event_lock , flags );
283
284
284
- if (compo -> mixer [ * crtc ] -> status == STI_MIXER_DISABLING ) {
285
+ if (mixer -> status == STI_MIXER_DISABLING ) {
285
286
struct drm_plane * p ;
286
287
287
288
/* Disable mixer only if all overlay planes (GDP and VDP)
288
289
* are disabled */
289
- list_for_each_entry (p , & drm_dev -> mode_config .plane_list , head ) {
290
+ list_for_each_entry (p , & crtc -> dev -> mode_config .plane_list ,
291
+ head ) {
290
292
struct sti_plane * plane = to_sti_plane (p );
291
293
292
294
if ((plane -> desc & STI_PLANE_TYPE_MASK ) <= STI_VDP )
293
295
if (plane -> status != STI_PLANE_DISABLED )
294
296
return 0 ;
295
297
}
296
- sti_crtc_disable (& compo -> mixer [ * crtc ] -> drm_crtc );
298
+ sti_crtc_disable (crtc );
297
299
}
298
300
299
301
return 0 ;
@@ -304,12 +306,13 @@ int sti_crtc_enable_vblank(struct drm_device *dev, unsigned int pipe)
304
306
struct sti_private * dev_priv = dev -> dev_private ;
305
307
struct sti_compositor * compo = dev_priv -> compo ;
306
308
struct notifier_block * vtg_vblank_nb = & compo -> vtg_vblank_nb ;
309
+ struct drm_crtc * crtc = & compo -> mixer [pipe ]-> drm_crtc ;
307
310
308
311
DRM_DEBUG_DRIVER ("\n" );
309
312
310
313
if (sti_vtg_register_client (pipe == STI_MIXER_MAIN ?
311
314
compo -> vtg_main : compo -> vtg_aux ,
312
- vtg_vblank_nb , pipe )) {
315
+ vtg_vblank_nb , crtc )) {
313
316
DRM_ERROR ("Cannot register VTG notifier\n" );
314
317
return - EINVAL ;
315
318
}
@@ -323,6 +326,7 @@ void sti_crtc_disable_vblank(struct drm_device *drm_dev, unsigned int pipe)
323
326
struct sti_private * priv = drm_dev -> dev_private ;
324
327
struct sti_compositor * compo = priv -> compo ;
325
328
struct notifier_block * vtg_vblank_nb = & compo -> vtg_vblank_nb ;
329
+ struct drm_crtc * crtc = & compo -> mixer [pipe ]-> drm_crtc ;
326
330
327
331
DRM_DEBUG_DRIVER ("\n" );
328
332
@@ -332,7 +336,7 @@ void sti_crtc_disable_vblank(struct drm_device *drm_dev, unsigned int pipe)
332
336
333
337
/* free the resources of the pending requests */
334
338
if (compo -> mixer [pipe ]-> pending_event ) {
335
- drm_vblank_put ( drm_dev , pipe );
339
+ drm_crtc_vblank_put ( crtc );
336
340
compo -> mixer [pipe ]-> pending_event = NULL ;
337
341
}
338
342
}
0 commit comments