nouveau_display.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* SPDX-License-Identifier: MIT */
  2. #ifndef __NOUVEAU_DISPLAY_H__
  3. #define __NOUVEAU_DISPLAY_H__
  4. #include "nouveau_drv.h"
  5. #include <nvif/disp.h>
  6. #include <drm/drm_framebuffer.h>
  7. int
  8. nouveau_framebuffer_new(struct drm_device *dev,
  9. const struct drm_mode_fb_cmd2 *mode_cmd,
  10. struct drm_gem_object *gem,
  11. struct drm_framebuffer **pfb);
  12. struct nouveau_display {
  13. void *priv;
  14. void (*dtor)(struct drm_device *);
  15. int (*init)(struct drm_device *, bool resume, bool runtime);
  16. void (*fini)(struct drm_device *, bool suspend, bool runtime);
  17. struct nvif_disp disp;
  18. struct drm_property *dithering_mode;
  19. struct drm_property *dithering_depth;
  20. struct drm_property *underscan_property;
  21. struct drm_property *underscan_hborder_property;
  22. struct drm_property *underscan_vborder_property;
  23. /* not really hue and saturation: */
  24. struct drm_property *vibrant_hue_property;
  25. struct drm_property *color_vibrance_property;
  26. struct drm_atomic_state *suspend;
  27. const u64 *format_modifiers;
  28. };
  29. static inline struct nouveau_display *
  30. nouveau_display(struct drm_device *dev)
  31. {
  32. return nouveau_drm(dev)->display;
  33. }
  34. int nouveau_display_create(struct drm_device *dev);
  35. void nouveau_display_destroy(struct drm_device *dev);
  36. int nouveau_display_init(struct drm_device *dev, bool resume, bool runtime);
  37. void nouveau_display_hpd_resume(struct drm_device *dev);
  38. void nouveau_display_fini(struct drm_device *dev, bool suspend, bool runtime);
  39. int nouveau_display_suspend(struct drm_device *dev, bool runtime);
  40. void nouveau_display_resume(struct drm_device *dev, bool runtime);
  41. int nouveau_display_vblank_enable(struct drm_crtc *crtc);
  42. void nouveau_display_vblank_disable(struct drm_crtc *crtc);
  43. bool nouveau_display_scanoutpos(struct drm_crtc *crtc,
  44. bool in_vblank_irq, int *vpos, int *hpos,
  45. ktime_t *stime, ktime_t *etime,
  46. const struct drm_display_mode *mode);
  47. int nouveau_display_dumb_create(struct drm_file *, struct drm_device *,
  48. struct drm_mode_create_dumb *args);
  49. void nouveau_hdmi_mode_set(struct drm_encoder *, struct drm_display_mode *);
  50. void
  51. nouveau_framebuffer_get_layout(struct drm_framebuffer *fb, uint32_t *tile_mode,
  52. uint8_t *kind);
  53. struct drm_framebuffer *
  54. nouveau_user_framebuffer_create(struct drm_device *, struct drm_file *,
  55. const struct drm_mode_fb_cmd2 *);
  56. #endif