Skip to content

Commit

Permalink
Merge pull request #45 from DisplayLink/devel
Browse files Browse the repository at this point in the history
Delivery of evdi module for DisplayLink USB Graphics Software for Ubuntu v1.2.1
  • Loading branch information
displaylink-mlukaszek authored Oct 5, 2016
2 parents 6fe15f5 + b79e5e9 commit d2ddc38
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
3 changes: 1 addition & 2 deletions library/evdi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,8 @@ void evdi_grab_pixels(evdi_handle handle, evdi_rect *rects, int *num_rects)
evdi_buffer* destinationBuffer = NULL;

destinationNode = findBuffer(handle, handle->bufferToUpdate);
assert(destinationNode);

if (destinationNode->isInvalidated) {
if (!destinationNode || destinationNode->isInvalidated) {
printf("[libevdi] Buffer was invalidated due to mode change. Not grabbing.\n");
*num_rects = 0;
return;
Expand Down
4 changes: 2 additions & 2 deletions module/evdi_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

#define DRIVER_NAME "evdi"
#define DRIVER_DESC "Extensible Virtual Display Interface"
#define DRIVER_DATE "20160912"
#define DRIVER_DATE "20161003"

#define DRIVER_MAJOR 1
#define DRIVER_MINOR 2
#define DRIVER_PATCHLEVEL 55
#define DRIVER_PATCHLEVEL 64

struct evdi_fbdev;
struct evdi_painter;
Expand Down
10 changes: 10 additions & 0 deletions module/evdi_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,15 @@ static int evdi_user_framebuffer_dirty(struct drm_framebuffer *fb,
return ret;
}

static int evdi_user_framebuffer_create_handle(struct drm_framebuffer *fb,
struct drm_file *file_priv,
unsigned int *handle)
{
struct evdi_framebuffer *efb = to_evdi_fb(fb);

return drm_gem_handle_create(file_priv, &efb->obj->base, handle);
}

static void evdi_user_framebuffer_destroy(struct drm_framebuffer *fb)
{
struct evdi_framebuffer *ufb = to_evdi_fb(fb);
Expand All @@ -283,6 +292,7 @@ static void evdi_user_framebuffer_destroy(struct drm_framebuffer *fb)
}

static const struct drm_framebuffer_funcs evdifb_funcs = {
.create_handle = evdi_user_framebuffer_create_handle,
.destroy = evdi_user_framebuffer_destroy,
.dirty = evdi_user_framebuffer_dirty,
};
Expand Down
8 changes: 4 additions & 4 deletions module/evdi_painter.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static void evdi_painter_send_update_ready(struct evdi_painter *painter)
if (painter->drm_filp) {
event = kzalloc(sizeof(*event), GFP_KERNEL);
event->update_ready.base.type = DRM_EVDI_EVENT_UPDATE_READY;
event->update_ready.base.length = sizeof(*event);
event->update_ready.base.length = sizeof(event->update_ready);
event->base.event = &event->update_ready.base;
event->base.file_priv = painter->drm_filp;
#if KERNEL_VERSION(4, 8, 0) > LINUX_VERSION_CODE
Expand All @@ -231,7 +231,7 @@ static void evdi_painter_send_dpms(struct evdi_painter *painter, int mode)
if (painter->drm_filp) {
event = kzalloc(sizeof(*event), GFP_KERNEL);
event->dpms.base.type = DRM_EVDI_EVENT_DPMS;
event->dpms.base.length = sizeof(*event);
event->dpms.base.length = sizeof(event->dpms);
event->dpms.mode = mode;
event->base.event = &event->dpms.base;
event->base.file_priv = painter->drm_filp;
Expand All @@ -253,7 +253,7 @@ static void evdi_painter_send_crtc_state(struct evdi_painter *painter,
if (painter->drm_filp) {
event = kzalloc(sizeof(*event), GFP_KERNEL);
event->crtc_state.base.type = DRM_EVDI_EVENT_CRTC_STATE;
event->crtc_state.base.length = sizeof(*event);
event->crtc_state.base.length = sizeof(event->crtc_state);
event->crtc_state.state = state;
event->base.event = &event->crtc_state.base;
event->base.file_priv = painter->drm_filp;
Expand Down Expand Up @@ -292,7 +292,7 @@ static void evdi_painter_send_mode_changed(struct evdi_painter *painter,
if (painter->drm_filp) {
event = kzalloc(sizeof(*event), GFP_KERNEL);
event->mode_changed.base.type = DRM_EVDI_EVENT_MODE_CHANGED;
event->mode_changed.base.length = sizeof(*event);
event->mode_changed.base.length = sizeof(event->mode_changed);

event->mode_changed.hdisplay = painter->current_mode.hdisplay;
event->mode_changed.vdisplay = painter->current_mode.vdisplay;
Expand Down

0 comments on commit d2ddc38

Please sign in to comment.