overlay.c (ecd740c6f2f092b90b95fa35f757973589eaaca2) overlay.c (fa2bade99a6fb24c3847d48ba3cad9a70dbb5364)
1/*
2 * Copyright 2013 Ilia Mirkin
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the

--- 242 unchanged lines hidden (view full) ---

251 .disable_plane = nv10_disable_plane,
252 .set_property = nv_set_property,
253 .destroy = nv_destroy_plane,
254};
255
256static void
257nv10_overlay_init(struct drm_device *device)
258{
1/*
2 * Copyright 2013 Ilia Mirkin
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the

--- 242 unchanged lines hidden (view full) ---

251 .disable_plane = nv10_disable_plane,
252 .set_property = nv_set_property,
253 .destroy = nv_destroy_plane,
254};
255
256static void
257nv10_overlay_init(struct drm_device *device)
258{
259 struct nouveau_device *dev = nouveau_dev(device);
259 struct nouveau_drm *drm = nouveau_drm(device);
260 struct nouveau_plane *plane = kzalloc(sizeof(struct nouveau_plane), GFP_KERNEL);
261 int num_formats = ARRAY_SIZE(formats);
262 int ret;
263
264 if (!plane)
265 return;
266
260 struct nouveau_plane *plane = kzalloc(sizeof(struct nouveau_plane), GFP_KERNEL);
261 int num_formats = ARRAY_SIZE(formats);
262 int ret;
263
264 if (!plane)
265 return;
266
267 switch (dev->chipset) {
267 switch (nv_device(drm->device)->chipset) {
268 case 0x10:
269 case 0x11:
270 case 0x15:
271 case 0x1a:
272 case 0x20:
273 num_formats = 2;
274 break;
275 }

--- 52 unchanged lines hidden (view full) ---

328 plane->set_params = nv10_set_params;
329 nv10_set_params(plane);
330 nv10_disable_plane(&plane->base);
331 return;
332cleanup:
333 drm_plane_cleanup(&plane->base);
334err:
335 kfree(plane);
268 case 0x10:
269 case 0x11:
270 case 0x15:
271 case 0x1a:
272 case 0x20:
273 num_formats = 2;
274 break;
275 }

--- 52 unchanged lines hidden (view full) ---

328 plane->set_params = nv10_set_params;
329 nv10_set_params(plane);
330 nv10_disable_plane(&plane->base);
331 return;
332cleanup:
333 drm_plane_cleanup(&plane->base);
334err:
335 kfree(plane);
336 nv_error(dev, "Failed to create plane\n");
336 NV_ERROR(drm, "Failed to create plane\n");
337}
338
339static int
340nv04_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
341 struct drm_framebuffer *fb, int crtc_x, int crtc_y,
342 unsigned int crtc_w, unsigned int crtc_h,
343 uint32_t src_x, uint32_t src_y,
344 uint32_t src_w, uint32_t src_h)

--- 97 unchanged lines hidden (view full) ---

442 .disable_plane = nv04_disable_plane,
443 .set_property = nv_set_property,
444 .destroy = nv_destroy_plane,
445};
446
447static void
448nv04_overlay_init(struct drm_device *device)
449{
337}
338
339static int
340nv04_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
341 struct drm_framebuffer *fb, int crtc_x, int crtc_y,
342 unsigned int crtc_w, unsigned int crtc_h,
343 uint32_t src_x, uint32_t src_y,
344 uint32_t src_w, uint32_t src_h)

--- 97 unchanged lines hidden (view full) ---

442 .disable_plane = nv04_disable_plane,
443 .set_property = nv_set_property,
444 .destroy = nv_destroy_plane,
445};
446
447static void
448nv04_overlay_init(struct drm_device *device)
449{
450 struct nouveau_device *dev = nouveau_dev(device);
450 struct nouveau_drm *drm = nouveau_drm(device);
451 struct nouveau_plane *plane = kzalloc(sizeof(struct nouveau_plane), GFP_KERNEL);
452 int ret;
453
454 if (!plane)
455 return;
456
457 ret = drm_plane_init(device, &plane->base, 1 /* single crtc */,
458 &nv04_plane_funcs,

--- 19 unchanged lines hidden (view full) ---

478 plane->props.brightness, plane->brightness);
479
480 nv04_disable_plane(&plane->base);
481 return;
482cleanup:
483 drm_plane_cleanup(&plane->base);
484err:
485 kfree(plane);
451 struct nouveau_plane *plane = kzalloc(sizeof(struct nouveau_plane), GFP_KERNEL);
452 int ret;
453
454 if (!plane)
455 return;
456
457 ret = drm_plane_init(device, &plane->base, 1 /* single crtc */,
458 &nv04_plane_funcs,

--- 19 unchanged lines hidden (view full) ---

478 plane->props.brightness, plane->brightness);
479
480 nv04_disable_plane(&plane->base);
481 return;
482cleanup:
483 drm_plane_cleanup(&plane->base);
484err:
485 kfree(plane);
486 nv_error(dev, "Failed to create plane\n");
486 NV_ERROR(drm, "Failed to create plane\n");
487}
488
489void
490nouveau_overlay_init(struct drm_device *device)
491{
492 struct nouveau_device *dev = nouveau_dev(device);
493 if (dev->chipset < 0x10)
494 nv04_overlay_init(device);
495 else if (dev->chipset <= 0x40)
496 nv10_overlay_init(device);
497}
487}
488
489void
490nouveau_overlay_init(struct drm_device *device)
491{
492 struct nouveau_device *dev = nouveau_dev(device);
493 if (dev->chipset < 0x10)
494 nv04_overlay_init(device);
495 else if (dev->chipset <= 0x40)
496 nv10_overlay_init(device);
497}