Relicense Sortix to the ISC license.
I hereby relicense all my work on Sortix under the ISC license as below.
All Sortix contributions by other people are already under this license,
are not substantial enough to be copyrightable, or have been removed.
All imported code from other projects is compatible with this license.
All GPL licensed code from other projects had previously been removed.
Copyright 2011-2016 Jonas 'Sortie' Termansen and contributors.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2016-03-02 22:38:16 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2012, 2014, 2015 Jonas 'Sortie' Termansen.
|
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*
|
|
|
|
* sortix/kernel/video.h
|
|
|
|
* Framework for Sortix video drivers.
|
|
|
|
*/
|
2012-05-02 00:43:55 +00:00
|
|
|
|
2014-03-25 19:28:51 +00:00
|
|
|
#ifndef INCLUDE_SORTIX_KERNEL_VIDEO_H
|
|
|
|
#define INCLUDE_SORTIX_KERNEL_VIDEO_H
|
2012-05-02 00:43:55 +00:00
|
|
|
|
2014-02-25 21:39:57 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
2014-03-25 19:28:51 +00:00
|
|
|
#include <sortix/display.h>
|
|
|
|
|
|
|
|
#include <sortix/kernel/ioctx.h>
|
2012-08-07 22:19:44 +00:00
|
|
|
#include <sortix/kernel/refcount.h>
|
|
|
|
|
2012-05-02 00:43:55 +00:00
|
|
|
namespace Sortix {
|
|
|
|
|
|
|
|
class TextBuffer;
|
|
|
|
class TextBufferHandle;
|
|
|
|
|
2014-03-25 19:28:51 +00:00
|
|
|
class VideoDevice
|
2012-05-02 00:43:55 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-03-25 19:28:51 +00:00
|
|
|
virtual ~VideoDevice() { }
|
|
|
|
virtual struct dispmsg_crtc_mode GetCurrentMode(uint64_t connector) const = 0;
|
|
|
|
virtual bool SwitchMode(uint64_t connector, struct dispmsg_crtc_mode mode) = 0;
|
|
|
|
virtual bool Supports(uint64_t connector, struct dispmsg_crtc_mode mode) const = 0;
|
|
|
|
virtual struct dispmsg_crtc_mode* GetModes(uint64_t connector, size_t* nummodes) const = 0;
|
2012-05-02 00:43:55 +00:00
|
|
|
virtual off_t FrameSize() const = 0;
|
2014-03-25 19:28:51 +00:00
|
|
|
virtual ssize_t WriteAt(ioctx_t* ctx, off_t off, const void* buf, size_t count) = 0;
|
|
|
|
virtual ssize_t ReadAt(ioctx_t* ctx, off_t off, void* buf, size_t count) = 0;
|
|
|
|
virtual TextBuffer* CreateTextBuffer(uint64_t connector) = 0;
|
2012-05-02 00:43:55 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2014-03-25 19:28:51 +00:00
|
|
|
} // namespace Sortix
|
|
|
|
|
|
|
|
namespace Sortix {
|
2012-05-02 00:43:55 +00:00
|
|
|
namespace Video {
|
|
|
|
|
2014-03-25 19:28:51 +00:00
|
|
|
bool RegisterDevice(const char* name, VideoDevice* device);
|
2012-05-02 00:43:55 +00:00
|
|
|
|
|
|
|
} // namespace Video
|
|
|
|
} // namespace Sortix
|
|
|
|
|
|
|
|
#endif
|